Firmware SDK
twr_module_sigfox.h
1 #ifndef _TWR_MODULE_SIGFOX_H
2 #define _TWR_MODULE_SIGFOX_H
3 
4 #include <twr_td1207r.h>
5 #include <twr_wssfm10r1at.h>
6 
10 
12 
13 typedef enum
14 {
17 
20 
22 
24 
25 typedef enum
26 {
29 
32 
35 
38 
41 
44 
46 
48 
49 typedef struct twr_module_sigfox_t twr_module_sigfox_t;
50 
51 struct twr_module_sigfox_t
52 {
54  void (*_event_handler)(twr_module_sigfox_t *, twr_module_sigfox_event_t, void *);
55  void *_event_param;
56  union
57  {
58  twr_td1207r_t td1207r;
59  twr_wssfm10r1at_t wssfm10r1at;
60  } _modem;
61 };
62 
64 
67 
68 void twr_module_sigfox_init(twr_module_sigfox_t *self, twr_module_sigfox_revision_t revision);
69 
74 
75 void twr_module_sigfox_set_event_handler(twr_module_sigfox_t *self, void (*event_handler)(twr_module_sigfox_t *, twr_module_sigfox_event_t, void *), void *event_param);
76 
81 
82 bool twr_module_sigfox_is_ready(twr_module_sigfox_t *self);
83 
90 
91 bool twr_module_sigfox_send_rf_frame(twr_module_sigfox_t *self, const void *buffer, size_t length);
92 
97 
98 bool twr_module_sigfox_read_device_id(twr_module_sigfox_t *self);
99 
106 
107 bool twr_module_sigfox_get_device_id(twr_module_sigfox_t *self, char *buffer, size_t buffer_size);
108 
113 
114 bool twr_module_sigfox_read_device_pac(twr_module_sigfox_t *self);
115 
122 
123 bool twr_module_sigfox_get_device_pac(twr_module_sigfox_t *self, char *buffer, size_t buffer_size);
124 
129 
130 bool twr_module_sigfox_continuous_wave(twr_module_sigfox_t *self);
131 
133 
134 #endif // _TWR_MODULE_SIGFOX_H
void twr_module_sigfox_set_event_handler(twr_module_sigfox_t *self, void(*event_handler)(twr_module_sigfox_t *, twr_module_sigfox_event_t, void *), void *event_param)
Set callback function.
bool twr_module_sigfox_get_device_pac(twr_module_sigfox_t *self, char *buffer, size_t buffer_size)
Get device PAC (can be called only in TWR_WSSFM10R1AT_EVENT_READ_DEVICE_ID event)
bool twr_module_sigfox_read_device_pac(twr_module_sigfox_t *self)
Read device PAC command.
bool twr_module_sigfox_read_device_id(twr_module_sigfox_t *self)
Read device ID command.
twr_module_sigfox_revision_t
SigFox Module hardware revision.
bool twr_module_sigfox_is_ready(twr_module_sigfox_t *self)
Check if modem is ready for commands.
bool twr_module_sigfox_send_rf_frame(twr_module_sigfox_t *self, const void *buffer, size_t length)
Send RF frame command.
twr_module_sigfox_event_t
Callback events.
void twr_module_sigfox_init(twr_module_sigfox_t *self, twr_module_sigfox_revision_t revision)
Initialize HARDWARIO SigFox Module.
bool twr_module_sigfox_continuous_wave(twr_module_sigfox_t *self)
Generate continuous wave command.
bool twr_module_sigfox_get_device_id(twr_module_sigfox_t *self, char *buffer, size_t buffer_size)
Get device ID (can be called only in TWR_WSSFM10R1AT_EVENT_READ_DEVICE_ID event)
@ TWR_MODULE_SIGFOX_REVISION_R1
Hardware revision R1.
@ TWR_MODULE_SIGFOX_REVISION_R2
Hardware revision R2.
@ TWR_MODULE_SIGFOX_EVENT_READ_DEVICE_PAC
Device PAC has been read event.
@ TWR_MODULE_SIGFOX_EVENT_SEND_RF_FRAME_DONE
RF frame transmission finished event.
@ TWR_MODULE_SIGFOX_EVENT_ERROR
Error event.
@ TWR_MODULE_SIGFOX_EVENT_READY
Ready event.
@ TWR_MODULE_SIGFOX_EVENT_READ_DEVICE_ID
Device ID has been read event.
@ TWR_MODULE_SIGFOX_EVENT_SEND_RF_FRAME_START
RF frame transmission started event.
struct twr_td1207r_t twr_td1207r_t
TD1207R instance.
Definition: twr_td1207r.h:39
struct twr_wssfm10r1at_t twr_wssfm10r1at_t
WSSFM10R1AT instance.