Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of d7a_1x by
Diff: include/d7a_modem.h
- Revision:
- 43:28202405094d
- Parent:
- 34:1311cc53201a
- Child:
- 45:b85384e7d825
diff -r c1e7f97ab396 -r 28202405094d include/d7a_modem.h
--- a/include/d7a_modem.h Thu Aug 25 09:38:40 2016 +0000
+++ b/include/d7a_modem.h Tue Aug 30 16:59:12 2016 +0000
@@ -12,6 +12,7 @@
};
+
//======================================================================
// MODEM commands over COM port
//======================================================================
@@ -32,6 +33,10 @@
/// Notify a (previously registered) file
/// ARGS: notify_file_param_t
WM_CMD_NOTIFY_FILE = 0x05,
+ WM_CMD_CREATE_FILE = 0x06,
+ WM_CMD_DECLARE_FILE = 0x07,
+ WM_CMD_START_STACK = 0x08,
+ WM_CMD_STOP_STACK = 0x09,
/// Send by the Modem Device after a command has been executed/taken
/// into account, and the Modem is ready to handle a new command.
@@ -54,23 +59,6 @@
} bf;
} boot_status_t;
-typedef union {
- uint32_t w;
- struct {
- uint32_t fid : 8;
- uint32_t retry_policy : 8;
- } bf;
-} register_file_param_t;
-
-typedef union {
- uint32_t w;
- struct {
- uint32_t fid : 8;
- uint32_t offset : 12;
- uint32_t size : 12;
- } bf;
-} notify_file_param_t;
-
typedef struct {
union {
uint8_t b[8];
@@ -80,60 +68,26 @@
} wm_status_t;
-//======================================================================
-// Firmware version Structure
-//
-// Used within the revision structure
-//======================================================================
-TYPEDEF_STRUCT_PACKED
-{
- uint8_t id;
- uint8_t major;
- uint8_t minor;
- uint16_t patch;
- uint32_t hash;
-} fw_version_t;
+typedef struct {
+ uint8_t fid;
+ uint8_t type;
+ uint8_t afid;
+ uint8_t ifid;
+ uint8_t prop;
+ uint8_t perm;
+ uint32_t size;
+ uint32_t alloc;
+} register_file_param_t;
-//======================================================================
-// Revision Structure
-//
-// Usage within D7B server:
-// An XML describing the File system of a device is associated to a
-// couple manufacturer_id/device_id (==Device).
-// Different versions of the Device's XML can exist and can be mapped
-// according to fw_version
-//======================================================================
-TYPEDEF_STRUCT_PACKED
-{
- /// Manufacturer ID: provided by Wizzilab
- // comes from: here
- uint32_t manufacturer_id;
- /// Device ID: Arbitrary number, at user/customer choice
- // comes from: application
- uint32_t device_id;
- /// Hardware Board ID:
- // comes from: board definition
- uint32_t hw_version;
- /// Firmware Version: made of
- /// - major,minor and patch indexes : comes from versioning tool
- /// - fw_id : "build-flavour" : comes from build setup
- /// FW_ID | MAJOR | MINOR | PATCH | HASH |
- // 1B | 1B | 1B | 2B | 4B |
- fw_version_t fw_version;
- /// "file-system" signature XXX: to be worked out
- // comes from: application
- uint32_t fs_crc;
-} revision_t;
-
-
-void d7a_modem_open( PinName reset_pin );
-void d7a_modem_reset( void );
-bool d7a_modem_wait_ready( uint32_t millisec = osWaitForever );
+void d7a_modem_open(PinName reset_pin = NC);
+void d7a_modem_reset(void);
+bool d7a_modem_wait_ready(uint32_t millisec = osWaitForever);
void d7a_modem_new_pkt(d7a_com_rx_msg_t* pkt);
-d7a_com_rx_msg_t* d7a_modem_wait_pkt( uint32_t millisec = osWaitForever );
+d7a_com_rx_msg_t* d7a_modem_wait_pkt(uint32_t millisec = osWaitForever);
void d7a_modem_msg(uint8_t value, uint8_t* buf, uint8_t len);
-bool d7a_modem_register_file(uint8_t fid, uint8_t retry_policy = 0);
-void d7a_modem_notify_file(uint8_t fid, uint32_t offset, uint32_t length);
+bool d7a_modem_register(register_file_param_t* file_infos);
+bool d7a_modem_start(void);
+bool d7a_modem_stop(void);
void d7a_modem_print_infos(void);
