Difference between revisions of "IoTGateway/SDK/NALInterface"
From ESS-WIKI
(→Definition) |
(→Definition) |
||
Line 2: | Line 2: | ||
:The main way '''WSN API SDK''' can be extended is to add new "'''NET'''" modules into its palette. Customer can follow the general C API, structure, command, event and define ( called "'''NAL'''" layer Interface ) to add its own "NET" modules (ex: zigbee, bluetooth... ). | :The main way '''WSN API SDK''' can be extended is to add new "'''NET'''" modules into its palette. Customer can follow the general C API, structure, command, event and define ( called "'''NAL'''" layer Interface ) to add its own "NET" modules (ex: zigbee, bluetooth... ). | ||
− | =Definition= | + | =Basic Definition & Code Number & Structure= |
+ | ==Definition== | ||
MAX_SN_INF_NAME 16 // Max size of Interface's Name | MAX_SN_INF_NAME 16 // Max size of Interface's Name | ||
MAX_SN_INF_ID 64 // Max size of Interface's Unique ID | MAX_SN_INF_ID 64 // Max size of Interface's Unique ID | ||
Line 12: | Line 13: | ||
MAX_SN_PRODUCT_NAME 32 // Max size of SenHub's Product Name | MAX_SN_PRODUCT_NAME 32 // Max size of SenHub's Product Name | ||
+ | ==Callback Event ID== | ||
typedef enum { | typedef enum { | ||
// Interface: 1000 ~ 1999 | // Interface: 1000 ~ 1999 | ||
Line 24: | Line 26: | ||
}SN_EVENT_ID; | }SN_EVENT_ID; | ||
− | + | ==Control ID== | |
typedef enum { | typedef enum { | ||
SN_Set_ReportSNManagerDataCbf = 3000, | SN_Set_ReportSNManagerDataCbf = 3000, | ||
Line 34: | Line 36: | ||
}SN_CTL_ID; | }SN_CTL_ID; | ||
+ | ==Code Number== | ||
typedef enum { | typedef enum { | ||
SN_ER_NOT_IMPLEMENT = -13, /* Does Not Support this command (501) */ | SN_ER_NOT_IMPLEMENT = -13, /* Does Not Support this command (501) */ |
Revision as of 04:14, 26 February 2016
Contents
Abstract
- The main way WSN API SDK can be extended is to add new "NET" modules into its palette. Customer can follow the general C API, structure, command, event and define ( called "NAL" layer Interface ) to add its own "NET" modules (ex: zigbee, bluetooth... ).
Basic Definition & Code Number & Structure
Definition
MAX_SN_INF_NAME 16 // Max size of Interface's Name MAX_SN_INF_ID 64 // Max size of Interface's Unique ID MAX_SN_INF_NUM 8 // Max supports interface number MAX_SN_COM_NAME 32 // Max size of Communication(Net) Type Name MAX_SN_UID 64 // Max size of SenHub Unique ID MAX_SN_HOSTNAME 32 // Max size of SenHub Name MAX_SN_SNO 32 // Max size of SenHub's Serial Number MAX_SN_PRODUCT_NAME 32 // Max size of SenHub's Product Name
Callback Event ID
typedef enum { // Interface: 1000 ~ 1999 SN_Inf_UpdateInterface_Data = 1000, // Update Interface data from Sensor Network Library SN_Inf_SendInfoSpec = 1001, // Update Interface InfoSpec (Capability) // Sensor Node: 2000 ~ 2999 SN_SenHub_Register = 2000, // Sensor Hub Register SN_SenHub_SendInfoSpec = 2001, // Update Sensor Hub InfoSpec (Capability) SN_SenHub_AutoReportData = 2002, // Update Sensor Hub data SN_SenHub_Disconnect = 2003, // Sensor Hub disconnect SN_SetResult = 3000, }SN_EVENT_ID;
Control ID
typedef enum { SN_Set_ReportSNManagerDataCbf = 3000, // Get / Set SN_Inf_Get = 6000, SN_Inf_Set = 6001, SN_SenHub_Get = 6020, SN_SenHub_Set = 6021, }SN_CTL_ID;
Code Number
typedef enum { SN_ER_NOT_IMPLEMENT = -13, /* Does Not Support this command (501) */ SN_ER_TIMEOUT = -12, /* Request Timeout (408) */ SN_ER_SYS_BUSY = -11, /* System is busy (503) */ SN_ER_VALUE_OUT_OF_RNAGE = -10, /* Value is out of range (416) */ SN_ER_SYNTAX_ERROR = -9, /* Format is correct but syntax error (422) */ SN_ER_FORMAT_ERROR = -8, /* Format error (415) */ SN_ER_REQUEST_ERROR = -7, /* Request error (400) */ SN_ER_RESOURCE_LOSE = -6, /* SenHub disconnect (410) */ SN_ER_RESOURCE_LOCKED = -5, /* Resource is in setting (426) */ SN_ER_NOT_FOUND = -4, /* Resource Not Found (404) */ SN_ER_WRITE_ONLY = -3, /* Read Only (405) */ SN_ER_READ_ONLY = -2, /* Write Only (405) */ SN_ER_FAILED = -1, /* Failed (500) */ SN_OK = 0, /* Success (200) */ SN_INITILIZED = 1, /* Library had initilized */ } SN_CODE;