Send file data through D7A Action Protocol demo.

Dependencies:   modem_ref_helper

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers files.cpp Source File

files.cpp

00001 #include "files.h"
00002 #include "hwcfg.h"
00003 
00004 #include "kal_fs.h"
00005 
00006 #define __DEVICE_ID__               0x00000015
00007 
00008 alp_file_header_t h_rev = {
00009     .perm = RWR_R_,
00010     .prop = FS_PERMANENT_NOTIF,
00011     .afid = FID_ACTP_RPT_FULL,
00012     .ifid = IFID_REPORT,
00013     .size = HAL_U32_BYTE_SWAP((uint32_t)sizeof(revision_t)),
00014     .alloc= HAL_U32_BYTE_SWAP((uint32_t)sizeof(revision_t))
00015 };
00016 
00017 revision_t f_rev = {
00018     .manufacturer_id     = __MANUFACTURER_ID__,
00019     /// Device ID: Arbitrary number, at user/customer choice
00020     .device_id           = __DEVICE_ID__,
00021     /// Hardware Board ID:
00022     .hw_version          = __HW_VERSION__,
00023     /// Firmware Version: made of
00024     ///  - major,minor and patch indexes
00025     ///  - fw_id : "build-flavour"
00026     ///  FW_ID | MAJOR | MINOR | PATCH | HASH |
00027     //     1B  |  1B   |  1B   |   2B  |  4B  |
00028     .fw_version.id       = 0,
00029     .fw_version.major    = 1,
00030     .fw_version.minor    = 0,
00031     .fw_version.patch    = 5,
00032     .fw_version.hash     = 0x20200528,
00033     /// Not used
00034     .cup_max_size        = 0x00000000
00035 };
00036 
00037 alp_file_header_t h_sensor_config = {
00038     .perm = RWRWRW,
00039     .prop = FS_VOLATILE,
00040     .afid = 0,
00041     .ifid = 0,
00042     .size = HAL_U32_BYTE_SWAP((uint32_t)sizeof(sensor_config_t)),
00043     .alloc= HAL_U32_BYTE_SWAP((uint32_t)sizeof(sensor_config_t))
00044 };
00045 
00046 sensor_config_t f_sensor_config = {
00047     .report_type     = REPORT_ON_DIFFERENCE, // Type of report asked
00048     .read_period     = 5000,                 // Measure period (ms)
00049     .max_period      = 300,                  // Maximum time between reports (s)
00050     .max_diff        = 20,                   // Maximum difference allowed between two reported values
00051     .threshold_high  = 900,                  // High threshold value triggering a report
00052     .threshold_low   = 100,                  // Low threshold value triggering a report
00053 };
00054 
00055 alp_file_header_t h_sensor_light = {
00056     .perm = RWRWR_,
00057     .prop = FS_VOLATILE_NOTIF,
00058     .afid = FID_ACTP_RPT_FULL,
00059     .ifid = IFID_REPORT,
00060     .size = HAL_U32_BYTE_SWAP((uint32_t)sizeof(light_value_t)),
00061     .alloc= HAL_U32_BYTE_SWAP((uint32_t)sizeof(light_value_t))
00062 };