fpc_hcp.h
Go to the documentation of this file.
/*
* Copyright (c) 2020 Fingerprint Cards AB
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef FPC_HCP_H
#define FPC_HCP_H
#include <stdbool.h>
#include <stdint.h>
#include "fpc_hcp_common.h"
#include "fpc_com_chain.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
fpc_com_result_t fpc_hcp_transmit(fpc_hcp_packet_t *packet, fpc_com_chain_t *chain);
fpc_com_result_t fpc_hcp_receive(fpc_hcp_packet_t *packet, fpc_com_chain_t *chain);
bool fpc_hcp_arg_add(fpc_hcp_packet_t *packet, fpc_hcp_arg_t arg, uint16_t size, bool free_data,
void *data);
bool fpc_hcp_arg_check(fpc_hcp_packet_t *packet, fpc_hcp_arg_t arg);
fpc_hcp_arg_data_t *fpc_hcp_arg_get(fpc_hcp_packet_t *packet, fpc_hcp_arg_t arg);
bool fpc_hcp_arg_copy_data(fpc_hcp_packet_t *packet, fpc_hcp_arg_t arg, uint16_t data_size,
uint8_t *data);
void fpc_hcp_free(fpc_com_chain_t *chain, fpc_hcp_packet_t *packet);
uint16_t fpc_hcp_get_size(fpc_hcp_packet_t *packet, uint16_t *num_args);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* FPC_HCP_H */
fpc_hcp_arg_check
bool fpc_hcp_arg_check(fpc_hcp_packet_t *packet, fpc_hcp_arg_t arg)
Check if command contains selected argument key.
Definition: fpc_hcp.c:169
fpc_com_chain
Definition: fpc_com_chain.h:50
fpc_hcp_packet
Application Command Packet.
Definition: fpc_hcp_common.h:210
fpc_hcp_arg_get
fpc_hcp_arg_data_t * fpc_hcp_arg_get(fpc_hcp_packet_t *packet, fpc_hcp_arg_t arg)
Get Argument with specified key.
Definition: fpc_hcp.c:173
fpc_com_chain.h
Communication chain type definitions.
fpc_hcp_arg_data
Command Argument.
Definition: fpc_hcp_common.h:196
fpc_hcp_arg_add
bool fpc_hcp_arg_add(fpc_hcp_packet_t *packet, fpc_hcp_arg_t arg, uint16_t size, bool free_data, void *data)
Add argument to packet.
Definition: fpc_hcp.c:145
fpc_hcp_receive
fpc_com_result_t fpc_hcp_receive(fpc_hcp_packet_t *packet, fpc_com_chain_t *chain)
Receives an application packet through the supplied transmit chain.
Definition: fpc_hcp.c:117
fpc_hcp_arg_t
uint16_t fpc_hcp_arg_t
Definition: fpc_hcp_common.h:191
fpc_hcp_get_size
uint16_t fpc_hcp_get_size(fpc_hcp_packet_t *packet, uint16_t *num_args)
Calculate serialized packet size.
Definition: fpc_hcp.c:64
fpc_hcp_arg_copy_data
bool fpc_hcp_arg_copy_data(fpc_hcp_packet_t *packet, fpc_hcp_arg_t arg, uint16_t data_size, uint8_t *data)
Copy data from an argument with specified key.
Definition: fpc_hcp.c:183
fpc_hcp_transmit
fpc_com_result_t fpc_hcp_transmit(fpc_hcp_packet_t *packet, fpc_com_chain_t *chain)
Transmits an application packet through the supplied transmit chain.
Definition: fpc_hcp.c:89
fpc_com_result_t
uint8_t fpc_com_result_t
Definition: fpc_com_result.h:41
fpc_hcp_common.h
Host Communication Protocol common type definitions.
fpc_hcp_free
void fpc_hcp_free(fpc_com_chain_t *chain, fpc_hcp_packet_t *packet)
Frees the resources held by the packet i.e. the dynamic data held in the arguments.
Definition: fpc_hcp.c:198