Virgil IoT KIT
|
FLDT for server. More...
#include <virgil/iot/update/update.h>
#include <virgil/iot/protocols/snap/snap-structs.h>
#include <virgil/iot/status_code/status_code.h>
Go to the source code of this file.
Typedefs | |
typedef vs_status_e(* | vs_fldt_server_add_filetype_cb) (const vs_update_file_type_t *file_type, vs_update_interface_t **update_ctx) |
Add new file type callback. More... | |
Functions | |
const vs_snap_service_t * | vs_snap_fldt_server (const vs_mac_addr_t *gateway_mac, vs_fldt_server_add_filetype_cb add_filetype) |
FLDT Server SNAP Service implementation. More... | |
vs_status_e | vs_fldt_server_add_file_type (const vs_update_file_type_t *file_type, vs_update_interface_t *update_context, bool broadcast_file_info) |
Add file type. More... | |
FLDT for server.
FLDT service is used to download new file version from gateway to client. This module is used to process server part of FLDT protocol.
Server side sends new file versions provided by vs_fldt_server_add_file_type call. Also it sends information about present files by client requests. Files must be previously listed by vs_fldt_server_add_file_type call. If requested file has not been added, #vs_fldt_server_add_filetype callback is called to provide such information. In most case it used to output new file version information and gateway address. To successfully file broadcasting vs_update_interface_t must be provided for each file type. You can see function vs_firmware_update_file_type for Firmware example and vs_tl_update_file_type for Trust List one.
Here you can see an example of FLDT server initialization :
You can see #vs_fldt_server_add_filetype function example below :
typedef vs_status_e(* vs_fldt_server_add_filetype_cb) (const vs_update_file_type_t *file_type, vs_update_interface_t **update_ctx) |
Add new file type callback.
Callback for vs_snap_fldt_server function. This callback is used when gateway receives request for file type that has not been added by vs_fldt_server_add_file_type call.
[in] | file_type | File type descriptor. Cannot be NULL. |
[in,out] | update_ctx | Pointer to store update nont NULL context pointer for new file type. Cannot be NULL. |
vs_status_e vs_fldt_server_add_file_type | ( | const vs_update_file_type_t * | file_type, |
vs_update_interface_t * | update_context, | ||
bool | broadcast_file_info | ||
) |
Add file type.
FLDT server has the list of file types that it processes. This call adds new file type or update previously added one.
[in] | file_type | File type to be added. Must not be NULL. |
[in] | update_ctx | Update context for current file type. Must not be NULL. |
[in] | broadcast_file_info | true if gateways has to broadcast information about file provided. |
const vs_snap_service_t* vs_snap_fldt_server | ( | const vs_mac_addr_t * | gateway_mac, |
vs_fldt_server_add_filetype_cb | add_filetype | ||
) |
FLDT Server SNAP Service implementation.
This call returns FLDT server implementation. It must be called before any FLDT call.
[in] | gateway_mac | Gateway's MAC address. Must not be NULL. |
[in] | add_filetype | Callback. Must not be NULL. |