LM005A Lora Module test

Dependents:   LoRaTest OnenetTest

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers BC95B.h Source File

BC95B.h

00001 /* BC95BInterface Example
00002   
00003  */
00004 
00005 #ifndef BC95B_H
00006 #define BC95B_H
00007 
00008 #include "ATCmdParser.h"
00009 
00010 /** BC95BInterface class.
00011     This is an interface to a BC95B radio.
00012  */
00013 class BC95B
00014 {
00015 protected:
00016 void (*_callback)(void); 
00017 public:
00018     BC95B(PinName tx, PinName rx, bool debug=false);
00019     bool init(void);
00020     const char * get_firmware_version(void);
00021     const char * get_imei();
00022     const char * get_imsi();
00023     bool BC95B::get_SignalStrength (int* rssi,int* ber);
00024     int   create_suite();
00025     bool  create_object(int ch,const int name,int insCount,const char * bitmap,int attrCount,int actCount);
00026     bool  register_request(int ref,int lifetime,int timeout);
00027     //bool  respond_discover(int ref,int result ,int length,char *valuestring); 
00028     bool  delete_object(int ref,const char * objid);
00029     bool  deregister(int ref);
00030     bool notify_resource(int ref,int objid,int ins,int resid,int valueType,int len,const char * value,int index,int flg);
00031     bool reset(void);
00032     void attach(void (*func)(void));   
00033     bool recv(void);
00034     void setTimeout(uint32_t timeout_ms);
00035     int getEventCode();
00036     void getCurrentID(long *msgId,int *objID,int *insId,int *resId);
00037     int  getCurrentValue(char *buf);
00038     int  putCurrentValue(int type,char *buf,int length);
00039     int  putCurrentResNames(int type,char *buf,int length);
00040 private:
00041      int ref,objId,insId,resId,valueType,len,index,flag,result;
00042      int curr_objId,curr_insId,curr_resId,currCode,currType;
00043     long curr_msgId;
00044     long msg,obsmsg;
00045     char value[32];
00046     char resNames[32];
00047     int valueLength;
00048     int resLength;
00049     UARTSerial _serial;
00050     ATCmdParser _parser;
00051       char buffer[64];
00052      bool _fail;
00053     void _read_handler();
00054     void _write_handler();
00055     void _obs_handler();
00056     void _discover_handler();
00057 };
00058 
00059 #endif