LM005A Lora Module test
Dependents: LoRaTest OnenetTest
BC95B/BC95B.h@1:0cad46274201, 2018-07-31 (annotated)
- Committer:
- yao6116601
- Date:
- Tue Jul 31 02:55:28 2018 +0000
- Revision:
- 1:0cad46274201
- Parent:
- LM005A/LM005A.h@0:5b5a1b5f1ae4
BC95B -- For China Mobile oneNet IoT
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
yao6116601 | 1:0cad46274201 | 1 | /* BC95BInterface Example |
yao6116601 | 1:0cad46274201 | 2 | |
yao6116601 | 0:5b5a1b5f1ae4 | 3 | */ |
yao6116601 | 0:5b5a1b5f1ae4 | 4 | |
yao6116601 | 1:0cad46274201 | 5 | #ifndef BC95B_H |
yao6116601 | 1:0cad46274201 | 6 | #define BC95B_H |
yao6116601 | 0:5b5a1b5f1ae4 | 7 | |
yao6116601 | 0:5b5a1b5f1ae4 | 8 | #include "ATCmdParser.h" |
yao6116601 | 0:5b5a1b5f1ae4 | 9 | |
yao6116601 | 1:0cad46274201 | 10 | /** BC95BInterface class. |
yao6116601 | 1:0cad46274201 | 11 | This is an interface to a BC95B radio. |
yao6116601 | 0:5b5a1b5f1ae4 | 12 | */ |
yao6116601 | 1:0cad46274201 | 13 | class BC95B |
yao6116601 | 0:5b5a1b5f1ae4 | 14 | { |
yao6116601 | 1:0cad46274201 | 15 | protected: |
yao6116601 | 1:0cad46274201 | 16 | void (*_callback)(void); |
yao6116601 | 0:5b5a1b5f1ae4 | 17 | public: |
yao6116601 | 1:0cad46274201 | 18 | BC95B(PinName tx, PinName rx, bool debug=false); |
yao6116601 | 0:5b5a1b5f1ae4 | 19 | bool init(void); |
yao6116601 | 0:5b5a1b5f1ae4 | 20 | const char * get_firmware_version(void); |
yao6116601 | 1:0cad46274201 | 21 | const char * get_imei(); |
yao6116601 | 1:0cad46274201 | 22 | const char * get_imsi(); |
yao6116601 | 1:0cad46274201 | 23 | bool BC95B::get_SignalStrength (int* rssi,int* ber); |
yao6116601 | 1:0cad46274201 | 24 | int create_suite(); |
yao6116601 | 1:0cad46274201 | 25 | bool create_object(int ch,const int name,int insCount,const char * bitmap,int attrCount,int actCount); |
yao6116601 | 1:0cad46274201 | 26 | bool register_request(int ref,int lifetime,int timeout); |
yao6116601 | 1:0cad46274201 | 27 | //bool respond_discover(int ref,int result ,int length,char *valuestring); |
yao6116601 | 1:0cad46274201 | 28 | bool delete_object(int ref,const char * objid); |
yao6116601 | 1:0cad46274201 | 29 | bool deregister(int ref); |
yao6116601 | 1:0cad46274201 | 30 | bool notify_resource(int ref,int objid,int ins,int resid,int valueType,int len,const char * value,int index,int flg); |
yao6116601 | 0:5b5a1b5f1ae4 | 31 | bool reset(void); |
yao6116601 | 1:0cad46274201 | 32 | void attach(void (*func)(void)); |
yao6116601 | 1:0cad46274201 | 33 | bool recv(void); |
yao6116601 | 0:5b5a1b5f1ae4 | 34 | void setTimeout(uint32_t timeout_ms); |
yao6116601 | 1:0cad46274201 | 35 | int getEventCode(); |
yao6116601 | 1:0cad46274201 | 36 | void getCurrentID(long *msgId,int *objID,int *insId,int *resId); |
yao6116601 | 1:0cad46274201 | 37 | int getCurrentValue(char *buf); |
yao6116601 | 1:0cad46274201 | 38 | int putCurrentValue(int type,char *buf,int length); |
yao6116601 | 1:0cad46274201 | 39 | int putCurrentResNames(int type,char *buf,int length); |
yao6116601 | 0:5b5a1b5f1ae4 | 40 | private: |
yao6116601 | 1:0cad46274201 | 41 | int ref,objId,insId,resId,valueType,len,index,flag,result; |
yao6116601 | 1:0cad46274201 | 42 | int curr_objId,curr_insId,curr_resId,currCode,currType; |
yao6116601 | 1:0cad46274201 | 43 | long curr_msgId; |
yao6116601 | 1:0cad46274201 | 44 | long msg,obsmsg; |
yao6116601 | 1:0cad46274201 | 45 | char value[32]; |
yao6116601 | 1:0cad46274201 | 46 | char resNames[32]; |
yao6116601 | 1:0cad46274201 | 47 | int valueLength; |
yao6116601 | 1:0cad46274201 | 48 | int resLength; |
yao6116601 | 0:5b5a1b5f1ae4 | 49 | UARTSerial _serial; |
yao6116601 | 0:5b5a1b5f1ae4 | 50 | ATCmdParser _parser; |
yao6116601 | 1:0cad46274201 | 51 | char buffer[64]; |
yao6116601 | 1:0cad46274201 | 52 | bool _fail; |
yao6116601 | 1:0cad46274201 | 53 | void _read_handler(); |
yao6116601 | 1:0cad46274201 | 54 | void _write_handler(); |
yao6116601 | 1:0cad46274201 | 55 | void _obs_handler(); |
yao6116601 | 1:0cad46274201 | 56 | void _discover_handler(); |
yao6116601 | 0:5b5a1b5f1ae4 | 57 | }; |
yao6116601 | 0:5b5a1b5f1ae4 | 58 | |
yao6116601 | 0:5b5a1b5f1ae4 | 59 | #endif |