Trond Enger / d7a_1x

Fork of d7a_1x by WizziLab

Committer:
Jeej
Date:
Tue Sep 06 15:42:42 2016 +0000
Revision:
53:3e4aa4b57090
Parent:
50:30440c9aeb7c
Child:
54:540b327bfa14
Updated comments

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Jeej 43:28202405094d 1 #ifndef _D7A_H_
Jeej 43:28202405094d 2 #define _D7A_H_
Jeej 43:28202405094d 3
Jeej 43:28202405094d 4 #include "d7a_common.h"
Jeej 43:28202405094d 5
Jeej 43:28202405094d 6
Jeej 43:28202405094d 7 //======================================================================
Jeej 43:28202405094d 8 // Defines
Jeej 43:28202405094d 9 //======================================================================
Jeej 43:28202405094d 10
Jeej 43:28202405094d 11 #define D7A_UID_LEN (8)
Jeej 43:28202405094d 12
Jeej 43:28202405094d 13
Jeej 43:28202405094d 14 //======================================================================
Jeej 43:28202405094d 15 // Enums
Jeej 43:28202405094d 16 //======================================================================
Jeej 43:28202405094d 17
Jeej 43:28202405094d 18 //======================================================================
Jeej 43:28202405094d 19 // d7a_fs_storage_t
Jeej 43:28202405094d 20 //----------------------------------------------------------------------
Jeej 43:28202405094d 21 /// File "Storage Class"
Jeej 43:28202405094d 22 //======================================================================
Jeej 43:28202405094d 23 typedef enum {
Jeej 43:28202405094d 24 /// No data is keeped. Can only write in it.
Jeej 43:28202405094d 25 /// Ex: Use for commands.
Jeej 43:28202405094d 26 TRANSIENT = 0,
Jeej 43:28202405094d 27 /// Data is stocked in RAM and initialized at 0.
Jeej 43:28202405094d 28 /// Can not guarantee data integrity over time.
Jeej 43:28202405094d 29 /// Ex: Use for often updated data.
Jeej 43:28202405094d 30 VOLATILE,
Jeej 43:28202405094d 31 /// Data is stocked in RAM and initialized with the last flushed data from EEPROM.
Jeej 43:28202405094d 32 /// Can not guarantee data integrity over time.
Jeej 43:28202405094d 33 /// Ex: Use for temporary configurations.
Jeej 43:28202405094d 34 RESTORABLE,
Jeej 43:28202405094d 35 /// Data is stoked in EEPROM.
Jeej 43:28202405094d 36 /// Data integrity is guaranteed.
Jeej 43:28202405094d 37 /// Ex: Use for important configurations.
Jeej 43:28202405094d 38 /// /!\ Use sparingly as operations on these type of files are time and ressource consuming
Jeej 43:28202405094d 39 PERMANENT
Jeej 43:28202405094d 40 } d7a_fs_storage_t;
Jeej 43:28202405094d 41
Jeej 43:28202405094d 42 //======================================================================
Jeej 43:28202405094d 43 // d7a_fs_perm_t
Jeej 43:28202405094d 44 //----------------------------------------------------------------------
Jeej 43:28202405094d 45 /// File permissions for USER/GUEST
Jeej 43:28202405094d 46 //======================================================================
Jeej 43:28202405094d 47 typedef enum {
Jeej 43:28202405094d 48 O_O = 0b00000000,
Jeej 43:28202405094d 49 R_O = 0b00100000,
Jeej 43:28202405094d 50 R_R = 0b00100100,
Jeej 43:28202405094d 51 W_O = 0b00010000,
Jeej 43:28202405094d 52 W_W = 0b00010010,
Jeej 43:28202405094d 53 RW_O = 0b00110000,
Jeej 43:28202405094d 54 RW_R = 0b00110100,
Jeej 43:28202405094d 55 RW_W = 0b00110010,
Jeej 43:28202405094d 56 RW_RW = 0b00110110,
Jeej 43:28202405094d 57 RWX_O = 0b00111000,
Jeej 43:28202405094d 58 RWX_RWX = 0b00111111,
Jeej 43:28202405094d 59 } d7a_fs_perm_t;
Jeej 43:28202405094d 60
Jeej 43:28202405094d 61 // =======================================================================
Jeej 43:28202405094d 62 // d7a_nls_t
Jeej 43:28202405094d 63 // -----------------------------------------------------------------------
Jeej 43:28202405094d 64 /// Enumerator of the NWL security modes
Jeej 43:28202405094d 65 // =======================================================================
Jeej 43:28202405094d 66 typedef enum
Jeej 43:28202405094d 67 {
Jeej 43:28202405094d 68 /// No security enabled
Jeej 43:28202405094d 69 D7A_NLS_NO = 0,
Jeej 43:28202405094d 70 /// Encryption only, Counter Mode
Jeej 43:28202405094d 71 D7A_NLS_AES_CTR,
Jeej 43:28202405094d 72 /// No encryption, Authentication, Cipher-block chaining with 128 bit MAC
Jeej 43:28202405094d 73 D7A_NLS_AES_CBC_MAC_128,
Jeej 43:28202405094d 74 /// No encryption, Authentication, Cipher-block chaining with 64 bit MAC
Jeej 43:28202405094d 75 D7A_NLS_AES_CBC_MAC_64,
Jeej 43:28202405094d 76 /// No encryption, Authentication, Cipher-block chaining with 32 bit MAC
Jeej 43:28202405094d 77 D7A_NLS_AES_CBC_MAC_32,
Jeej 43:28202405094d 78 /// Authentication with CBC-MAC-128 and Encryption with Counter Mode
Jeej 43:28202405094d 79 D7A_NLS_AES_CCM_128,
Jeej 43:28202405094d 80 /// Authentication with CBC-MAC-64 and Encryption with Counter Mode
Jeej 43:28202405094d 81 D7A_NLS_AES_CCM_64,
Jeej 43:28202405094d 82 /// Authentication with CBC-MAC-32 and Encryption with Counter Mode
Jeej 43:28202405094d 83 D7A_NLS_AES_CCM_32,
Jeej 43:28202405094d 84 /// QTY
Jeej 43:28202405094d 85 D7A_NLS_QTY
Jeej 43:28202405094d 86
Jeej 43:28202405094d 87 } d7a_nls_t;
Jeej 43:28202405094d 88
Jeej 43:28202405094d 89
Jeej 45:b85384e7d825 90 // Mimic ALP Errors
Jeej 45:b85384e7d825 91 typedef enum
Jeej 45:b85384e7d825 92 {
Jeej 45:b85384e7d825 93 D7A_ERR_ITF_FULL = 2, // 0x02: For interfaces supporting buffering, indicates buffer reached maximum capacity (no data loss)
Jeej 45:b85384e7d825 94 D7A_ERR_PARTIAL_COMPLETION = 1, // 0x01: Action received and partially completed at response. To be completed after response
Jeej 45:b85384e7d825 95
Jeej 45:b85384e7d825 96 D7A_ERR_NONE = 0, // 0x00: Action completed (OK)
Jeej 45:b85384e7d825 97 D7A_ERR_FILE_NOT_FOUND = -1, // 0xFF: Error access file: File ID does not exist
Jeej 45:b85384e7d825 98 D7A_ERR_FILE_EXIST = -2, // 0xFE: Error create file: File ID already exists
Jeej 45:b85384e7d825 99 D7A_ERR_FILE_NOT_RESTORABLE = -3, // 0xFD: Error restore file: File is not restorable
Jeej 45:b85384e7d825 100 D7A_ERR_PERMISSION_DENIED = -4, // 0xFC: Error access file: Insufficient permissions
Jeej 45:b85384e7d825 101 D7A_ERR_LENGTH_OVERFLOW = -5, // 0xFB: Error create file: Supplied length (in header) is beyond file limits
Jeej 45:b85384e7d825 102 D7A_ERR_ALLOC_OVERFLOW = -6, // 0xFA: Error create file: Supplied allocation (in header) is beyond file limits
Jeej 45:b85384e7d825 103 D7A_ERR_OFFSET_OVERFLOW = -7, // 0xF9: Error write: Supplied start offset is out of bounds of file allocation
Jeej 45:b85384e7d825 104 D7A_ERR_WRITE_OVERFLOW = -8, // 0xF8: Error complete write: Supplied data goes beyond file allocation
Jeej 45:b85384e7d825 105 D7A_ERR_WRITE_ERROR = -9, // 0xF7: Error write: impossible to write in storage location
Jeej 45:b85384e7d825 106 D7A_ERR_OPERATION_UNKNOWN = -10,// 0xF6: Error unknown Operation
Jeej 45:b85384e7d825 107 D7A_ERR_OPERAND_INCOMPLETE = -11,// 0xF5: Error incomplete Operand
Jeej 45:b85384e7d825 108 D7A_ERR_OPERAND_WRONG_FORMAT = -12,// 0xF4: Error wrong Operand format
Jeej 45:b85384e7d825 109 D7A_ERR_ITF_INVALID = -13,// 0xF3: Error invalid interface
Jeej 45:b85384e7d825 110 D7A_ERR_ITF_OVERFLOW = -14,// 0xF2: Error interface overflown (i.e. ressources exhausted, buffer full with data discarded)
Jeej 45:b85384e7d825 111 D7A_ERR_QUERY_FAIL = -15,// 0xF1: (Group of) Query result was false (Informative error code).
Jeej 45:b85384e7d825 112
Jeej 45:b85384e7d825 113 D7A_ERR_UNKNOWN = -128,// 0x80: Unknown error
Jeej 45:b85384e7d825 114 D7A_ERR_FS_TIMEOUT, // 0x81: Internal FS Error
Jeej 45:b85384e7d825 115 D7A_ERR_ITF_UNKNOWN, // 0x82: Unknown Interface
Jeej 45:b85384e7d825 116
Jeej 45:b85384e7d825 117 // Modem errors
Jeej 45:b85384e7d825 118 D7A_ERR_NOT_READY ,// The modem is not ready to recieve commands
Jeej 45:b85384e7d825 119 D7A_ERR_COM_LINK ,// A serial link timeout occured
Jeej 45:b85384e7d825 120 D7A_ERR_ILLEGAL_FID ,// The FID specified is illegal
Jeej 45:b85384e7d825 121 D7A_ERR_ILLEGAL_FILE_DEF ,// The FILE parameters specified are illegal
Jeej 45:b85384e7d825 122 D7A_ERR_CMD_TO ,// The command expired
Jeej 45:b85384e7d825 123 D7A_ERR_TX_FAILED ,// Transmission failed
Jeej 45:b85384e7d825 124
Jeej 45:b85384e7d825 125
Jeej 45:b85384e7d825 126 } d7a_errors_t;
Jeej 45:b85384e7d825 127
Jeej 46:665391110051 128 // Types of retry policies
Jeej 46:665391110051 129 typedef enum {
Jeej 46:665391110051 130 ALP_RPOL_ONESHOT = 0,
Jeej 46:665391110051 131 ALP_RPOL_SINGLE = 1,
Jeej 46:665391110051 132 ALP_RPOL_REPORT = 2,
Jeej 46:665391110051 133 ALP_RPOL_REPORT_CHECKED = 3,
Jeej 46:665391110051 134 ALP_RPOL_BULK = 4,
Jeej 46:665391110051 135 ALP_RPOL_SPARE_1 = 5,
Jeej 46:665391110051 136 ALP_RPOL_SPARE_2 = 6,
Jeej 46:665391110051 137 ALP_RPOL_SPARE_3 = 7,
Jeej 46:665391110051 138
Jeej 46:665391110051 139 ALP_RPOL_QTY,
Jeej 46:665391110051 140 } alp_rpol_t;
Jeej 45:b85384e7d825 141
Jeej 43:28202405094d 142 //======================================================================
Jeej 43:28202405094d 143 // Structures
Jeej 43:28202405094d 144 //======================================================================
Jeej 43:28202405094d 145
Jeej 43:28202405094d 146 //======================================================================
Jeej 43:28202405094d 147 // d7a_com_config_t
Jeej 43:28202405094d 148 //----------------------------------------------------------------------
Jeej 43:28202405094d 149 /// Com port configuration structure
Jeej 43:28202405094d 150 //======================================================================
Jeej 43:28202405094d 151 typedef struct {
Jeej 43:28202405094d 152 /// Tx pin
Jeej 43:28202405094d 153 PinName tx;
Jeej 43:28202405094d 154 /// RX pin
Jeej 43:28202405094d 155 PinName rx;
Jeej 43:28202405094d 156 /// WKUP pin
Jeej 43:28202405094d 157 PinName rts;
Jeej 43:28202405094d 158 /// HST_WKUP pin
Jeej 43:28202405094d 159 PinName cts;
Jeej 43:28202405094d 160 /// Size of RX buffer
Jeej 43:28202405094d 161 uint16_t rx_buffer_size;
Jeej 43:28202405094d 162 } d7a_com_config_t;
Jeej 43:28202405094d 163
Jeej 49:81d5bddb02f0 164
Jeej 49:81d5bddb02f0 165
Jeej 43:28202405094d 166 typedef uint32_t (*WriteFileFunction)( const uint8_t file_id,
Jeej 43:28202405094d 167 const uint16_t offset,
Jeej 43:28202405094d 168 const uint16_t size,
Jeej 43:28202405094d 169 const uint8_t* const content);
Jeej 43:28202405094d 170
Jeej 43:28202405094d 171 typedef uint32_t (*ReadFileFunction)( const uint8_t file_id,
Jeej 43:28202405094d 172 const uint16_t offset,
Jeej 43:28202405094d 173 const uint16_t size,
Jeej 43:28202405094d 174 uint8_t* buf);
Jeej 43:28202405094d 175
Jeej 46:665391110051 176 typedef void (*NotifDoneFunction)( const uint8_t file_id,
Jeej 46:665391110051 177 const uint8_t error);
Jeej 46:665391110051 178
Jeej 43:28202405094d 179 //======================================================================
Jeej 43:28202405094d 180 // d7a_fs_callbacks_t
Jeej 43:28202405094d 181 //----------------------------------------------------------------------
Jeej 43:28202405094d 182 /// File system callbacks
Jeej 43:28202405094d 183 //======================================================================
Jeej 43:28202405094d 184 typedef struct {
Jeej 43:28202405094d 185 /// Write in local file
Jeej 43:28202405094d 186 WriteFileFunction write_file;
Jeej 43:28202405094d 187 /// Read from local file
Jeej 43:28202405094d 188 ReadFileFunction read_file;
Jeej 49:81d5bddb02f0 189 /// Is called when the notification is finished (depending on the retry policy)
Jeej 46:665391110051 190 NotifDoneFunction notif_done;
Jeej 49:81d5bddb02f0 191 } d7a_callbacks_t;
Jeej 43:28202405094d 192
Jeej 43:28202405094d 193 //======================================================================
Jeej 43:28202405094d 194 // fw_version_t
Jeej 43:28202405094d 195 //----------------------------------------------------------------------
Jeej 43:28202405094d 196 /// Firmware version Structure
Jeej 43:28202405094d 197 /// Used within the revision structure
Jeej 43:28202405094d 198 //======================================================================
Jeej 43:28202405094d 199 TYPEDEF_STRUCT_PACKED
Jeej 43:28202405094d 200 {
Jeej 43:28202405094d 201 /// Software identifier
Jeej 43:28202405094d 202 uint8_t id;
Jeej 43:28202405094d 203 /// Version major
Jeej 43:28202405094d 204 uint8_t major;
Jeej 43:28202405094d 205 /// Version minor
Jeej 43:28202405094d 206 uint8_t minor;
Jeej 43:28202405094d 207 /// Version patch
Jeej 43:28202405094d 208 uint16_t patch;
Jeej 43:28202405094d 209 /// Version hash
Jeej 43:28202405094d 210 uint32_t hash;
Jeej 43:28202405094d 211 } fw_version_t;
Jeej 43:28202405094d 212
Jeej 43:28202405094d 213 //======================================================================
Jeej 43:28202405094d 214 // d7a_revision_t
Jeej 43:28202405094d 215 //----------------------------------------------------------------------
Jeej 43:28202405094d 216 /// Revision Structure
Jeej 43:28202405094d 217 ///
Jeej 43:28202405094d 218 /// Usage within D7B server:
Jeej 43:28202405094d 219 /// An XML describing the File system of a device is associated to a
Jeej 43:28202405094d 220 /// couple manufacturer_id/device_id (==Device).
Jeej 43:28202405094d 221 /// Different versions of the Device's XML can exist and can be mapped
Jeej 43:28202405094d 222 /// according to fw_version id/major/minor
Jeej 43:28202405094d 223 //======================================================================
Jeej 43:28202405094d 224 TYPEDEF_STRUCT_PACKED
Jeej 43:28202405094d 225 {
Jeej 43:28202405094d 226 /// Manufacturer ID: provided by Wizzilab
Jeej 43:28202405094d 227 // comes from: here
Jeej 43:28202405094d 228 uint32_t manufacturer_id;
Jeej 43:28202405094d 229 /// Device ID: Arbitrary number, at user/customer choice
Jeej 43:28202405094d 230 // comes from: application
Jeej 43:28202405094d 231 uint32_t device_id;
Jeej 43:28202405094d 232 /// Hardware Board ID:
Jeej 43:28202405094d 233 // comes from: board definition
Jeej 43:28202405094d 234 uint32_t hw_version;
Jeej 43:28202405094d 235 /// Firmware Version: made of
Jeej 43:28202405094d 236 /// - major,minor and patch indexes : comes from versioning tool
Jeej 43:28202405094d 237 /// - fw_id : "build-flavour" : comes from build setup
Jeej 43:28202405094d 238 /// FW_ID | MAJOR | MINOR | PATCH | HASH |
Jeej 43:28202405094d 239 /// 1B | 1B | 1B | 2B | 4B |
Jeej 43:28202405094d 240 fw_version_t fw_version;
Jeej 43:28202405094d 241 /// "file-system" signature XXX: to be worked out
Jeej 43:28202405094d 242 // comes from: application
Jeej 43:28202405094d 243 uint32_t fs_crc;
Jeej 43:28202405094d 244 } d7a_revision_t;
Jeej 43:28202405094d 245
Jeej 43:28202405094d 246
Jeej 43:28202405094d 247 // =======================================================================
Jeej 43:28202405094d 248 // d7a_addressee_ctrl_t
Jeej 43:28202405094d 249 // -----------------------------------------------------------------------
Jeej 43:28202405094d 250 /// Bitfield structure of the Addressee control byte
Jeej 43:28202405094d 251 // =======================================================================
Jeej 43:28202405094d 252 typedef union
Jeej 43:28202405094d 253 {
Jeej 53:3e4aa4b57090 254 /// bit access fields
Jeej 43:28202405094d 255 struct {
Jeej 43:28202405094d 256 /// Network security method
Jeej 43:28202405094d 257 uint8_t nls : 4;
Jeej 43:28202405094d 258 /// ID type
Jeej 43:28202405094d 259 uint8_t idf : 2;
Jeej 43:28202405094d 260 /// RFU
Jeej 43:28202405094d 261 uint8_t rfu_6 : 1;
Jeej 43:28202405094d 262 uint8_t rfu_7 : 1;
Jeej 43:28202405094d 263 } bf;
Jeej 43:28202405094d 264
Jeej 53:3e4aa4b57090 265 /// byte access
Jeej 43:28202405094d 266 uint8_t byte;
Jeej 43:28202405094d 267
Jeej 43:28202405094d 268 } d7a_addressee_ctrl_t;
Jeej 43:28202405094d 269
Jeej 43:28202405094d 270 // =======================================================================
Jeej 43:28202405094d 271 // d7a_xcl_t
Jeej 43:28202405094d 272 // -----------------------------------------------------------------------
Jeej 43:28202405094d 273 /// Bitfield structure of the Addressee Access Class
Jeej 43:28202405094d 274 // =======================================================================
Jeej 43:28202405094d 275 typedef union
Jeej 43:28202405094d 276 {
Jeej 53:3e4aa4b57090 277 /// bit access fields
Jeej 43:28202405094d 278 struct {
Jeej 43:28202405094d 279 /// Subclass mask
Jeej 43:28202405094d 280 uint8_t m : 4;
Jeej 43:28202405094d 281 /// Specifier
Jeej 43:28202405094d 282 uint8_t s : 4;
Jeej 43:28202405094d 283 } bf;
Jeej 43:28202405094d 284
Jeej 53:3e4aa4b57090 285 /// byte access
Jeej 43:28202405094d 286 uint8_t byte;
Jeej 43:28202405094d 287
Jeej 43:28202405094d 288 } d7a_xcl_t;
Jeej 43:28202405094d 289
Jeej 43:28202405094d 290 // =======================================================================
Jeej 43:28202405094d 291 // d7a_addressee_t
Jeej 43:28202405094d 292 // -----------------------------------------------------------------------
Jeej 43:28202405094d 293 /// Structure of the D7ATP Addressee byte
Jeej 43:28202405094d 294 // =======================================================================
Jeej 43:28202405094d 295 TYPEDEF_STRUCT_PACKED
Jeej 43:28202405094d 296 {
Jeej 43:28202405094d 297 d7a_addressee_ctrl_t ctrl;
Jeej 43:28202405094d 298 d7a_xcl_t xcl;
Jeej 43:28202405094d 299 uint8_t id[D7A_UID_LEN];
Jeej 43:28202405094d 300
Jeej 43:28202405094d 301 } d7a_addressee_t;
Jeej 43:28202405094d 302
Jeej 43:28202405094d 303
Jeej 43:28202405094d 304 //======================================================================
Jeej 43:28202405094d 305 // Prototypes
Jeej 43:28202405094d 306 //======================================================================
Jeej 43:28202405094d 307
Jeej 43:28202405094d 308 //======================================================================
Jeej 43:28202405094d 309 // d7a_open
Jeej 43:28202405094d 310 //----------------------------------------------------------------------
Jeej 43:28202405094d 311 /// @brief Open D7A driver and start the modem
Jeej 53:3e4aa4b57090 312 /// @param com_config Com port configuration structure
Jeej 53:3e4aa4b57090 313 /// @param reset_pin Reset pin
Jeej 53:3e4aa4b57090 314 /// @param callbacks File system callbacks (You cannot use local files if this is not specified)
Jeej 45:b85384e7d825 315 /// @return d7a_errors_t Error code
Jeej 43:28202405094d 316 //======================================================================
Jeej 49:81d5bddb02f0 317 d7a_errors_t d7a_open(const d7a_com_config_t* com_config, PinName reset_pin, const d7a_callbacks_t* callbacks);
Jeej 43:28202405094d 318
Jeej 43:28202405094d 319 //======================================================================
Jeej 43:28202405094d 320 // d7a_close
Jeej 43:28202405094d 321 //----------------------------------------------------------------------
Jeej 43:28202405094d 322 /// @brief Close D7A driver and stop the modem
Jeej 45:b85384e7d825 323 /// @return d7a_errors_t Error code
Jeej 43:28202405094d 324 //======================================================================
Jeej 45:b85384e7d825 325 d7a_errors_t d7a_close(void);
Jeej 43:28202405094d 326
Jeej 43:28202405094d 327 //======================================================================
Jeej 43:28202405094d 328 // d7a_start
Jeej 43:28202405094d 329 //----------------------------------------------------------------------
Jeej 43:28202405094d 330 /// @brief Start the modem
Jeej 45:b85384e7d825 331 /// @return d7a_errors_t Error code
Jeej 43:28202405094d 332 //======================================================================
Jeej 45:b85384e7d825 333 d7a_errors_t d7a_start(void);
Jeej 43:28202405094d 334
Jeej 43:28202405094d 335 //======================================================================
Jeej 43:28202405094d 336 // d7a_stop
Jeej 43:28202405094d 337 //----------------------------------------------------------------------
Jeej 43:28202405094d 338 /// @brief Stop the modem (goes to low power)
Jeej 45:b85384e7d825 339 /// @return d7a_errors_t Error code
Jeej 43:28202405094d 340 //======================================================================
Jeej 45:b85384e7d825 341 d7a_errors_t d7a_stop(void);
Jeej 43:28202405094d 342
Jeej 43:28202405094d 343 //======================================================================
Jeej 43:28202405094d 344 // d7a_create
Jeej 43:28202405094d 345 //----------------------------------------------------------------------
Jeej 43:28202405094d 346 /// @brief Creates a file on the modem
Jeej 53:3e4aa4b57090 347 /// @param file_id ID of the file to create
Jeej 53:3e4aa4b57090 348 /// @param prop Type of file
Jeej 53:3e4aa4b57090 349 /// @param perm Access permissions
Jeej 53:3e4aa4b57090 350 /// @param size Length of the created file
Jeej 53:3e4aa4b57090 351 /// @param alloc Maximum size of the file
Jeej 53:3e4aa4b57090 352 /// @param action_file File ID to an eventual Action file
Jeej 53:3e4aa4b57090 353 /// @param interface File ID to an eventual Interface file
Jeej 45:b85384e7d825 354 /// @return d7a_errors_t Error code
Jeej 43:28202405094d 355 //======================================================================
Jeej 45:b85384e7d825 356 d7a_errors_t d7a_create(const uint8_t file_id, d7a_fs_storage_t prop, d7a_fs_perm_t perm, uint32_t size, uint32_t alloc, uint8_t action_file = 0, uint8_t interface = 0);
Jeej 43:28202405094d 357
Jeej 43:28202405094d 358 //======================================================================
Jeej 43:28202405094d 359 // d7a_declare
Jeej 43:28202405094d 360 //----------------------------------------------------------------------
mikl_andre 48:950406be9810 361 /// @brief Declare a file stored on the host to the modem (need to have implemented the fs_callbacks)
Jeej 53:3e4aa4b57090 362 /// @param file_id ID of the file to declare
Jeej 53:3e4aa4b57090 363 /// @param prop Type of file
Jeej 53:3e4aa4b57090 364 /// @param perm Access permissions
Jeej 53:3e4aa4b57090 365 /// @param size Length of the created file
Jeej 53:3e4aa4b57090 366 /// @param alloc Maximum size of the file
Jeej 53:3e4aa4b57090 367 /// @param action_file File ID to an eventual Action file
Jeej 53:3e4aa4b57090 368 /// @param interface File ID to an eventual Interface file
Jeej 45:b85384e7d825 369 /// @return d7a_errors_t Error code
Jeej 43:28202405094d 370 //======================================================================
Jeej 45:b85384e7d825 371 d7a_errors_t d7a_declare(const uint8_t file_id, d7a_fs_storage_t prop, d7a_fs_perm_t perm, uint32_t size, uint32_t alloc, uint8_t action_file = 0, uint8_t interface = 0);
Jeej 43:28202405094d 372
Jeej 43:28202405094d 373 //======================================================================
Jeej 43:28202405094d 374 // d7a_read
Jeej 43:28202405094d 375 //----------------------------------------------------------------------
Jeej 43:28202405094d 376 /// @brief Read data from a file
Jeej 53:3e4aa4b57090 377 /// @param file_id File ID of file to read
Jeej 53:3e4aa4b57090 378 /// @param offset Offset from which to start reading
Jeej 53:3e4aa4b57090 379 /// @param size Size of data to read
Jeej 53:3e4aa4b57090 380 /// @param buf Buffer to retrieve data
Jeej 53:3e4aa4b57090 381 /// @param addressee Addressee to an eventual distant device
Jeej 53:3e4aa4b57090 382 /// @param retry Index to the retry policy to use
Jeej 45:b85384e7d825 383 /// @return d7a_errors_t Error code
Jeej 43:28202405094d 384 //======================================================================
Jeej 46:665391110051 385 d7a_errors_t d7a_read(const uint8_t file_id, const uint32_t offset, const uint32_t size, const uint8_t* buf, d7a_addressee_t* addressee = NULL, alp_rpol_t retry = ALP_RPOL_ONESHOT);
Jeej 43:28202405094d 386
Jeej 43:28202405094d 387 //======================================================================
Jeej 43:28202405094d 388 // d7a_write
Jeej 43:28202405094d 389 //----------------------------------------------------------------------
Jeej 43:28202405094d 390 /// @brief Write data to a file
Jeej 53:3e4aa4b57090 391 /// @param file_id File ID of file to write
Jeej 53:3e4aa4b57090 392 /// @param offset Offset from which to start reading
Jeej 53:3e4aa4b57090 393 /// @param size Size of data to read
Jeej 53:3e4aa4b57090 394 /// @param buf Buffer to retrieve data
Jeej 53:3e4aa4b57090 395 /// @param addressee Addressee to an eventual distant device
Jeej 53:3e4aa4b57090 396 /// @param retry Index to the retry policy to use
Jeej 53:3e4aa4b57090 397 /// @param resp Wait to see if write is OK
Jeej 45:b85384e7d825 398 /// @return d7a_errors_t Error code
Jeej 43:28202405094d 399 //======================================================================
Jeej 46:665391110051 400 d7a_errors_t d7a_write(const uint8_t file_id, const uint32_t offset, const uint32_t size, const uint8_t* const buf, d7a_addressee_t* addressee = NULL, alp_rpol_t retry = ALP_RPOL_ONESHOT, bool resp = true);
Jeej 46:665391110051 401
Jeej 46:665391110051 402 //======================================================================
mikl_andre 48:950406be9810 403 // d7a_notify
Jeej 46:665391110051 404 //----------------------------------------------------------------------
Jeej 46:665391110051 405 /// @brief Write data to a file
Jeej 53:3e4aa4b57090 406 /// @param file_id File ID of file to write
Jeej 53:3e4aa4b57090 407 /// @param offset Offset from which to start writing
Jeej 53:3e4aa4b57090 408 /// @param size Size of data to write
Jeej 46:665391110051 409 /// @return d7a_errors_t Error code
Jeej 46:665391110051 410 //======================================================================
Jeej 46:665391110051 411 d7a_errors_t d7a_notify(const uint8_t file_id, const uint32_t offset, const uint32_t size);
Jeej 43:28202405094d 412
Jeej 50:30440c9aeb7c 413
Jeej 50:30440c9aeb7c 414 //======================================================================
Jeej 50:30440c9aeb7c 415 // d7a_modem_print_infos
Jeej 50:30440c9aeb7c 416 //----------------------------------------------------------------------
Jeej 50:30440c9aeb7c 417 /// @brief Prints the modem infos
Jeej 50:30440c9aeb7c 418 //======================================================================
Jeej 50:30440c9aeb7c 419 void d7a_modem_print_infos(void);
Jeej 50:30440c9aeb7c 420
Jeej 50:30440c9aeb7c 421
Jeej 50:30440c9aeb7c 422
Jeej 50:30440c9aeb7c 423
Jeej 43:28202405094d 424 #endif // _D7A_H_