Virgil IoT KIT
Typedefs | Functions
info-server.h File Reference

INFO for server. More...

#include <virgil/iot/protocols/snap/snap-structs.h>
#include "info-structs.h"

Go to the source code of this file.

Typedefs

typedef vs_status_e(* vs_snap_info_start_notif_srv_cb_t) (vs_snap_info_device_t *device)
 Startup notification. More...
 

Functions

const vs_snap_service_tvs_snap_info_server (vs_snap_info_start_notif_srv_cb_t startup_cb)
 INFO Server SNAP Service implementation. More...
 
vs_status_e vs_snap_info_start_notification (const vs_netif_t *netif)
 INFO Server startup notification. More...
 
void vs_snap_info_set_firmware_ver (vs_file_version_t ver)
 Set version of firmware to be sent. More...
 
void vs_snap_info_set_tl_ver (vs_file_version_t ver)
 Set version of TrustList to be sent. More...
 

Detailed Description

INFO for server.

INFO service is used to provide information about current device state in the local network. Network in this case is limited by SNAP transport protocol.

In INFO meaning "Server" is any functional device. "Client" is the special device for statistic collection only. It can be any server PC or MCU device. Servers send their statistic information by startup. Also client can request periodical state sending by polling request.

INFO Server usage

Before first INFO calls usage it is necessary to register INFO Server service :

const vs_snap_service_t *snap_info_server; // INFO Server SNAP service
// Register INFO Server service
snap_info_server = vs_snap_info_server(NULL);
STATUS_CHECK(vs_snap_register_service(snap_info_server), "Cannot register INFO Server service");

tl_storage_impl and fw_storage_impl are storage implementations. See Storage HAL Usage for details.

Typedef Documentation

◆ vs_snap_info_start_notif_srv_cb_t

typedef vs_status_e(* vs_snap_info_start_notif_srv_cb_t) (vs_snap_info_device_t *device)

Startup notification.

Sends startup notification with device information.

Parameters
[in]devicevs_snap_info_device_t device information.
Returns
VS_CODE_OK in case of success or error code.

Function Documentation

◆ vs_snap_info_server()

const vs_snap_service_t* vs_snap_info_server ( vs_snap_info_start_notif_srv_cb_t  startup_cb)

INFO Server SNAP Service implementation.

This call returns INFO server implementation. It must be called before any INFO call.

Note
startup_cb can be NULL. In this case standard notifications will be done.
Parameters
[in]startup_cbStartup notification server callback. If NULL, it won't be used.
Returns
vs_snap_service_t SNAP service description. Use this pointer to call vs_snap_register_service.

◆ vs_snap_info_set_firmware_ver()

void vs_snap_info_set_firmware_ver ( vs_file_version_t  ver)

Set version of firmware to be sent.

Parameters
[in]verFirmware version.

◆ vs_snap_info_set_tl_ver()

void vs_snap_info_set_tl_ver ( vs_file_version_t  ver)

Set version of TrustList to be sent.

Parameters
[in]verTrustList version.

◆ vs_snap_info_start_notification()

vs_status_e vs_snap_info_start_notification ( const vs_netif_t netif)

INFO Server startup notification.

Sends startup notification.

Parameters
[in]netifSNAP service descriptor. If NULL, default one will be used.
Returns
vs_snap_service_t SNAP service description. Use this pointer to call vs_snap_register_service.
STATUS_CHECK
#define STATUS_CHECK(OPERATION, MESSAGE,...)
Status code check and perform goto terminate if non-successful.
Definition: status_code.h:145
vs_snap_service_t
SNAP service descriptor.
Definition: snap-structs.h:312
vs_snap_info_server
const vs_snap_service_t * vs_snap_info_server(vs_snap_info_start_notif_srv_cb_t startup_cb)
INFO Server SNAP Service implementation.
vs_snap_register_service
vs_status_e vs_snap_register_service(const vs_snap_service_t *service)
Register SNAP service.