全部博文(92)
分类: 嵌入式
2010-09-19 13:50:43
三维数组
在sw_main.h中定义:
typedef unsigned char byte;
typedef byte arr30_T[30];
typedef enum
{
SOS_ALERT_MSG_ID=0,
FALL_ALERT_MSG_ID,
TEMP_EXCEPTION_ALERT_MSG_ID,
OUTSIDE_ALERT_MSG_ID,
ALERT_MSG_ID_MAX
}alert_msg_id_T;
在sw_main.c中创建一个三维数组:
arr30_T alert_msg_content[ALERT_MSG_ID_MAX]=
{
//手机用户紧急报警
{0x62,0x4B,0x88,0x68,0x75,0x28,0x62,0x37,0x7D,0x27,0x60,0x25,0x62,0xA5,0x7D,0x27,0xff,0x01},
//手机用户跌倒
{0x62,0x4B,0x88,0x68,0x75,0x28,0x62,0x37,0x8D,0xCC,0x50,0x12,0xff,0x01},
//手机用户体温异常
{0x62,0x4B,0x88,0x68,0x75,0x28,0x62,0x37,0x4F,0x53,0x6E,0x29,0x5F,0x02,0x5E,0x38,0xff,0x01},
//手机用户越界
{0x62,0x4B,0x88,0x68,0x75,0x28,0x62,0x37,0x8D,0x8A,0x75,0x4C,0xff,0x01}
};
在zeni_app.c中调用这个多维数组:
extern arr30_T alert_msg_content[ALERT_MSG_ID_MAX];
zeni_apps_send_at_bin_data((byte*)alert_msg_content[SOS_ALERT_MSG_ID],sizeof(alert_msg_content[SOS_ALERT_MSG_ID]));