XDK API  3.6.0
Documentation
Macros | Functions | Variables
Sigfox.c File Reference
#include "XdkAppInfo.h"
#include "Sigfox.h"
#include <stdio.h>
#include "BCDS_BSP_Board.h"
#include "ExtensionPortSpi.h"
#include "ExtensionPortSpiCtrl.h"
+ Include dependency graph for Sigfox.c:

Macros

#define BCDS_MODULE_ID   XDK_APP_MODULE_ID_SIGFOX
 
#define EXTENSION_BUS_SPI_BAUDRATE   UINT32_C(250000)
 
#define EXTENSION_BUS_SPI_TX_RX_TIMEOUT_IN_MS   UINT32_C(5000)
 

Functions

static Retcode_T HandleSPIDataTransfer (void)
 Generic function to send and receive data over SPI. More...
 
static void PrintInfo (void)
 Function to print Device ID, PAC and Lib info. More...
 
static void PrintSOCVersion (void)
 Function to print chip SOC Version. More...
 
Retcode_T Sigfox_Enable (void)
 This will enable the Sigfox communication. It wakes up the chip and prepares it for further communication exchange. More...
 
Retcode_T Sigfox_GetInfo (void)
 Send getInfo command to SOC OL2385 to get ID and PAC and lib version. More...
 
Retcode_T Sigfox_GetSOCVersion (void)
 Retrieve device & software version of OL2385 chip. More...
 
void Sigfox_PrintRXPayload (void)
 Print Downlink Payload. More...
 
Retcode_T Sigfox_ReadPACurve (uint8_t subcommand)
 Read PA Curve. Only subcommands 0-ReadETSIPATable and 3-ReadFCCPATable are supported. More...
 
Retcode_T Sigfox_ResetMacroChannel (void)
 Reset Macrochannel (for RCZ2 and RCZ4 only) More...
 
Retcode_T Sigfox_SendBit (void)
 Send sigfox empty frame. More...
 
Retcode_T Sigfox_SendPayload (uint8_t *payload, uint8_t payloadSize, bool downlinkFlag)
 Send sigfox payload. More...
 
Retcode_T Sigfox_SendToSleep (void)
 Send Innocomm chipset to sleep mode. More...
 
Retcode_T Sigfox_SendWakeUp (void)
 Send wakeup command to SOC OL2385. Should be used before sending a payload as SOC goes in sleep mode automatically. More...
 
Retcode_T Sigfox_SetFCCMacroChannel (uint32_t *configWords, uint8_t defaultChannelConfig)
 Set FCC Macrochannel. config_words[0] are for Channels 1 to 32 (902.2MHz to 911.5MHz) config_words[1] are for Channels 33 to 64 (911.8MHz to 921.1MHz) config_words[2] are for Channels 65 to 86 (921.4MHz to 927.7MHz) More...
 
Retcode_T Sigfox_SetPrivateKey (void)
 Set AES Private Key (default mode) More...
 
Retcode_T Sigfox_SetPublicKey (void)
 Set AES Public Key (to use with SNEK) More...
 
Retcode_T Sigfox_SetRCZ1 (void)
 Set Radio Zone 1 (ETSI) More...
 
Retcode_T Sigfox_SetRCZ2 (void)
 Set Radio Zone 2. More...
 
Retcode_T Sigfox_SetRCZ3 (void)
 Set Radio Zone 3. More...
 
Retcode_T Sigfox_SetRCZ4 (void)
 Set Radio Zone 4. More...
 
Retcode_T Sigfox_Setup (void)
 This will setup the Sigfox communication by initializing the SPI interface with the chip and allocating the necessary buffers for memory. More...
 
Retcode_T Sigfox_UpdatePACurve (uint8_t subcommand)
 Update PA Curve. Only subcommands 1-UpdateETSIPATable and 4-UpdateFCCPATable are supported PA Curves tables are hardcoded in Sigfox.c file. More...
 

Variables

static uint8_t DownlinkPayload [8]
 
static const uint8_t ETSIPATable [200]
 
static const uint8_t FCCPATable [200]
 
static uint8_t ReadBuffer [SIGFIX_READ_WRITE_BUFFER_SIZE]
 
static uint8_t ReadBufferLength = 0
 
static uint8_t * ReadBufferPointer
 
static uint8_t WriteBuffer [SIGFIX_READ_WRITE_BUFFER_SIZE]
 
static uint8_t WriteBufferLength = 0
 
static uint8_t * WriteBufferPointer
 

Macro Definition Documentation

#define BCDS_MODULE_ID   XDK_APP_MODULE_ID_SIGFOX

Licensee agrees that the example code provided to Licensee has been developed and released by Bosch solely as an example to be used as a potential reference for Licensee’s application development. Fitness and suitability of the example code for any use within Licensee’s applications need to be verified by Licensee on its own authority by taking appropriate state of the art actions and measures (e.g. by means of quality assurance measures). Licensee shall be responsible for conducting the development of its applications as well as integration of parts of the example code into such applications, taking into account the state of the art of technology and any statutory regulations and provisions applicable for such applications. Compliance with the functional system requirements and testing there of (including validation of information/data security aspects and functional safety) and release shall be solely incumbent upon Licensee. For the avoidance of doubt, Licensee shall be responsible and fully liable for the applications and any distribution of such applications into the market.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

(1) Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

(2) Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.

(3)The name of the author may not be used to
endorse or promote products derived from this software without
specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#define EXTENSION_BUS_SPI_BAUDRATE   UINT32_C(250000)

Macro used to define the SPI Baudrate

#define EXTENSION_BUS_SPI_TX_RX_TIMEOUT_IN_MS   UINT32_C(5000)

Macro used to define the data transfer timeout

Function Documentation

static Retcode_T HandleSPIDataTransfer ( void  )
static
Returns
RETCODE_OK on success, or an error code otherwise.

Refer function prototype for description

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void PrintInfo ( void  )
static

Refer function prototype for description

+ Here is the caller graph for this function:

static void PrintSOCVersion ( void  )
static

Refer function prototype for description

+ Here is the caller graph for this function:

Retcode_T Sigfox_Enable ( void  )

Refer interface header for description

+ Here is the call graph for this function:

Retcode_T Sigfox_GetInfo ( void  )

Refer interface header for description

+ Here is the call graph for this function:

Retcode_T Sigfox_GetSOCVersion ( void  )

Refer interface header for description

+ Here is the call graph for this function:

void Sigfox_PrintRXPayload ( void  )

Refer interface header for description

Retcode_T Sigfox_ReadPACurve ( uint8_t  subcommand)

Refer interface header for description

+ Here is the call graph for this function:

Retcode_T Sigfox_ResetMacroChannel ( void  )

Refer interface header for description

+ Here is the call graph for this function:

Retcode_T Sigfox_SendBit ( void  )

Refer interface header for description

+ Here is the call graph for this function:

Retcode_T Sigfox_SendPayload ( uint8_t *  payload,
uint8_t  payloadSize,
bool  downlinkFlag 
)

Refer interface header for description

+ Here is the call graph for this function:

Retcode_T Sigfox_SendToSleep ( void  )

Refer interface header for description

+ Here is the call graph for this function:

Retcode_T Sigfox_SendWakeUp ( void  )

Refer interface header for description

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Retcode_T Sigfox_SetFCCMacroChannel ( uint32_t *  configWords,
uint8_t  defaultChannelConfig 
)

Refer interface header for description

+ Here is the call graph for this function:

Retcode_T Sigfox_SetPrivateKey ( void  )

Refer interface header for description

+ Here is the call graph for this function:

Retcode_T Sigfox_SetPublicKey ( void  )

Refer interface header for description

+ Here is the call graph for this function:

Retcode_T Sigfox_SetRCZ1 ( void  )

Refer interface header for description

+ Here is the call graph for this function:

Retcode_T Sigfox_SetRCZ2 ( void  )

Refer interface header for description

+ Here is the call graph for this function:

Retcode_T Sigfox_SetRCZ3 ( void  )

Refer interface header for description

+ Here is the call graph for this function:

Retcode_T Sigfox_SetRCZ4 ( void  )

Refer interface header for description

+ Here is the call graph for this function:

Retcode_T Sigfox_Setup ( void  )

Refer interface header for description

+ Here is the call graph for this function:

Retcode_T Sigfox_UpdatePACurve ( uint8_t  subcommand)

Refer interface header for description

+ Here is the call graph for this function:

Variable Documentation

uint8_t DownlinkPayload[8]
static
const uint8_t ETSIPATable[200]
static
Initial value:
= {
0x74, 0x74, 0x74, 0x74, 0x74, 0x74, 0x74, 0x74, 0x74, 0x74, 0x74, 0x74, 0x74, 0x74, 0x74, 0x74, 0x74, 0x74, 0x74, 0x74, 0x74, 0x74,
0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x72, 0x72, 0x72, 0x72, 0x72, 0x72,
0x72, 0x72, 0x72, 0x72, 0x71, 0x71, 0x71, 0x71, 0x71, 0x71, 0x71, 0x71, 0x71, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x6F, 0x6F,
0x6F, 0x6F, 0x6F, 0x6F, 0x6F, 0x6E, 0x6E, 0x6E, 0x6E, 0x6E, 0x6E, 0x6D, 0x6D, 0x6D, 0x6D, 0x6D, 0x6C, 0x6C, 0x6C, 0x6C, 0x6C, 0x6B,
0x6B, 0x6B, 0x6B, 0x6A, 0x6A, 0x6A, 0x6A, 0x69, 0x69, 0x69, 0x69, 0x68, 0x68, 0x68, 0x68, 0x67, 0x67, 0x67, 0x66, 0x66, 0x66, 0x66,
0x65, 0x65, 0x65, 0x64, 0x64, 0x64, 0x63, 0x63, 0x63, 0x62, 0x62, 0x62, 0x61, 0x61, 0x60, 0x60, 0x60, 0x5F, 0x5F, 0x5E, 0x5E, 0x5D,
0x5D, 0x5D, 0x5C, 0x5C, 0x5B, 0x5B, 0x5A, 0x5A, 0x59, 0x59, 0x58, 0x57, 0x57, 0x56, 0x56, 0x55, 0x55, 0x54, 0x53, 0x53, 0x52, 0x51,
0x51, 0x50, 0x4F, 0x4E, 0x4E, 0x4D, 0x4C, 0x4B, 0x4A, 0x49, 0x48, 0x48, 0x47, 0x46, 0x45, 0x44, 0x42, 0x41, 0x40, 0x3F, 0x3E, 0x3C,
0x3B, 0x39, 0x38, 0x36, 0x35, 0x33, 0x31, 0x2F, 0x2D, 0x2B, 0x29, 0x26, 0x24, 0x21, 0x1E, 0x1B, 0x17, 0x14, 0x10, 0x0C, 0x07, 0x06, 0x06, 0x06
}
const uint8_t FCCPATable[200]
static
Initial value:
= {
0x74, 0x74, 0x74, 0x74, 0x74, 0x74, 0x74, 0x74, 0x74, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x72, 0x72, 0x72, 0x72, 0x72, 0x71,
0x71, 0x71, 0x70, 0x70, 0x70, 0x70, 0x6F, 0x6F, 0x6E, 0x6E, 0x6E, 0x6D, 0x6D, 0x6C, 0x6C, 0x6B, 0x6B, 0x6A, 0x6A, 0x69, 0x69, 0x68,
0x67, 0x67, 0x66, 0x65, 0x64, 0x64, 0x63, 0x62, 0x61, 0x60, 0x5F, 0x5E, 0x5D, 0x5C, 0x5B, 0x5A, 0x59, 0x57, 0x56, 0x55, 0x53, 0x52,
0x50, 0x4E, 0x4D, 0x4B, 0x48, 0x46, 0x44, 0x41, 0x3E, 0x3B, 0x38, 0x34, 0x30, 0x2B, 0x26, 0x1F, 0x17, 0x0E, 0x06, 0x06, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
}
uint8_t ReadBuffer[SIGFIX_READ_WRITE_BUFFER_SIZE]
static
uint8_t ReadBufferLength = 0
static
uint8_t* ReadBufferPointer
static
uint8_t WriteBuffer[SIGFIX_READ_WRITE_BUFFER_SIZE]
static
uint8_t WriteBufferLength = 0
static
uint8_t* WriteBufferPointer
static

All rights reserved. The use is subject to the XDK SDK EULA by Bosch Connected Devices and Solutions GmbH.
This documentation file has been automatically generated on Thu Mar 14 2019 19:12:39 by doxygen 1.8.8