Automotive Navigation Stack

Overview

Modern clusters provide a rich set of features giving vehicle and environment information to the driver in an easy to consume way. One such feature that is desired for a two-wheeler/four-wheeler cluster is the connectivity to mobile App by which it enables viewing incoming call information, accepting/rejecting calls etc. Another desired feature is the navigation support, by which the user can feed in the destination and the route information is shown in the cluster as Turn-By-Turn (TBT) or map.

RAPIDSEA Automotive Navigation and Connectivity (ANC) Stack enables OEMs/Tier-1s to integrate these functionalities readily.

Supported features

RAPIDSEA ANC Stack supports the following features

  • Call Notifications

  • Message Notifications

  • Other Application Notifications

  • Call responses (accept/reject)

  • Music Control

  • Contact Details and Call logs

  • Turn by Turn

  • Map Mirroring

  • Weather indications

  • Update Cluster settings

  • Update Communication module WIFI and BLE name

It supports integration with both Android and iOS Apps.

Architecture

To lower the cost of the cluster processing engine, RAPIDSEA ANC enables connectivity with mobile App using a dedicated WiFi/BLE communication module. The below diagram depicts the stack with its underlying physical connection along with higher level modules.

The below diagram captures the high level block diagram of the RAPIDSEA ANC components and how it interfaces with other modules.

RAPIDSEA ANC Architecture

As it can be seen, the Cluster MCU and the Communication module is interfaced over SPI where the module communicates with the mobile phone over BLE or Wi-Fi. At the higher level the Cluster application integrates the Cluster ANC stack which abstracts the communication all the way down to the Smart Automotive Manager (SAM) mobile application.

RAPIDSEA ANC stacks components seamlessly takes care of the communication and allows developers to concentrate only on consuming the relevant data.

Hardware Interface

Data transmission between the cluster and communication module takes place over SPI with the cluster acting as SPI master. Apart from the CS, CLK, MISO and MOSI pins for SPI communication, two more pins are used for handshake purposes. The ClusterDataReady is an output from the cluster that indicates the master is ready with some data that needs to be transmitted to the communication module. The CommModuleReceiveReady is an input to the cluster to indicate the communication module is ready to send/receive data from the cluster.

The below diagram captures the hardware connectivity diagram of the components.

ANC Hardware Connection

So, when the cluster is ready to send data, it sets the ClusterDataReady high and wait for the CommModuleReceiveReady to be asserted by the module. Only after it is high, the SPI transactions are initiated.

Similarly, when the communication module wishes to send data to the cluster, it sets CommModuleReceiveReady high. The cluster upon finding this high, sets the ClusterDataReady and initiated a transfer with an idle frame to the module simultaneously receiving the data from it.

After successful data transaction, both the handshake pins are set to low.

Application Interface

The RAPIDSEA ANC stack completely abstract the underlying communication with the communication module and the mobile app by providing a set of API functions and callbacks.

The below table captures the function that are to be called from the application logic.

API Functions

Function

Description

rs_anc_open

To initialize the ANC stack

rs_anc_process

To handle the ANC stack operation

rs_anc_c2m_handle_call

To handle the call notification

rs_anc_c2m_contact_set_filter

Assign the contact filter for further fetch request

rs_anc_c2m_contact_get_by_index

Request contacts by index

rs_anc_c2m_contact_get_count

To fetch contact count

rs_anc_c2m_dial_by_index

Dial the selected contact

rs_anc_c2m_dial_call_log

To dial the selected contact from the call log

rs_anc_c2m_handle_other_call

Handle the non-phone calls

rs_anc_c2m_music_ctrl

To send the music player control events

rs_anc_c2m_music_volume_ctrl

To send the music player volume control

rs_anc_c2m_call_redial

Redial recent call

rs_anc_c2m_send_vehicle_data

To update the vehicle data in the mobile

rs_anc_c2m_fetch_call_log

To fetch the call log

rs_anc_c2m_dial_by_number

To dial the given number

rs_anc_c2m_change_ble_name

To update the BLE publish name

rs_anc_c2m_change_wifi_name

To update the WiFi publish name

There are many functions through which the ANC stack indicate actions to be performed. These functions are captured in the below table.

Callback Functions

Function

Description

rcb_anc_c2m_req_failed

Called to indicate failed requests

rcb_anc_m2c_call_notification

Called to indicate incoming call notification

rcb_anc_m2c_wifi_map_data

Called to indicate that a map data is received

rcb_anc_m2c_other_call_handled

Called to indicate incoming non-phone calls

rcb_anc_m2c_calender_event

Called to indicate calendar events

rcb_anc_m2c_weather_info

Called to indicate weather information update

rcb_anc_m2c_date_time

Called for time and date update

rcb_anc_m2c_brightness

Called for brightness update

rcb_anc_m2c_find_vehicle

Called for finding vehicle

rcb_anc_m2c_vehicle_unlock

Called to unlock vehicle

rcb_anc_m2c_tbt_info

Called to indicate for TBT information update

rcb_anc_m2c_doc_download

Called to indicate response for contact list requests

rcb_anc_m2c_ble_status

Called to update BLE status

rcb_anc_m2c_wifi_status

Called to update Wi-Fi status

rcb_anc_m2c_msg

Called to indicate message notification

rcb_anc_m2c_music_status

Called to update music player status

rcb_anc_m2c_contact_count

Called to report total contact count

rcb_anc_m2c_call_log

Called to update call log

rcb_anc_m2c_change_theme

Called to change the cluster theme

rcb_anc_m2c_config_status

Called to notify the cluster that WiFi/BLE name changed

These functions are documented in detail in the below sections. It is important for the application to implement these functions correct for proper operation of the system.

Implementation Guide

This section provides an example about how to utilize the RAPIDSEA ANC stack to communicate between the mobile and cluster. Developers can integrate ANC functionality into their current applications by including the rs_anc.c in source code mode or the rs_anc.lib in the library mode.

The rs_anc.h header contains all API information, including cluster-to-mobile and mobile-to-cluster communication.

High level flow chart is depicted below for ANC stack:

ANC Stack Integration Flow Diagram

Assume we have to perform a simple demo where the Odometer data has to be communicated to the mobile app periodically and incoming message notification has to be received in the cluster.

The following code snippet explains the flow.

As it can be seen the code essentially,

  • Call rs_anc_open (&anc_instance, &anc_config) to initialize the ANC stack.

  • rs_anc_process (&anc_handle) should be called regularly.

  • Read the ODO meter information from vehicle and send it via rs_anc_c2m_send_vehicle_data.

  • If the message is received from the mobile, the rcb_anc_m2c_msg() callback is triggered.

Ensure that the Communication Module is programmed with the right firmware.

Now install the SAM application in your mobile app and connect to the Communication Module via the Bluetooth. It can be seen that the ODO information is updated in the Home screen of the mobile app.

Now send a message to the mobile app and notice the callback function rcb_anc_m2c_msg being called.

Running ANC over RTOS

It is possible to run the ANC stack with or without the OS. In case an RTOS is used, create a task with the required stack size initialize the stack t start of the task and continuously call the process function. For example, with FreeRTOS, a task for ANC stack with the given stack size and priority can be created and executed like the following example snippet:

/*anc_process task creation*/
if (xTaskCreate((TaskFunction_t)anc_demo_process,       /* pointer to the task                      */
    (char const *)"anc_demo_process",                           /* task name for kernel awareness debugging */
    ANC_TASK_STACK_SIZE / sizeof(portSTACK_TYPE),   /* task stack size                          */
    NULL,                                                                       /* optional task startup argument           */
    ANC_TASK_PRIORITY,                             /* initial priority                         */
        &process_anc_handle                                             /* optional task handle to create           */
    ) == pdPASS)
{
        printf("anc_demo_process creation success\r\n");
}
else
{
        printf("anc_demo_process create failed!\r\n");
}

The function anc_demo_process() should include all core APIs and the following is an example snippet,

void anc_demo_process ()
{
        anc_config.port = RS_SPI_UNIT_1;
        anc_config.chip_sel_num = RS_SPI_CHIP_SELECT_NUM_0;
        anc_config.chip_sel_ctrl = RS_SPI_CHIP_SELECT_ACTIVE_LOW;
        anc_config.role = RS_SPI_ROLE_MASTER;
        anc_config.non_blocking = RS_SPI_NON_BLOCKING;
        anc_config.mode = RS_SPI_MODE_0;
        anc_config.baud_rate = 5000000; // 5Mhz
        anc_config.module_status_port  = RS_GPIO_PORT_00_INDEX;  /*!< Port to which the interrupt from Comm module is connected*/
        anc_config.module_status_pin   = 2;   /*!< Pin to which the interrupt from Comm module is connected*/
        anc_config.cluster_status_port = RS_GPIO_PORT_00_INDEX; /*!< Port to which the output from cluster is connected*/
        anc_config.cluster_status_pin  = 3;  /*!< Pin to which the output from cluster is connected*/
        //Open the connectivity stack
        anc_handle = rs_anc_open(&anc_instance, &anc_config);

        while(1)
        {
                rs_anc_process (anc_handle);
                //Other business logic
                //Call rs_anc_c2m_* API's as necessary
        }
}

Running ANC over Baremetal

In case a bare metal system is used, the same can be split into two sections – one for initialization that is called only once and another for continuous processing.

void anc_demo_app_init()
{
        anc_config.port = RS_SPI_UNIT_1;
        anc_config.chip_sel_num = RS_SPI_CHIP_SELECT_NUM_0;
        anc_config.chip_sel_ctrl = RS_SPI_CHIP_SELECT_ACTIVE_LOW;
        anc_config.role = RS_SPI_ROLE_MASTER;
        anc_config.non_blocking = RS_SPI_NON_BLOCKING;
        anc_config.mode = RS_SPI_MODE_0;
        anc_config.baud_rate = 5000000; // 5Mhz
        anc_config.module_status_port  = RS_GPIO_PORT_00_INDEX;  /*!< Port to which the interrupt from Comm module is connected*/
anc_config.module_status_pin   = 2;   /*!< Pin to which the interrupt from Comm module is connected*/
anc_config.cluster_status_port = RS_GPIO_PORT_00_INDEX; /*!< Port to which the output from cluster is connected*/
anc_config.cluster_status_pin  = 3;  /*!< Pin to which the output from cluster is connected*/
        //Open the connectivity stack
        anc_handle = rs_anc_open(&anc_instance, &anc_config);
}

The below call can be called continuously.

int main
{
        //HAL Init
        //Other App logic init
        anc_demo_app_init();

        while(1)
        {
                //Other business logic

                rs_anc_process (anc_handle);

                //Call rs_anc_c2m_* API's as necessary
        }
}

Dependency

This stack depends on the below RAPIDSEA modules/interfaces/utils that can be obtained or custom implemented.

ANC Header Details

Documentation from the relevant header as follows:

Defines

RS_ANC_MAX_NUM_LARGE_FRAMES

Number of large size buffers

RS_ANC_MAX_NUM_SMALL_FRAMES

Number of small size buffers

RS_ANC_LARGE_FRAME_LEN
RS_ANC_SMALL_FRAME_LEN

Small buffer size

RS_ANC_FRAME_STATUS_IDLE

Frame Buffer not in use

RS_ANC_FRAME_STATUS_TX_IN_PROGRESS

Frame Buffer passed to transmit

RS_ANC_FRAME_STATUS_RX_DONE

Frame Buffer loaded with received data

RS_ANC_C2M_STATUS_IDLE

Buffer not in use

RS_ANC_C2M_STATUS_TX_IN_PROGRESS

Buffer transmission in progress

RS_ANC_C2M_STATUS_TX_DONE

Buffer done with transfer data

RS_ANC_C2M_CMD

Cluster to mobile command

RS_ANC_M2C_CMD

Mobile to cluster command

RS_ANC_C2M_REQ_INVALID

Initial command for idle buffer

RS_ANC_C2M_REQ_CALL_HANDLING

Indicates response to incoming call

RS_ANC_C2M_REQ_NOTIFICATION_REQ

Perform various notification related response

RS_ANC_C2M_REQ_VEHICLE_PARAM

Vehicle parameter update request

RS_ANC_C2M_REQ_BLE_NAME_CHANGE

Update BLE Name

RS_ANC_C2M_REQ_WIFI_NAME_CHANGE

Update WiFi Name

RS_ANC_C2M_NOTIF_NON_PHONE_CALL_RESPONSE

Response to calls other than phone like Whatsapp etc

RS_ANC_C2M_NOTIF_CONTACT_FETCH

Contact fetch request

RS_ANC_C2M_NOTIF_MUSIC_CONTROL

Music control request

RS_ANC_C2M_NOTIF_REDIAL

Recent call redial request

RS_ANC_C2M_NOTIF_CALL_LOG

Call log fetch request

RS_ANC_C2M_NOTIF_DIAL_BY_NUMBER

Call the given phone number

RS_ANC_C2M_CALL_HANDLING_ACKED

Call acknowledge response

RS_ANC_C2M_CALL_HANDLING_ACCEPT

Call accept response

RS_ANC_C2M_CALL_HANDLING_REJECT

Call reject response

RS_ANC_CALL_REJECT_REASON_NONE

Call reject reason - call you later

RS_ANC_CALL_REJECT_REASON_CALL_YOU_LATER

Call reject reason - call you later

RS_ANC_CALL_REJECT_REASON_CALL_YOU_BACK
RS_ANC_CALL_REJECT_REASON_IN_DRIVING
RS_ANC_CALL_REJECT_REASON_BUSY_RIGHT_NOW
RS_ANC_C2M_REQ_CONTACT_FETCH_BY_INDEX

Fetch the contacts by contact index

RS_ANC_C2M_REQ_CONTACT_FETCH_BY_NAME

Fetch the contacts by contact name

RS_ANC_C2M_REQ_CONTACT_FETCH_RESET

Reset the contact fetch to 0th index of contacts

RS_ANC_C2M_REQ_CONTACT_FETCH_DIAL

Dial the selected contact with contact index

RS_ANC_C2M_REQ_CONTACT_FETCH_COUNT

Get the total count of available contacts

RS_ANC_C2M_REQ_MUSIC_CTRL_VOL

Update the music volume

RS_ANC_C2M_REQ_MUSIC_CTRL_NEXT

Change to next song

RS_ANC_C2M_REQ_MUSIC_CTRL_PREV

Change to previous song

RS_ANC_C2M_REQ_MUSIC_CTRL_PLAY

Resume the song

RS_ANC_C2M_REQ_MUSIC_CTRL_PAUSE

Pause the song

RS_ANC_C2M_REQ_MUSIC_CTRL_STOP

Stop the song

RS_ANC_C2M_REQ_MUSIC_CTRL_START

Start playing the songs

RS_ANC_M2C_CALL_NOTIFICATION

Call notification

RS_ANC_M2C_INFORMATION

Various information like messages etc

RS_ANC_M2C_CLUSTER_SETTINGS

Update cluster settings like Flint

RS_ANC_M2C_DOCUMENT_DOWNLOAD

Download document

RS_ANC_M2C_RESERVED

Do not use

RS_ANC_M2C_MAP_START_FRAME

Indicates start of map frame

RS_ANC_M2C_MAP_DATA_FRAME

Indicates map data frame

RS_ANC_M2C_IDLE_FRAME

Idle frame

RS_ANC_M2C_BLE_CONNECTION_STATUS

Provides BLE connection status

RS_ANC_M2C_WIFI_CONNECTION_STATUS

Provides WiFi connection status

RS_ANC_M2C_CONFIGURATION_STATUS

Com module configuration change status

RS_ANC_M2C_CALL_NOTIFICATION_CALL_INVALID

Invalid call state state

RS_ANC_M2C_CALL_NOTIFICATION_CALL_ACTIVE

Call in active state

RS_ANC_M2C_CALL_NOTIFICATION_CALL_INACTIVE

Call in inactive state

RS_ANC_M2C_CALL_NOTIFICATION_MISSED_CALL

Call in missed call state

RS_ANC_M2C_CALL_NOTIFICATION_ACCEPTED

Call in accepted state

RS_ANC_M2C_NOTIFICATION_KNOWN_PERSON

Caller type known person

RS_ANC_M2C_NOTIFICATION_UNKNOWN_PERSON

Caller type unknown person

RS_ANC_C2M_REQ_CALL_LOG_DIAL_BY_INDEX

Dial the selected contact from call log

RS_ANC_C2M_REQ_CALL_LOG_FETCH_BY_INDEX

Fetch call log from given index

RS_ANC_MOBILE_NO_MAX_LEN

Maximum length of contact number

RS_ANC_CONTACT_NAME_MAX_LEN

Maximum length of contact name

RS_ANC_NO_OF_CONTACTS

Maximum number of contacts fetched for each request

RS_ANC_SONG_NAME_LEN

Maximum length of song name

RS_ANC_MAC_ADDRESS_LEN

MAC address maximum length

RS_ANC_ADDITIONAL_MSG_LEN

Additional message length

RS_ANC_EVENT_DESCP_LEN

Event description maximum length

RS_ANC_M2C_NOTIFICATION_INVALID

Invalid APP ID

RS_ANC_M2C_NOTIFICATION_WHATSAPP

Notifications from Whatsapp

RS_ANC_M2C_NOTIFICATION_SKYPE

Notifications from Skype

RS_ANC_M2C_NOTIFICATION_TEAMS

Notifications from Teams

RS_ANC_M2C_NOTIFICATION_NORMAL

Notifications from Phone

RS_ANC_M2C_NOTIFICATION_INSTAGRAM

Notifications from Instagram

RS_ANC_M2C_NOTIFICATION_TELEGRAM

Notifications from Telegram

RS_ANC_M2C_NOTIFICATION_FACEBOOK

Notifications from Facebook

RS_ANC_M2C_NOTIFICATION_SNAPCHAT

Notifications from Snapchat

RS_ANC_M2C_NOTIFICATION_TWITTER

Notifications from Twitter

RS_ANC_M2C_NOTIFICATION_GMAIL

Notifications from Gmail

RS_ANC_M2C_NOTIFICATION_MAIL

Notifications from Mail

RS_ANC_M2C_INFO_NOTIFICATION_CALL

Call Notification

RS_ANC_M2C_INFO_NOTIFICATION_MSG

Message Notification

RS_ANC_M2C_INFO_NOTIFICATION_EVENT

Event Notification

RS_ANC_M2C_INFO_NOTIFICATION_WEATHER

Weather Notification

RS_ANC_M2C_INFO_NOTIFICATION_TBT

Turn By Turn Notification

RS_ANC_M2C_INFO_CONTACT_FETCH

Contact Fetch

RS_ANC_M2C_INFO_CALL_LOG

Call Log information

RS_ANC_M2C_INFO_MUSIC_STATUS

Music Status

RS_ANC_M2C_INFO_CONTACT_COUNT

Contact Count information

RS_ANC_M2C_CLUSTER_SETTINGS_DATE_TIME

Date Time update

RS_ANC_M2C_CLUSTER_SETTINGS_BRIGHTNESS

Date Time update

RS_ANC_M2C_CLUSTER_SETTINGS_VEHICLE_UNLOCK

Unlock Vehicle

RS_ANC_M2C_CLUSTER_SETTINGS_FIND_VEHICLE

Find my Vehicle

RS_ANC_M2C_CLUSTER_SETTINGS_THEME_CHANGE

Cluster theme change

RS_ANC_M2C_INFO_WEATHER_CLEAR_SKY

Weather type clear sky

RS_ANC_M2C_INFO_WEATHER_FEW_CLOUDS

Weather type few clouds

RS_ANC_M2C_INFO_WEATHER_SCATTERED_CLOUDS

Weather type scatted clouds

RS_ANC_M2C_INFO_WEATHER_BROKEN_CLOUDS

Weather type broken clouds

RS_ANC_M2C_INFO_WEATHER_RAIN

Weather type rain

RS_ANC_M2C_INFO_WEATHER_THUNDER_STORM

Weather type thunder storm

RS_ANC_M2C_INFO_WEATHER_MIST

Weather type mist

RS_ANC_M2C_INFO_CALL_LOG_DIALED_CALL

Call log types Call log type dialed call

RS_ANC_M2C_INFO_CALL_LOG_MISSED_CALL

Call log type missed call

RS_ANC_M2C_INFO_CALL_LOG_RECEIVED_CALL

Call log type received call

RS_ANC_M2C_CLUSTER_SETTINGS_THEME_DAY

Cluster theme type Cluster theme type day

RS_ANC_M2C_CLUSTER_SETTINGS_THEME_DARK

Cluster theme type dark

RS_ANC_M2C_MOBILE_COMM_DISCONNECTED

BLE/WIFI Connection Status BLE/WIFI disconnected

RS_ANC_M2C_MOBILE_COMM_CONNECTED

BLE/WIFI connected

RS_ANC_M2C_BLE_NAME_UPDATE_STATUS

Communication module Configuration Update Status Type BLE publish name update staus

RS_ANC_M2C_WIFI_NAME_UPDATE_STATUS

WiFi publish name update staus

RS_ANC_M2C_COM_PUBLISH_NAME_UPDATED

Communication Module Publish Name Update Status BLE or WIFI name update success

RS_ANC_M2C_COM_PUBLISH_NAME_NOT_UPDATED

BLE or WIFI name update failed

Typedefs

typedef struct tag_rs_anc_config rs_anc_config_t

Structure for configuring the ANC

typedef struct tag_rs_anc_large_frame rs_anc_large_frame_t

Large frame parameter structure

typedef struct tag_rs_anc_small_frame rs_anc_small_frame_t

Small frame parameter structure

typedef struct tag_rs_anc_instance rs_anc_instance_t

ANC stack instance structure

typedef struct tag_rs_anc_c2m_call_resp rs_anc_c2m_call_resp_t

Call handling response structure

typedef struct tag_rs_anc_c2m_other_call_resp rs_anc_c2m_other_call_resp_t

Call handling response structure

typedef struct tag_rs_anc_c2m_contacts_fetch rs_anc_c2m_contacts_fetch_t

Contact fetch request structure

typedef struct tag_rs_anc_c2m_call_log_fetch rs_anc_c2m_call_log_fetch_t

Call log fetch request structure

typedef struct tag_rs_anc_c2m_music_ctrl rs_anc_c2m_music_ctrl_t

Music control request structure

typedef struct tag_rs_anc_c2m_vehicle_data rs_anc_c2m_vehicle_data_t

Vehicle data send request structure

typedef struct tag_rs_anc_m2c_contacts_fetch rs_anc_m2c_contacts_fetch_t

Contact fetch structure

typedef struct tag_rs_anc_m2c_call_log rs_anc_m2c_call_log_t

Call log structure

typedef struct tag_rs_anc_m2c_music_status rs_anc_m2c_music_status_t

Mobile to cluster music status structure

typedef struct tag_rs_anc_m2c_call_data rs_anc_m2c_call_data_t

Call notification structure

typedef struct tag_rs_anc_m2c_other_call_info rs_anc_m2c_other_call_info_t

Other call notification structure

typedef struct tag_rs_anc_m2c_msg_data rs_anc_m2c_msg_data_t

Message notification structure

typedef struct tag_rs_anc_m2c_tbt_data rs_anc_m2c_tbt_data_t

Structure for Turn by Turn navigation

typedef struct tag_rs_anc_m2c_doc_data rs_anc_m2c_doc_data_t

Structure for document download

typedef struct tag_rs_anc_m2c_conn_info rs_anc_m2c_conn_info_t

Device connection information structure

typedef struct tag_rs_anc_m2c_date_time rs_anc_m2c_date_time_t

Structure for date and time

typedef struct tag_rs_anc_time_date_event rs_anc_time_date_event_t

Structure for event time and date

typedef struct tag_rs_anc_m2c_weather_data rs_anc_m2c_weather_data_t

Structure for weather information

typedef struct tag_rs_anc_m2c_event_data rs_anc_m2c_event_data_t

Structure for event information

typedef struct tag_rs_anc_m2c_theme_data rs_anc_m2c_theme_data_t
typedef struct tag_rs_anc_m2c_config_status rs_anc_m2c_config_status_t

Functions

rs_handle_t rs_anc_open(rs_anc_instance_t *ptr_instance, rs_anc_config_t *ptr_config)

Initialize the ANC stack.

This function initializes the stack instance and communication protocol with the given configuration parameters.

Parameters:
  • ptr_instance[in] - Address of the ANC stack instance memory

  • ptr_config[in] - Address of the given configuration structure memory

Returns:

Handle value reference to the instance

rs_ret_val_t rs_anc_process(rs_handle_t handle)

Handle the ANC stack operation.

This function performs various operations like cluster to mobile and mobile to cluster communication in an ANC stack library. The function needs to be called frequently as it handles internal operations of the ANC stack.

Reducing the interval increases the communication throughput especially for map mirroring

Parameters:

handle[in] - Handle to the stack instance

Returns:

0 on Success or Non-Zero Error code on failure

rs_ret_val_t rs_anc_c2m_handle_call(rs_handle_t handle, uint32_t u32_response, uint32_t u32_reject_code)

Handle the call notification.

This function handles the call response from cluster to mobile app.

Parameters:
  • handle[in] - Handle to the stack instance

  • u32_response[in] - Call response status

  • u32_reject_code[in] - Call rejection message type

Returns:

0 on Success or Non-Zero Error code on failure

rs_ret_val_t rs_anc_c2m_contact_set_filter(rs_handle_t handle, char *ptr_search_name)

Assign the contact filter for further fetch request.

This function sets the filter so that further contact access will be limited to those matching this filter.

Parameters:
  • handle[in] - Handle to the stack instance

  • ptr_search_name[in] - Name or initial character of the contact. NULL if no filter needed

Returns:

0 on Success or Non-Zero Error code on failure

rs_ret_val_t rs_anc_c2m_contact_get_by_index(rs_handle_t handle, uint16_t u16_contact_index)

Request contacts by index.

This function assign the contact fetch request with the contact index.

Parameters:
  • handle[in] - Handle to the stack instance

  • u16_contact_index[in] - Start index of the contact

Returns:

0 on Success or Non-Zero Error code on failure

rs_ret_val_t rs_anc_c2m_contact_fetch_reset(rs_handle_t handle)

Resets the contact fetch logic counters.

This function resets the contact fetch logic to fetch from initial contact.

Parameters:

handle[in] - Handle to the stack instance

Returns:

0 on Success or Non-Zero Error code on failure

rs_ret_val_t rs_anc_c2m_contact_get_count(rs_handle_t handle)

To fetch contact count.

This function will assign the request command to get the total contacts count from application.

Parameters:

handle[in] - Handle to the stack instance

Returns:

0 on Success or Non-Zero Error code on failure

rs_ret_val_t rs_anc_c2m_dial_by_index(rs_handle_t handle, uint16_t u16_contact_index)

Dial the selected contact.

This function will assign the request command to dial the selected contact.

Parameters:
  • handle[in] - Handle to the stack instance

  • u16_contact_index[in] - Contact index to dial

Returns:

0 on Success or Non-Zero Error code on failure

rs_ret_val_t rs_anc_c2m_dial_call_log(rs_handle_t handle, uint16_t u16_contact_index)

Dial the selected contact from call log.

This function will assign the request command to dial the selected contact from call log.

Parameters:
  • handle[in] - Handle to the stack instance

  • u16_contact_index[in] - Contact index to dial

Returns:

0 on Success or Non-Zero Error code on failure

rs_ret_val_t rs_anc_c2m_handle_other_call(rs_handle_t handle, uint32_t u32_response, uint32_t u32_reject_code)

Handle the non-phone calls.

This function will assign the responce data for non-phone calls like whatsapp etc.

Parameters:
  • u32_response[in] - Call response status

  • u32_reject_code[in] - Call rejection message type

Returns:

0 on Success or Non-Zero Error code on failure

rs_ret_val_t rs_anc_c2m_music_ctrl(rs_handle_t handle, uint8_t u8_ctrl_type)

To send the music player control events.

This function will assign the request command to control the music player like play,pause etc.

Parameters:
  • handle[in] - Handle to the stack instance

  • u8_ctrl_type[in] - Music player control type

Returns:

0 on Success or Non-Zero Error code on failure

rs_ret_val_t rs_anc_c2m_music_volume_ctrl(rs_handle_t handle, uint8_t u8_volume_level)

To send the music player volume control.

This function will assign the volume level of music player.

Parameters:
  • handle[in] - Handle to the stack instance

  • u8_volume_level[in] - Music player volume level

Returns:

0 on Success or Non-Zero Error code on failure

rs_ret_val_t rs_anc_c2m_call_redial(rs_handle_t handle)

Redial recent call.

This function will assign the redial request of recent call.

Parameters:

handle[in] - Handle to the stack instance

Returns:

0 on Success or Non-Zero Error code on failure

rs_ret_val_t rs_anc_c2m_send_vehicle_data(rs_handle_t handle, rs_anc_c2m_vehicle_data_t vehicle_data)

To update the vehicle data to the mobile.

This function will update the vehicle parameters like odo,trip value etc.

Parameters:
  • handle[in] - Handle to the stack instance

  • vehicle_data[in] - Vehicle parameters structure

Returns:

0 on Success or Non-Zero Error code on failure

rs_ret_val_t rs_anc_c2m_fetch_call_log(rs_handle_t handle, uint16_t u16_fetch_index)

To fetch the call log.

This function will assign the request to fetch the updated call log.

Parameters:
  • handle[in] - Handle to the stack instance

  • u16_fetch_index[in] - Start index of updated call log

Returns:

0 on Success or Non-Zero Error code on failure

rs_ret_val_t rs_anc_c2m_dial_by_number(rs_handle_t handle, char *ptr_mobile_no)

To dial the given number.

To update the BLE publish name.

This function will send the request to make call to given number.

This function will update the BLE publish name from cluster.

Parameters:
  • handle[in] - Handle to the stack instance

  • ptr_mobile_no[in] - Mobile number pointer

  • handle[in] - Handle to the stack instance

  • ptr_ble_name[in] - New BLE name pointer

Returns:

0 on Success or Non-Zero Error code on failure

Returns:

0 on Success or Non-Zero Error code on failure

rs_ret_val_t rs_anc_c2m_change_ble_name(rs_handle_t handle, char *ptr_ble_name)
rs_ret_val_t rs_anc_c2m_change_wifi_name(rs_handle_t handle, char *ptr_wifi_name)
void rcb_anc_c2m_req_failed(rs_handle_t handle, int32_t reason, uint32_t u32_req)

Callback for failed request indication.

This function is called when any request to the ANC could not be completed

Parameters:
  • handle[in] - Handle to the stack instance

  • reason[in] - Reason for failure such as timeout etc

  • u32_req[in] - Request that failed

Returns:

None

void rcb_anc_m2c_call_notification(rs_handle_t handle, rs_anc_m2c_call_data_t *ptr_call_data)

Callback for call notification.

This function is called to handle any call notification sent by the application

Parameters:
  • handle[in] - Handle to the stack instance

  • ptr_call_data[in] - Structure pointer for call notification data

Returns:

None

void rcb_anc_m2c_wifi_map_data(uint8_t *ptr_rx_data, uint16_t u16_data_len)

Callback for WiFi map image receive.

This function is called when any map image data received from the mobile application

Parameters:
  • handle[in] - Handle to the stack instance

  • ptr_rx_data[in] - Pointer of received image data

  • u16_data_len[in] - image data length

Returns:

None

void rcb_anc_m2c_other_call_handled(rs_handle_t handle, rs_anc_m2c_other_call_info_t *ptr_other_call_notification_data)

Callback for non phone calls.

This function is called when any other application calls received, like Whatsapp, Facebook etc

Parameters:
  • handle[in] - Handle to the stack instance

  • ptr_other_call_notification_data[in] - Structure pointer to get the non phone call parameters

Returns:

None

void rcb_anc_m2c_calender_event(rs_handle_t handle, rs_anc_m2c_event_data_t *ptr_event_info)

Callback for calendar events.

This function is called when any calendar events received from the mobile application

Parameters:
  • handle[in] - Handle to the stack instance

  • ptr_event_info[in] - Structure pointer to receive the events

Returns:

None

void rcb_anc_m2c_weather_info(rs_handle_t handle, rs_anc_m2c_weather_data_t *ptr_weather_info)

Callback for weather information update.

This function is called when any weather info updated from mobile application

Parameters:
  • handle[in] - Handle to the stack instance

  • ptr_weather_info[in] - Structure pointer of weather related parameters

Returns:

None

void rcb_anc_m2c_date_time(rs_handle_t handle, rs_anc_m2c_date_time_t *ptr_date_time_data)

Callback for time and date update.

The mobile application will update the time and date once the BLE connected, this function is called to update the cluster time and date

Parameters:
  • handle[in] - Handle to the stack instance

  • ptr_date_time_data[in] - Structure pointer of time and date parameters

Returns:

None

void rcb_anc_m2c_brightness(rs_handle_t handle, uint8_t u8_brightness_data)

Callback for brightness update.

This function is called when the cluster brightness level updated by mobile application

Parameters:
  • handle[in] - Handle to the stack instance

  • u8_brightness_data[in] - Brightness level (0 to 100)

Returns:

None

void rcb_anc_m2c_find_vehicle(rs_handle_t handle, uint8_t u8_find_my_vehicle_data)

Callback for finding vehicle.

This function is called when the find my vehicle event triggered by the mobile application

Parameters:
  • handle[in] - Handle to the stack instance

  • u8_find_my_vehicle_data[in] - Find my vehicle data

Returns:

None

void rcb_anc_m2c_vehicle_unlock(rs_handle_t handle, uint8_t u8_vehicle_unlock_data)

Callback for vehicle unlock.

This function is called when the vehicle unlock data sent by mobile application

Parameters:
  • handle[in] - Handle to the stack instance

  • u8_vehicle_unlock_data[in] - Vehicle unlock data

Returns:

None

void rcb_anc_m2c_tbt_info(rs_handle_t handle, rs_anc_m2c_tbt_data_t *ptr_tbt_info)

Callback for TBT info.

This function is called when the turn by turn info updated by the mobile application

Parameters:
  • handle[in] - Handle to the stack instance

  • ptr_tbt_info[in] - TBT data structure pointer

Returns:

None

void rcb_anc_m2c_doc_download(rs_handle_t handle, rs_anc_m2c_doc_data_t *ptr_doc_data)

Callback for document download.

This function is called when the document data sent from the mobile application

Parameters:
  • handle[in] - Handle to the stack instance

  • ptr_doc_data[in] - Structure pointer of document data

Returns:

None

void rcb_anc_m2c_contacts_list(rs_handle_t handle, rs_anc_m2c_contacts_fetch_t *ptr_contacts_data)

Callback for contact list.

This function is called when the contact list sent by the mobile application for every two contacts

Parameters:
  • handle[in] - Handle to the stack instance

  • ptr_contacts_data[in] - Structure pointer of contact list

Returns:

None

void rcb_anc_m2c_ble_status(rs_handle_t handle, rs_anc_m2c_conn_info_t *ptr_ble_connection_info)

Callback for BLE status.

This function is called when the BLE connected or disconnected with the communication module

Parameters:
  • handle[in] - Handle to the stack instance

  • ptr_ble_connection_info[in] - Structure pointer of BLE connection information

Returns:

None

void rcb_anc_m2c_wifi_status(rs_handle_t handle, rs_anc_m2c_conn_info_t *ptr_wifi_connection_info)

Callback for WiFi status.

This function is called when the WiFi connected or disconnected with the communication module

Parameters:
  • handle[in] - Handle to the stack instance

  • ptr_wifi_connection_info[in] - Structure pointer of WiFi connection information

Returns:

None

void rcb_anc_m2c_msg(rs_handle_t handle, rs_anc_m2c_msg_data_t *ptr_msg_data)

Callback for message notification.

This function is called for message notification like normal message, whatsapp etc

Parameters:
  • handle[in] - Handle to the stack instance

  • ptr_msg_data[in] - Structure pointer of message notification data

Returns:

None

void rcb_anc_m2c_music_status(rs_handle_t handle, rs_anc_m2c_music_status_t *ptr_music_sts)

Callback for music status.

This function is called for music player status update like play,pause,next,previous etc

Parameters:
  • handle[in] - Handle to the stack instance

  • ptr_msg_data[in] - Structure pointer of message notification data

Returns:

None

void rcb_anc_m2c_contact_count(rs_handle_t handle, uint16_t u16_contact_count)

Callback for total contact count.

This function is called to update the total contact count in cluster

Parameters:
  • handle[in] - Handle to the stack instance

  • u16_contact_count[in] - Total number of contacts present in the mobile phone

Returns:

None

void rcb_anc_m2c_call_log(rs_handle_t handle, rs_anc_m2c_call_log_t *ptr_call_log_data)

Callback for call log update.

This function is called for ever call log updates

Parameters:
  • handle[in] - Handle to the stack instance

  • ptr_call_log_data[in] - Structure pointer of call log parameters

Returns:

None

void rcb_anc_m2c_change_theme(rs_handle_t handle, rs_anc_m2c_theme_data_t *ptr_theme_data)

Callback for cluster theme change.

This function is called for changing the theme by mobile phone

Parameters:
  • handle[in] - Handle to the stack instance

  • ptr_theme_data[in] - Structure pointer of theme related data

Returns:

None

void rcb_anc_m2c_config_status(rs_handle_t handle, rs_anc_m2c_config_status_t *ptr_config_status)
struct tag_rs_anc_config
#include <rs_anc.h>

Structure for configuring the ANC

Public Members

uint8_t port

Index to SPI Port

uint8_t chip_sel_num

Chip select signal associated with this port

uint8_t chip_sel_ctrl

Chip select control

uint8_t role

Master or Slave operation

uint32_t baud_rate

Baud rate/Clock speed

uint8_t mode

Mode of operation

uint8_t non_blocking

Blocking vs Non-blocking

uint8_t module_status_port

Port to which the interrupt from Comm module is connected

uint8_t module_status_pin

Pin to which the interrupt from Comm module is connected

uint8_t cluster_status_port

Port to which the output from cluster is connected

uint8_t cluster_status_pin

Pin to which the output from cluster is connected

uint8_t com_module_en_port

Port to which the drive the enable signal to communication module

uint8_t com_module_en_pin

Pin to which the drive the enable signal to communication module

struct tag_rs_anc_large_frame
#include <rs_anc.h>

Large frame parameter structure

Public Members

uint16_t status

Large buffer usage status

uint16_t reserved

Reserved for future use

uint8_t data[RS_ANC_LARGE_FRAME_LEN]

This buffer will be used to receive the data up to 40kb

struct tag_rs_anc_small_frame
#include <rs_anc.h>

Small frame parameter structure

Public Members

uint16_t status

Large buffer usage status

uint16_t reserved

Reserved for future use

uint8_t data[RS_ANC_SMALL_FRAME_LEN]

This buffer will be used to receive the data up to 140Bytes

struct tag_rs_anc_instance
#include <rs_anc.h>

ANC stack instance structure

Public Members

rs_anc_config_t *ptr_config

Pointer to the ANC configuration structure

rs_handle_t spi_handle

To store the SPI port handle

uint8_t cmd_in_progress

Index to the active command transfer in progress + 1

uint8_t *ptr_tx_buf

Pointer to the current transmit buffer

uint32_t tx_len

Lenght of the frame being transferred

uint8_t cur_transfer_buf_index

Buffer being transferred

uint8_t large_rx_in_progress

Indicates if a large frame transfer is in progress

uint8_t comm_module_ready_req

Indicates communication module ready to accept the cluster data

rs_anc_large_frame_t arr_large_frames[RS_ANC_MAX_NUM_LARGE_FRAMES]

Array of large transfer parameters

rs_anc_small_frame_t arr_small_frames[RS_ANC_MAX_NUM_SMALL_FRAMES]

Array of small transfer parameters

struct tag_rs_anc_c2m_call_resp
#include <rs_anc.h>

Call handling response structure

Public Members

uint16_t call_id

Last received call ID which is used to send the call response

uint8_t call_status

Call state to change

uint8_t reject_msg

User reason for reject response

struct tag_rs_anc_c2m_other_call_resp
#include <rs_anc.h>

Call handling response structure

Public Members

uint8_t req

Category of cluster data being transmitted

uint8_t call_status

Other Call state to change

uint16_t call_id

Last received call ID which is used to send the call response

uint8_t reject_msg

User reason for reject response

struct tag_rs_anc_c2m_contacts_fetch
#include <rs_anc.h>

Contact fetch request structure

Public Members

uint8_t req

Category of cluster data being transmitted

uint8_t fetch_type

Contact fetch method

uint16_t reserved

Reserved space for future usage

char search_name[RS_ANC_CONTACT_NAME_MAX_LEN]

Array to assign the search name, character or contact fetch index

struct tag_rs_anc_c2m_call_log_fetch
#include <rs_anc.h>

Call log fetch request structure

Public Members

uint8_t req

Category of cluster data being transmitted

uint8_t fetch_type

Call log fetch type

uint16_t log_index

Start index of call log

struct tag_rs_anc_c2m_music_ctrl
#include <rs_anc.h>

Music control request structure

Public Members

uint8_t req

Category of cluster data being transmitted

uint8_t control_type

Control type of music player

uint8_t vol_level

Volume level

struct tag_rs_anc_c2m_vehicle_data
#include <rs_anc.h>

Vehicle data send request structure

Public Members

uint32_t odo_value

Updated vehicle ODO meter value

uint16_t speed

Vehicle current speed value

uint16_t fuel_level

Available fuel level of vehicle

uint16_t bat_level

Vehicle battery level

uint16_t range

Vehicle travel range according to the fuel level

uint16_t serv_indication

Vehicle service indication

uint16_t oil_chng_indication

Vehicle oil change indication

uint16_t side_stand_indication

Vehicle side stand indication

struct tag_rs_anc_m2c_contacts_fetch
#include <rs_anc.h>

Contact fetch structure

Public Members

uint8_t req

Category of received mobile data

uint8_t reserved1

Reserved space for future usage

uint16_t reserved2

Reserved space for future usage

char contact_name[RS_ANC_NO_OF_CONTACTS][RS_ANC_CONTACT_NAME_MAX_LEN]

Received contact name for fetch request

char contact_number[RS_ANC_NO_OF_CONTACTS][RS_ANC_MOBILE_NO_MAX_LEN]

Received contact number for fetch request

struct tag_rs_anc_m2c_call_log
#include <rs_anc.h>

Call log structure

Public Members

uint8_t req

Category of Rx mobile data

uint8_t reserved1

Reserved space for future usage

uint16_t reserved2

Reserved space for future usage

char contact_name[RS_ANC_NO_OF_CONTACTS][RS_ANC_CONTACT_NAME_MAX_LEN]

Received contact name for fetch request

char contact_number[RS_ANC_NO_OF_CONTACTS][RS_ANC_MOBILE_NO_MAX_LEN]

Received contact number for fetch request

uint8_t recent_call_type[RS_ANC_NO_OF_CONTACTS]

Received call log type

struct tag_rs_anc_m2c_music_status
#include <rs_anc.h>

Mobile to cluster music status structure

Public Members

uint8_t req

Category of Rx mobile data

uint8_t music_player_status

Music player current status

uint16_t running_time

Current music running time, in seconds

char buff_song_name[RS_ANC_SONG_NAME_LEN]

Buffer to receive the currently playing song name

uint16_t total_run_time

Total run duration of song, in seconds

struct tag_rs_anc_m2c_call_data
#include <rs_anc.h>

Call notification structure

Public Members

uint16_t call_id

Currently received call ID

uint8_t call_status

Current status of received call

uint8_t contact_status

Contact type of received call (Known/Unknown)

char caller_number[RS_ANC_MOBILE_NO_MAX_LEN]

Contact name of received call notification

char caller_name[RS_ANC_CONTACT_NAME_MAX_LEN]

Contact number of received call notification

struct tag_rs_anc_m2c_other_call_info
#include <rs_anc.h>

Other call notification structure

Public Members

uint8_t req

Category of Rx mobile data

uint8_t app_id

Application type that sent the notification

uint16_t reserved

Reserved space for future usage

rs_anc_m2c_call_data_t call_info

Call parameter structure

struct tag_rs_anc_m2c_msg_data
#include <rs_anc.h>

Message notification structure

Public Members

uint8_t req

Category of Rx mobile data

uint8_t msg_type

From known/unknown source

uint16_t no_of_msgs

Number of messages

uint8_t app_id

Source of the message - SMS, Whatsapp etc

uint8_t reserved1

Reserved space for future usage

uint16_t reserved2

Reserved space for future usage

char number[RS_ANC_MOBILE_NO_MAX_LEN]

Number from where the message is received

char name[RS_ANC_CONTACT_NAME_MAX_LEN]

Name from whom the message is received

struct tag_rs_anc_m2c_tbt_data
#include <rs_anc.h>

Structure for Turn by Turn navigation

Public Members

uint8_t req

Category of Rx mobile data

uint8_t direction

TBT direction data

uint16_t distance

Total distance between start to end locations in meters

uint32_t rem_distance

Remaining travel distance to reach the destination in meters

struct tag_rs_anc_m2c_doc_data
#include <rs_anc.h>

Structure for document download

Public Members

uint16_t doc_id

Document ID being downloaded

uint8_t arr_doc_name[32]

Name of the Document

uint32_t doc_len

Size of the Document in bytes

uint8_t *ptr_doc_data

Buffer of document memory

struct tag_rs_anc_m2c_conn_info
#include <rs_anc.h>

Device connection information structure

Public Members

uint8_t req

Category of Rx mobile data

uint8_t conn_status

BLE or WiFi connection status

uint16_t reserved

Reserved space for future usage

uint8_t device_address[RS_ANC_MAC_ADDRESS_LEN]

Device MAC address buffer

struct tag_rs_anc_m2c_date_time
#include <rs_anc.h>

Structure for date and time

Public Members

uint8_t req

Category of Rx mobile data

uint8_t day

Day value updated by mobile application

uint8_t date

Date value updated by mobile application

uint8_t month

Month value updated by mobile application

uint16_t year

Year value updated by mobile application

uint8_t hour

Hour value updated by mobile application

uint8_t minute

Minute value updated by mobile application

uint8_t second

Second value updated by mobile application

struct tag_rs_anc_time_date_event
#include <rs_anc.h>

Structure for event time and date

Public Members

uint8_t date

Event date

uint8_t day

Event day

uint16_t year

Event year

uint8_t month

Event month

uint8_t hour

Event hour

uint8_t minute

Event minute

uint8_t second

Event seconds

struct tag_rs_anc_m2c_weather_data
#include <rs_anc.h>

Structure for weather information

Public Members

uint8_t req

Category of Rx mobile data

uint8_t weather_type

Updated weather type received from mobile application

uint16_t reserved

Reserved space for future usage

char additional_msg[RS_ANC_ADDITIONAL_MSG_LEN]

Additional message added with weather info

struct tag_rs_anc_m2c_event_data
#include <rs_anc.h>

Structure for event information

Public Members

uint8_t req

Category of Rx mobile data

uint8_t reserved1

Reserved space for future usage

uint16_t reserved2

Reserved space for future usage

char evt_descp[RS_ANC_EVENT_DESCP_LEN]

Event description added in the calendar

rs_anc_time_date_event_t time_date

Event date and time structure

struct tag_rs_anc_m2c_theme_data

Public Members

uint8_t req

Category of Rx mobile data

uint8_t theme_type

Cluster theme type

struct tag_rs_anc_m2c_config_status

Public Members

uint8_t req

Configuration type

uint8_t status

Configuration status