You are on page 1of 26

TERA LITE

API User Document


Abstract: This document describes API’s that are available on Tera Lite board and its usage

CLASSIFICATION SOCIETE/
CLEARANCE LEVEL DOCUMENT REFERENCES / REFERENCES DU DOCUMENT
Reference / Item Number / Doc. Identification / Revision Index /
Page
Référence du Projet Numéro article Identification du Doc. Indice
PROTECTED
21070003 000 0 0.2 1 / 26
Document History

Version Date By Changes


V0.1 20/11/2023 Anusha Initial creation
V0.2 21/11/2023 Anusha Updated section 1.4

CLASSIFICATION SOCIETE/
CLEARANCE LEVEL DOCUMENT REFERENCES / REFERENCES DU DOCUMENT
Reference / Item Number / Doc. Identification / Revision Index /
Page
Référence du Projet Numéro article Identification du Doc. Indice
PROTECTED
21070003 000 0 0.2 2 / 26
Table of contents
1. Introduction..................................................................................................................................... 5
1.1 Glossary ......................................................................................................................................... 5
1.2 Testing APIs ................................................................................................................................... 6
1.3 EEPROM........................................................................................................................................ 8
1.3.1 eeprom open .................................................................................................................................. 8
1.3.2 eeprom read ................................................................................................................................... 8
1.3.3 eeprom write.................................................................................................................................. 8
1.3.4 eeprom close .................................................................................................................................. 9
1.4 CAN ............................................................................................................................................ 10
1.4.1 CAN0 ......................................................................................................................................... 10
1.4.1.1 can0 socket create ..................................................................................................................... 10
1.4.1.2 can0 read ................................................................................................................................. 10
1.4.1.3 can0 write ................................................................................................................................ 10
1.4.1.4 can0 socket close ...................................................................................................................... 11
1.4.2 CAN1 ......................................................................................................................................... 11
1.4.2.1 can1 socket create ..................................................................................................................... 11
1.4.2.2 can1 read ................................................................................................................................. 11
1.4.2.3 can1 write ................................................................................................................................ 12
1.4.2.4 can1 socket close ...................................................................................................................... 12
1.5 IMU ............................................................................................................................................. 13
1.5.1 IMU open .................................................................................................................................... 13
1.5.2 IMU read .................................................................................................................................... 13
1.5.3 IMU close ................................................................................................................................... 13
1.6 GPS ............................................................................................................................................. 14
1.6.1 GPS location................................................................................................................................ 14
1.7 Ethernet ........................................................................................................................................ 15
1.7.1 GBE link status ............................................................................................................................ 15
1.7.2 Check GBE IP ............................................................................................................................. 15
1.7.3 GBE network ping ........................................................................................................................ 16
1.7.4 Check GBE network speed ............................................................................................................ 16
1.8 PFE .............................................................................................................................................. 17
1.8.1 PFE link status ............................................................................................................................. 17
1.8.2 Check PFE IP .............................................................................................................................. 17
1.8.3 PFE network ping ......................................................................................................................... 18

CLASSIFICATION SOCIETE/
CLEARANCE LEVEL DOCUMENT REFERENCES / REFERENCES DU DOCUMENT
Reference / Item Number / Doc. Identification / Revision Index /
Page
Référence du Projet Numéro article Identification du Doc. Indice
PROTECTED
21070003 000 0 0.2 3 / 26
1.9 LTE ............................................................................................................................................. 19
1.9.1 Check SIM connection .................................................................................................................. 19
1.9.2 Check LTE node .......................................................................................................................... 19
1.9.3 Check LTE IP .............................................................................................................................. 20
1.9.4 Check LTE signal quality .............................................................................................................. 20
1.9.5 LTE network ping ........................................................................................................................ 20
1.9.6 LTE Enable ................................................................................................................................. 20
1.9.7 LTE Disable ................................................................................................................................ 21
1.10 WIFI........................................................................................................................................... 22
1.10.1 WiFi Enable............................................................................................................................. 22
1.10.2 WiFi Ping ................................................................................................................................ 22
1.10.3 Wi-Fi Network Scan ................................................................................................................. 22
1.11 Set Primary Network..................................................................................................................... 24
1.12 Software Update API .................................................................................................................... 25
1.12.1 Initiating the software Update ..................................................................................................... 25
1.12.2 Version Related Information ...................................................................................................... 25

CLASSIFICATION SOCIETE/
CLEARANCE LEVEL DOCUMENT REFERENCES / REFERENCES DU DOCUMENT
Reference / Item Number / Doc. Identification / Revision Index /
Page
Référence du Projet Numéro article Identification du Doc. Indice
PROTECTED
21070003 000 0 0.2 4 / 26
1. Introduction
The API user guide is a document which solely covers the description of each C API’s, its valid
input arguments and return value and type for Tera Lite.

1.1 Glossary

API Application Programming Interface


GPS Global Positioning System
LTE Long Term Evolution
EEPROM Electrically Erasable Programmable Read-Only Memory
CAN Controller Area Network
WiFi Wireless Fidelity
IMU Inertial Measurement Unit
GBE Gigabit Ethernet
PFE Packet Forwarding Engine

CLASSIFICATION SOCIETE/
CLEARANCE LEVEL DOCUMENT REFERENCES / REFERENCES DU DOCUMENT
Reference / Item Number / Doc. Identification / Revision Index /
Page
Référence du Projet Numéro article Identification du Doc. Indice
PROTECTED
21070003 000 0 0.2 5 / 26
1.2 Testing APIs
Below are the steps for testing the APIs

1. Boot the device from QSPI(u-boot) and EMMC(rest of images)

2. login as
username: bluebox
password: bluebox

3. Enter "sudo su" and then password "bluebox"

4. Stop the WAN Management service before running the test APIs application
systemctl stop WAN_Management

5. Go to /usr/bin/
cd /usr/bin

6. Run the application to test APIs,

Note: Running application like below will display how to test each interface. Please follow the
instructions provided by "api_testapp"

./api_testapp help

Logs:
root@ubuntu-s32g274ateraliteubuntu:/usr/bin# ./api_testapp help
****************** TEST APP *******************

EEPROM TEST USAGE : EX: ./api_testapp eeprom r/w offset(hex) value


value id given only for write

CAN0 READ TEST USAGE : EX: ./api_testapp can0 r bitrate dlc

CAN0 WRITE TEST USAG : EX: ./api_testapp can0 w bitrate id dlc data

CAN0 READ TEST USAGE : EX: ./api_testapp can1 r bitrate dlc

CAN0 WRITE TEST USAG : EX: ./api_testapp can1 w bitrate id dlc data

IMU TEST USAGE : Ex: ./api_testapp imu

GPS TEST USAGE : Ex: ./api_testapp gps /dev/ttyLF2

ETHERNET TEST USAGE : Ex: ./api_testapp ethernet eth0 www.google.com

PFE2 TEST USAGE : Ex: ./api_testapp pfe pfe2 192.168.1.x

LTE TEST USAGE : Ex: ./api_testapp lte rmnet_mhi0.1 www.google.com


CLASSIFICATION SOCIETE/
CLEARANCE LEVEL DOCUMENT REFERENCES / REFERENCES DU DOCUMENT
Reference / Item Number / Doc. Identification / Revision Index /
Page
Référence du Projet Numéro article Identification du Doc. Indice
PROTECTED
21070003 000 0 0.2 6 / 26
LTEON TEST USAGE : EX: ./api_testapp lteon rmnet_mhi0.1

LTEOFF TEST USAGE : EX: ./api_testapp lteoff rmnet_mhi0.1

WIFI TEST USAGE : Ex: ./api_testapp wifi 'WIFI-NAME' 'password'

SCAN WIFI TEST USAGE : Ex: ./api_testapp scan_wifi

WAN CONFIGURE USAGE : Ex: ./api_testapp set_primary_network eth0/rmnet_mhi0.1

VERSION TEST USAGE : Ex: ./api_testapp version

SW UPDATE TEST USAGE : Ex: ./api_testapp sw_update

Note: APIs can be tested are highlighted in above logs, other APIs explained are support APIs
only

CLASSIFICATION SOCIETE/
CLEARANCE LEVEL DOCUMENT REFERENCES / REFERENCES DU DOCUMENT
Reference / Item Number / Doc. Identification / Revision Index /
Page
Référence du Projet Numéro article Identification du Doc. Indice
PROTECTED
21070003 000 0 0.2 7 / 26
1.3 EEPROM
The below APIs are ones which related to EEPROM read and write.

1.3.1 eeprom open


API : int eeprom_open (void)

Return values:
Parameter Type Description
0 int Set success
-1 int EEPROM Open failed

1.3.2 eeprom read


API : int eeprom_read (unsigned short offset, unsigned char *buf, unsigned int size)

This API is used to read data from the EEPROM node

Arguments:
Parameter Type Description
Offset Unsigned short address offset
Buf Unsigned char buffer pointer
size Unsigned int number of bytes to read

Return values:
Parameter Type Description
Number of bytes read int Set success
-1 int EEPROM read failed

1.3.3 eeprom write


API : int eeprom_write (unsigned short offset, unsigned char *buf, unsigned int size)

This API is used to write data to EEPROM node

Arguments:

Parameter Type Description


Offset Unsigned short address offset
Buf Unsigned char buffer pointer
Len Unsigned int number of bytes to write

Return values:
Parameter Type Description
Number of bytes written int Set success
-1 int EEPROM write failed
CLASSIFICATION SOCIETE/
CLEARANCE LEVEL DOCUMENT REFERENCES / REFERENCES DU DOCUMENT
Reference / Item Number / Doc. Identification / Revision Index /
Page
Référence du Projet Numéro article Identification du Doc. Indice
PROTECTED
21070003 000 0 0.2 8 / 26
1.3.4 eeprom close
API : void eeprom_close (void)

This API is used to close the EEPROM

Return values:
Parameter Type Description
0 int Set success
-1 int EEPROM close failed

CLASSIFICATION SOCIETE/
CLEARANCE LEVEL DOCUMENT REFERENCES / REFERENCES DU DOCUMENT
Reference / Item Number / Doc. Identification / Revision Index /
Page
Référence du Projet Numéro article Identification du Doc. Indice
PROTECTED
21070003 000 0 0.2 9 / 26
1.4 CAN
The below APIs are ones which related to CAN read and write.

1.4.1 CAN0
The below APIs are ones which related to CAN0 read and CAN0 write.

1.4.1.1 can0 socket create


API : int can0_socket_create (int bitrate)

This API is used to create the CAN0 socket

Arguments:
Parameter Type Description
bitrate int Bitrate value

Return values:
Parameter Type Description
0 int Set success
-1 int CAN socket create failed
-2 int CAN socket select failed
-3 int CAN socket bind failed

1.4.1.2 can0 read


API : int can0_read (unsigned char *buf)

This API is used to read from the CAN0 node. It reads the number of bytes given.

Arguments:
Parameter Type Description
buf Unsigned char buffer pointer

Return values:
Parameter Type Description
bytes read int Set success
-1 int CAN number of bytes read failed

1.4.1.3 can0 write


API : int can0_write ( unsigned int id, unsigned int *buf, int size, unsigned char dlc)

This API is used to write to the CAN0 node

Arguments:
Parameter Type Description
CLASSIFICATION SOCIETE/
CLEARANCE LEVEL DOCUMENT REFERENCES / REFERENCES DU DOCUMENT
Reference / Item Number / Doc. Identification / Revision Index /
Page
Référence du Projet Numéro article Identification du Doc. Indice
PROTECTED
21070003 000 0 0.2 10 / 26
Id Unsigned int Can message ID
Buf Unsigned int buffer pointer with data to write (max 8 bytes)
Size Int Message size
Dlc char Length of the data payload

Return values:

Parameter Type Description


0 int Set success
-1 int Can send command failure

1.4.1.4 can0 socket close


API : void can0_socket_close (void)

This API is used to create the CAN0 socket

Return values:
Parameter Type Description
0 int Set success
-1 int CAN socket close failed

1.4.2 CAN1
The below APIs are ones which related to CAN1 read and CAN1 write.

1.4.2.1 can1 socket create


API : int can1_socket_create (int bitrate)

This API is used to create the CAN1 socket

Arguments:
Parameter Type Description
bitrate int Bitrate value

Return values:
Parameter Type Description
0 int Set success
-1 int CAN socket create failed
-2 int CAN socket select failed
-3 int CAN socket bind failed

1.4.2.2 can1 read


API : int can1_read (unsigned char *buf)

CLASSIFICATION SOCIETE/
CLEARANCE LEVEL DOCUMENT REFERENCES / REFERENCES DU DOCUMENT
Reference / Item Number / Doc. Identification / Revision Index /
Page
Référence du Projet Numéro article Identification du Doc. Indice
PROTECTED
21070003 000 0 0.2 11 / 26
This API is used to read from the CAN1 node. It reads the number of bytes given.

Arguments:
Parameter Type Description
buf Unsigned char buffer pointer

Return values:
Parameter Type Description
bytes read int Set success
-1 int CAN number of bytes read failed

1.4.2.3 can1 write


API : int can1_write ( unsigned int id, unsigned int *buf, int size, unsigned char dlc)

This API is used to write to the CAN1 node

Arguments:
Parameter Type Description
Id Unsigned int Can message ID
Buf Unsigned int buffer pointer with data to write (max 8 bytes)
Size Int Message size
Dlc char Length of the data payload

Return values:

Parameter Type Description


0 int Set success
-1 int Can send command failure

1.4.2.4 can1 socket close


API : void can1_socket_close (void)

This API is used to create the CAN1 socket

Return values:
Parameter Type Description
0 int Set success
-1 int CAN socket close failed

CLASSIFICATION SOCIETE/
CLEARANCE LEVEL DOCUMENT REFERENCES / REFERENCES DU DOCUMENT
Reference / Item Number / Doc. Identification / Revision Index /
Page
Référence du Projet Numéro article Identification du Doc. Indice
PROTECTED
21070003 000 0 0.2 12 / 26
1.5 IMU
The below API’s are ones which related to read accelerometer values.

1.5.1 IMU open


API : int imu_open_acc (void)

This API is used to open the IMU node for reading the accelerometer values.

Return values:
Parameter Type Description
0 int Set success
-1 int Accelerometer open failed

1.5.2 IMU read


API : int imu_read_accel_data (struct accel_raw *data)

This API is used to read accelerometer data.

Arguments:
Parameter Type Description
accel_raw data Struct Accelerometer data

Return values:
Parameter Type Description
rsize int Set success
-1 int Accelerometer open error

1.5.3 IMU close


API : int imu_close_acc (void)

This API is used to close the IMU node.

Return values:
Parameter Type Description
0 int Set success
-1 int Accelerometer close failed

CLASSIFICATION SOCIETE/
CLEARANCE LEVEL DOCUMENT REFERENCES / REFERENCES DU DOCUMENT
Reference / Item Number / Doc. Identification / Revision Index /
Page
Référence du Projet Numéro article Identification du Doc. Indice
PROTECTED
21070003 000 0 0.2 13 / 26
1.6 GPS
API : int gps (const char *devicePath)

The below API’s are ones which related to check the GPS node for getting the location logs.

Arguments:
Parameter Type Description
devicePath Const char Device node

Return values:
Parameter Type Description
0 int Set success
-1 int GPS device open failed
-2 int GPS log file creation or open failed
-3 int Read from GPS device failed
-4 int Location string capturing failed

1.6.1 GPS location


API : int gps_location (const char *logFilePath)

The below API’s are ones which related to check the GPS location and satellite information is getting or
not.

Arguments:
Parameter Type Description
logFilePath Const char Log file

Return values:
Parameter Type Description
0 int Set success
-1 int Satellite and location information not found

CLASSIFICATION SOCIETE/
CLEARANCE LEVEL DOCUMENT REFERENCES / REFERENCES DU DOCUMENT
Reference / Item Number / Doc. Identification / Revision Index /
Page
Référence du Projet Numéro article Identification du Doc. Indice
PROTECTED
21070003 000 0 0.2 14 / 26
1.7 Ethernet
API : int check_GBE_status (const char* interface, const char* host)

The below API’s are ones which related to check eth0 node and the network connectivity of the GBE.

Arguments:
Parameter Type Description
interface Const char Name of the GBE interface
Host Const char Host address to ping

Return values:
Parameter Type Description
0 int Set success
-1 int Ethernet link status check failed
-2 int Failed to get IP address
-3 int Ping test failed
-4 int Speed test failed
-5 int Speed thresholds not met

1.7.1 GBE link status


API : int link_status (const char* interface)

This API is used to check the status of Ethernet cable connection.

Arguments:
Parameter Type Description
interface Const char Name of the GBE interface

Return values:
Parameter Type Description
0 int Set success
-1 int Failed to get the Ethernet link status

1.7.2 Check GBE IP


API : char* get_ip (const char* interface)

This API is used to check the assigned IP address to the GBE node.

Arguments:
Parameter Type Description
Interface Const char Name of the GBE interface

Return values:
Parameter Type Description
ip_address char Set success
CLASSIFICATION SOCIETE/
CLEARANCE LEVEL DOCUMENT REFERENCES / REFERENCES DU DOCUMENT
Reference / Item Number / Doc. Identification / Revision Index /
Page
Référence du Projet Numéro article Identification du Doc. Indice
PROTECTED
21070003 000 0 0.2 15 / 26
NULL void* Failed to get the GBE network interfaces or no IP assigned

1.7.3 GBE network ping

API : int network_ping (const char* interface, const char* host)

This API is used to check the GBE ping status.

Arguments:
Parameter Type Description
Interface Const char Name of the GBE interface
host Const char Host address to ping

Return values:
Parameter Type Description
Result int Set success
-1 int Adding nameserver failed
-2 int Failed to ping after adding nameserver

1.7.4 Check GBE network speed


API : int check_network_speed (const char* ip_address, double* download_speed, double*
upload_speed)

This API is used to check the GBE network’s upload and download speed.

Arguments:
Parameter Type Description
ip address Const char IP address assigned to GBE node
download_speed Double Download speed for GBE network
upload_speed Double Upload speed for GBE network

Return values:
Parameter Type Description
0 int Set success
-1 Int Failed to install speedtest-cli
-2 Int Failed to run speed test
-3 Int Failed to retrieve download and upload speeds

CLASSIFICATION SOCIETE/
CLEARANCE LEVEL DOCUMENT REFERENCES / REFERENCES DU DOCUMENT
Reference / Item Number / Doc. Identification / Revision Index /
Page
Référence du Projet Numéro article Identification du Doc. Indice
PROTECTED
21070003 000 0 0.2 16 / 26
1.8 PFE
API : int check_pfe2_status (const char* interface, const char* host)

The below API’s are ones which related to check pfe2 node and the network connectivity of the PFE.

Arguments:
Parameter Type Description
interface Const char Name of the PFE interface
Host Const char Host address to ping

Return values:
Parameter Type Description
0 int Set success
-1 int PFE link status check failed
-2 int Failed to get IP address
-3 int Ping test failed

1.8.1 PFE link status


API : int link_status (const char* interface)

This API is used to check the status of PFE cable connection.

Arguments:
Parameter Type Description
interface Const char Name of the PFE interface

Return values:
Parameter Type Description
0 int Set success
-1 int Failed to get the PFE link status

1.8.2 Check PFE IP


API : char* get_pfe2_ip (const char* interface)

This API is used to check the assigned IP address to the PFE node.

Arguments:
Parameter Type Description
Interface Const char Name of the PFE interface

Return values:
Parameter Type Description
ip_address char Set success
NULL void* Failed to get the PFE network interfaces or no IP assigned

CLASSIFICATION SOCIETE/
CLEARANCE LEVEL DOCUMENT REFERENCES / REFERENCES DU DOCUMENT
Reference / Item Number / Doc. Identification / Revision Index /
Page
Référence du Projet Numéro article Identification du Doc. Indice
PROTECTED
21070003 000 0 0.2 17 / 26
1.8.3 PFE network ping

API : int pfe2_network_ping (const char* interface, const char* host)

This API is used to check the PFE ping status.

Arguments:
Parameter Type Description
Interface Const char Name of the interface
host Const char Host address to ping

Return values:
Parameter Type Description
0 int Set success
-1 int Ping failed

CLASSIFICATION SOCIETE/
CLEARANCE LEVEL DOCUMENT REFERENCES / REFERENCES DU DOCUMENT
Reference / Item Number / Doc. Identification / Revision Index /
Page
Référence du Projet Numéro article Identification du Doc. Indice
PROTECTED
21070003 000 0 0.2 18 / 26
1.9 LTE
API : int check_5g_status (const char* interface, const char* host)

The below API’s are ones which related to check LTE node and the network connectivity of the 5G LTE.

Arguments:
Parameter Type Description
interface Const char Name of the LTE interface
Host Const char Host address to ping

Return values:
Parameter Type Description
0 int Set success
-1 int SIM connection check failed
-2 int LTE link status check failed
-3 int Failed to get IP address
-4 int Failed to get the signal quality
-5 int Ping test failed

1.9.1 Check SIM connection


API: int check_sim_connection (void)

This API is used to check the SIM connection.

Return values:
Parameter Type Description
0 Int Set success
-1 Int SIM connection status not OK
-2 Int SIM connection details retrieval error
-3 Int SIM name retrieval failed

1.9.2 Check LTE node


API : int check_lte_node (const char* interface)

This API is ued to check the presence of LTE node.

Arguments:
Parameter Type Description
interface Const char Name of the LTE interface

Return values:
Parameter Type Description
0 Int Set success
-1 Int Network interface opening failed
-2 Int Interface does not exist

CLASSIFICATION SOCIETE/
CLEARANCE LEVEL DOCUMENT REFERENCES / REFERENCES DU DOCUMENT
Reference / Item Number / Doc. Identification / Revision Index /
Page
Référence du Projet Numéro article Identification du Doc. Indice
PROTECTED
21070003 000 0 0.2 19 / 26
1.9.3 Check LTE IP
API : char* get_ip (const char* interface)

This API is used to check the assigned IP address to the LTE node.

Arguments:
Parameter Type Description
Interface Const char Name of the LTE interface

Return values:
Parameter Type Description
ip_address char Set success
NULL void* Failed to get the LTE network interfaces or no IP assigned

1.9.4 Check LTE signal quality


API : int check_signal_quality (void)

This API is used to check the signal quality of the 5G LTE.

Return values:
Parameter Type Description
0 int Set success
-1 int Error opening the pipe

1.9.5 LTE network ping

API : int network_ping (const char* interface, const char* host)

This API is used to check the LTE ping status.

Arguments:
Parameter Type Description
Interface Const char Name of the interface
host Const char Host address to ping

Return values:
Parameter Type Description
0 int Set success
-1 int Adding nameserver failed
-2 int Failed to ping after adding nameserver

1.9.6 LTE Enable


API : int lte_enable(unsigned char *interface)

CLASSIFICATION SOCIETE/
CLEARANCE LEVEL DOCUMENT REFERENCES / REFERENCES DU DOCUMENT
Reference / Item Number / Doc. Identification / Revision Index /
Page
Référence du Projet Numéro article Identification du Doc. Indice
PROTECTED
21070003 000 0 0.2 20 / 26
This API is used to enable the LTE

Arguments:
Parameter Type Description
interface Unsigned char Name of the LTE interface

Return values:
Parameter Type Description
0 Int Successfully enable LTE
-1 Int Error bringing up the interface
-2 Int Error adding default route

1.9.7 LTE Disable


API : int lte_disable (unsigned char *interface)

This API is used to disable the LTE

Arguments:
Parameter Type Description
interface Unsigned char Name of the LTE interface

Return values:
Parameter Type Description
0 Int Successfully disable LTE
-1 Int LTE node already exists

CLASSIFICATION SOCIETE/
CLEARANCE LEVEL DOCUMENT REFERENCES / REFERENCES DU DOCUMENT
Reference / Item Number / Doc. Identification / Revision Index /
Page
Référence du Projet Numéro article Identification du Doc. Indice
PROTECTED
21070003 000 0 0.2 21 / 26
1.10 WIFI
API : int wifi_status (unsigned char *new_ssid, unsigned char *new_psk)

The below APIs are ones which related to WiFi node creation and network connectivity.

Arguments:
Parameter Type Description
new_ssid Unsigned char Ssid of the wifi
new_psk Unsigned char Password of the wifi

Return values:
Parameter Type Description
0 Int Set success
-1 int Fail to open conf file
-2 int WiFi node creation failed
-3 int WiFi disabling failed

1.10.1 WiFi Enable


API : int wifi_enable (void)

The below APIs are ones which related to WiFi node enabling.

Return values:
Parameter Type Description
0 int Set success
-2 int WiFi node creation failed

1.10.2 WiFi Ping


API : int wifi_ping (void)

The below APIs are ones which related to WiFi network connectivity.

Return values:
Parameter Type Description
0 Int Set success
-1 int Failed to update DNS settings
-2 int WIFI ping still failed after updating DNS settings

1.10.3 Wi-Fi Network Scan


API: scan_wifi_networks(void)

The below APIs are the ones related to Wi-Fi network scanning.

Return values:
CLASSIFICATION SOCIETE/
CLEARANCE LEVEL DOCUMENT REFERENCES / REFERENCES DU DOCUMENT
Reference / Item Number / Doc. Identification / Revision Index /
Page
Référence du Projet Numéro article Identification du Doc. Indice
PROTECTED
21070003 000 0 0.2 22 / 26
Parameter Type Description
0 Int Set success
-1 int Execution of command failure

CLASSIFICATION SOCIETE/
CLEARANCE LEVEL DOCUMENT REFERENCES / REFERENCES DU DOCUMENT
Reference / Item Number / Doc. Identification / Revision Index /
Page
Référence du Projet Numéro article Identification du Doc. Indice
PROTECTED
21070003 000 0 0.2 23 / 26
1.11 Set Primary Network
Below API are the one’s which are related to set a primary network.

API : int set_primary_network (const char* interface)

Arguments:
Parameter Type Description
Interface Const char Name of the interface which going to set as primary
network

Return values:
Parameter Type Description
0 int On success
-1 int Error flushing iptables rules
-2 int Error flushing nat table rules
-3 int Error deleting chain
-4 int Error deleting nat table chain
-5 int Error adding POSTROUTING rule
-6 int Error adding FORWARD rule
-7 int Error enabling IP forwarding
-8 int Error restarting iptables service

CLASSIFICATION SOCIETE/
CLEARANCE LEVEL DOCUMENT REFERENCES / REFERENCES DU DOCUMENT
Reference / Item Number / Doc. Identification / Revision Index /
Page
Référence du Projet Numéro article Identification du Doc. Indice
PROTECTED
21070003 000 0 0.2 24 / 26
1.12 Software Update API
Below API’s are the ones which are related to software upgrade process.

1.12.1 Initiating the software Update


API : int initiate_sw_update (void)

This API is used to initiate the software upgrade process where it will call the internal scripts which will
take up the task of upgrading the software to given version.

Return values:
Parameter Type Description
0 int On success
1 int On Failure

1.12.2 Version Related Information


API: int get_version_info (int bsp_section)

This API is used to get current version of the uboot, kernel, filesystem or the entire BSP version based
on the user input.

Return values:
Parameter Type Description
0 int On success
1 int On Failure

CLASSIFICATION SOCIETE/
CLEARANCE LEVEL DOCUMENT REFERENCES / REFERENCES DU DOCUMENT
Reference / Item Number / Doc. Identification / Revision Index /
Page
Référence du Projet Numéro article Identification du Doc. Indice
PROTECTED
21070003 000 0 0.2 25 / 26
END OF DOCUMENT

CLASSIFICATION SOCIETE/
CLEARANCE LEVEL DOCUMENT REFERENCES / REFERENCES DU DOCUMENT
Reference / Item Number / Doc. Identification / Revision Index /
Page
Référence du Projet Numéro article Identification du Doc. Indice
PROTECTED
21070003 000 0 0.2 26 / 26

You might also like