|
ProtoCore v1.0.16
Deterministic, zero-heap network stack for embedded targets
|
Sigfox modem AT-command codec (PROTOCORE_ENABLE_SIGFOX) - Wisol / Murata over UART. More...
#include "protocore_config.h"Go to the source code of this file.
Classes | |
| struct | SigfoxNs |
| Dispatch table. Addressed by offset, so the layout is asserted below. More... | |
Typedefs | |
| typedef enum PROTO_ENUM_PACKED | protocore_sigfox_result |
| Classification of a Sigfox modem response line. | |
Enumerations | |
| enum | PROTO_ENUM_PACKED { SIGFOX_PENDING = 0 , SIGFOX_OK = 1 , SIGFOX_ERROR = 2 } |
| Classification of a Sigfox modem response line. More... | |
Functions | |
| PROTOCORE_NS_LAYOUT (SigfoxNs, build_uplink, parse_response) | |
| uint16_t | protocore_sigfox_build_uplink (uint8_t *work, const uint8_t *payload, uint8_t len, char *out, uint16_t cap) |
Format an AT$SF=<hex>\r\n uplink command for payload into out (a . | |
| protocore_sigfox_result | protocore_sigfox_parse_response (uint8_t *work, const char *buf, uint16_t len) |
| Classify a modem reply (scans buf for "OK" / "ERROR"). | |
Variables | |
| PROTOCORE_NS SigfoxNs Sigfox | PROTOCORE_UNUSED |
| Module namespace. | |
Sigfox modem AT-command codec (PROTOCORE_ENABLE_SIGFOX) - Wisol / Murata over UART.
The tiny-uplink half of a Sigfox-to-web bridge. A Wisol (SFM10R) / Murata Sigfox modem is driven by AT commands over a UART: protocore_sigfox_build_uplink() formats an AT$SF=<hex> command for a payload (the Sigfox network caps a message at 12 bytes and ~140 messages per day, so uplinks are rare and small), and protocore_sigfox_parse_response() classifies the modem's reply as OK, ERROR, or still pending (nothing conclusive yet). Pure text codec - you carry the bytes over your UART - so it is fully host-testable. This is uplink-only (the common Sigfox use); a device sends readings up, it is not addressed downlink.
work is bytes the CALLER holds. This module reads none of them: it carries nothing between calls, so there is no state to keep and nothing to wipe. The parameter is there so a caller drives every namespace the same way.
Definition in file sigfox.h.
| typedef enum PROTO_ENUM_PACKED protocore_sigfox_result |
Classification of a Sigfox modem response line.
| enum PROTO_ENUM_PACKED |
| PROTOCORE_NS_LAYOUT | ( | SigfoxNs | , |
| build_uplink | , | ||
| parse_response | |||
| ) |
| uint16_t protocore_sigfox_build_uplink | ( | uint8_t * | work, |
| const uint8_t * | payload, | ||
| uint8_t | len, | ||
| char * | out, | ||
| uint16_t | cap | ||
| ) |
Format an AT$SF=<hex>\r\n uplink command for payload into out (a .
| work | PROTOCORE_SIGFOX_BORROW bytes the caller took. Not held past the call. |
| payload | Payload |
| len | Len |
| out | Out |
| cap | Cap |
| protocore_sigfox_result protocore_sigfox_parse_response | ( | uint8_t * | work, |
| const char * | buf, | ||
| uint16_t | len | ||
| ) |
Classify a modem reply (scans buf for "OK" / "ERROR").
| work | PROTOCORE_SIGFOX_BORROW bytes the caller took. Not held past the call. |
| buf | Buf |
| len | Len |
| PROTOCORE_NS SigfoxNs Sigfox PROTOCORE_UNUSED |
Module namespace.