Zephyr Project API 4.3.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
st87mxx_app_services.h File Reference

ST87Mxx application services public API. More...

Go to the source code of this file.

Data Structures

struct  st87mxx_wifiscan_params
 Parameters for the ST87Mxx WIFI scan operation. More...

Macros

#define APP_MDM_CMD_TIMEOUT   K_SECONDS(180)
 Default timeout for application services sequences.
#define GNSS_NB_MAX_POSITION   100
 Max number of sample positions.
#define GNSS_CONSTELLATION_ID   0
 GNSS constellation selection:
0: GPS
1: GALLILEO
2: GPS+GALLILEO.
#define GNSS_FORMAT_TYPE   0
 GNSS data format selection:
0: ST_AT
1: NMEA.
#define GNSS_FORMAT_ST_POSITION   1
 Parameters used if ST_AT format enabled for GNSS.
#define GNSS_FORMAT_ST_ACCURACY   0
 Accuracy data.
#define GNSS_FORMAT_ST_SATELLITES   0
 Satellites info.
#define GNSS_FORMAT_ST_ORIENTATION   0
 Orientation info.
#define GNSS_NMEA_GPGGA   1
 Parameters used if NMEA format enabled for GNSS.
#define GNSS_NMEA_GPGSA   0
 $GPGSA info
#define GNSS_NMEA_GPGSV   0
 $GPGSV info
#define GNSS_NMEA_GPGLL   1
 $GPGLL info
#define GNSS_NMEA_GPRMC   0
 $GPRMS info
#define GNSS_NMEA_GPVTG   1
 $GPVTG info
#define URC_MODE   1
 To avoid too much data coming again and again on UART, the Host has the possibility to set a filter mode to display only one time the BSSID found during the full time of WIFI scanning.
#define HOPPING_TIME   1024
 Hopping time is the scan duration in ms before swapping to next channel.
#define ANT_SEL   1
 Selects the suitable ST87 input for antenna (GNSS or NB-IOT).

Typedefs

typedef void st87mxx_get_beacon_data_callback_t(char const *const string)
 Callback that catches the WIFI scan data when it is available.
typedef void st87mxx_get_pos_callback_t(char const *const string)
 Callback to retrieve the positions.
typedef void st87mxx_get_rssi_callback_t(char const *const string)
 Callback to retrieve the RSSI values.

Enumerations

enum  sequence_state { SEQUENCE_NONE = 0 , SEQUENCE_ONGOING = 1 , SEQUENCE_TIMED_OUT = 2 }
 Application services sequence state. More...

Functions

void st87mxx_app_services_init (void)
 API to start the application services (GNSS, WSCAN, RSSI capture).
int st87mxx_gnss_getfix (uint32_t nb_position, st87mxx_get_pos_callback_t *get_pos_callback_func, uint32_t timeout)
 API to get ST87Mxx GNSS position.
void st87mxx_gnss_stop (void)
 API to stop the GNSS feature.
int st87mxx_wifiscan (st87mxx_wifiscan_params *wscan_params)
 API to start the WIFI scan (=WSCAN) feature for positioning purpose.
void st87mxx_wifiscan_stop (void)
 API to stop the WIFI scan.
int st87mxx_getrssi (st87mxx_get_rssi_callback_t *get_rssi_callback_func)
 API to get the RSSI in an asynchronous way.
sequence_state st87mxx_app_services_getstate (void)
 API to get the state of the application services sequence.

Detailed Description

ST87Mxx application services public API.

Typedef Documentation

◆ st87mxx_get_beacon_data_callback_t

typedef void st87mxx_get_beacon_data_callback_t(char const *const string)

Callback that catches the WIFI scan data when it is available.

Example of WSCAN data: 1,-73,48:29:52:14:3E:B0,Livebox-3EB0 that corresponds to: channel number, RxLevel, MAC address (BSSID), SSID name.

Parameters
stringString in which the data will be written

◆ st87mxx_get_pos_callback_t

typedef void st87mxx_get_pos_callback_t(char const *const string)

Callback to retrieve the positions.

Parameters
stringString in which the position will be written.

◆ st87mxx_get_rssi_callback_t

typedef void st87mxx_get_rssi_callback_t(char const *const string)

Callback to retrieve the RSSI values.

Parameters
stringString in which the RSSI will be written.

Enumeration Type Documentation

◆ sequence_state

Application services sequence state.

Indicates whether no application service sequence is running, one is in progress, or it timed out.

Enumerator
SEQUENCE_NONE 

No sequence is started.

SEQUENCE_ONGOING 

A sequence is on-going.

SEQUENCE_TIMED_OUT 

The timeout for a sequence has elapsed.

Function Documentation

◆ st87mxx_app_services_getstate()

sequence_state st87mxx_app_services_getstate ( void )

API to get the state of the application services sequence.

Return values
Stateof the current sequence

◆ st87mxx_app_services_init()

void st87mxx_app_services_init ( void )

API to start the application services (GNSS, WSCAN, RSSI capture).

This function should be called prior to any application services.
Note: only one application service can run at a time.

◆ st87mxx_getrssi()

int st87mxx_getrssi ( st87mxx_get_rssi_callback_t * get_rssi_callback_func)

API to get the RSSI in an asynchronous way.

Parameters
get_rssi_callback_funcPointer to the output callback function
Return values
APIexecution status

◆ st87mxx_gnss_getfix()

int st87mxx_gnss_getfix ( uint32_t nb_position,
st87mxx_get_pos_callback_t * get_pos_callback_func,
uint32_t timeout )

API to get ST87Mxx GNSS position.

The position returned by the callback is in ST_AT format by default and can be set to NMEA format by changing GNSS_CONSTELLATION_ID constant.

For instance for ST_AT: #GNSSFIX: 0,2291,461282763,48.15370,-01.56719,130.2, 33.6,00.0,00.0,52.2,2.4,9.5,7.7,5,11,2.4,30,-0.1,20,1.4,09,1.7,06,-0.3
In detail: " #GNSSFIX: validity,week_number,time_of_week,latitude,longitude, altitude,accuracy [,std_dev_altitude,hdop,gdop,pdop] <- If GNSS_FORMAT_ST_ACCURACY is 1
[,number_of_satellites,satellite1_id,satellite1_residual,...,
satelliten_id,satelliten_residual] <- If GNSS_FORMAT_ST_SATELLITES is 1
[,orientation_degree,semi_major,semi_minor] <- If GNSS_FORMAT_ST_ORIENTATION is 1
For instance for NMEA: $GPGLL,4809.2231,N,00134.281,W,091218,A,A*6C
For further information: https://en.wikipedia.org/wiki/NMEA_0183

Parameters
nb_positionNumber of GNSS position to sample. Value 0 means infinite.
get_pos_callback_funcPointer to the output callback function
timeoutTimeout in sec after which the request is cancelled
Return values
Executionstatus

◆ st87mxx_gnss_stop()

void st87mxx_gnss_stop ( void )

API to stop the GNSS feature.

◆ st87mxx_wifiscan()

int st87mxx_wifiscan ( st87mxx_wifiscan_params * wscan_params)

API to start the WIFI scan (=WSCAN) feature for positioning purpose.

The WIFI scan feature is typically used to determine a coarse position when GNSS is
not usable, such as in indoor environments.
The primary purpose of the WIFI scan feature is to detect and list all available
WIFI networks in the vicinity.
When a WIFI scan is initiated, the ST87MXX discovers nearby WIFI networks.
It listens to beacons from WIFI access points (APs) that provide network
information. The resulting list of detected WIFI networks can be sent to a
3rd party localization server to get a position.

Parameters
wscan_paramsStructure containing the parameters to start the WSCAN feature.
Return values
Executionstatus

◆ st87mxx_wifiscan_stop()

void st87mxx_wifiscan_stop ( void )

API to stop the WIFI scan.