Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/api/wpc_proto.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ typedef enum
*/
app_proto_res_e WPC_Proto_initialize(const char * port_name,
unsigned long bitrate,
char * gateway_id,
char * gateway_model,
char * gateway_version,
char * sink_id);
const char * gateway_id,
const char * gateway_model,
const char * gateway_version,
const char * sink_id);

/**
* \brief close protobuf interface
Expand Down
8 changes: 4 additions & 4 deletions lib/wpc_proto/internal_modules/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ static const wp_ErrorCode APP_ERROR_CODE_LUT[] = {
* Enforce null termination for strings stored
* \return True if successful, False otherwise
*/
bool Common_init(char * gateway_id,
char * gateway_model,
char * gateway_version,
char * sink_id)
bool Common_init(const char * gateway_id,
const char * gateway_model,
const char * gateway_version,
const char * sink_id)
{
strncpy(m_gateway_id, gateway_id, GATEWAY_ID_MAX_SIZE);
m_gateway_id[GATEWAY_ID_MAX_SIZE - 1]='\0';
Expand Down
8 changes: 4 additions & 4 deletions lib/wpc_proto/internal_modules/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
* \brief Intialize the common module
* \return True if successful, False otherwise
*/
bool Common_init(char * gateway_id,
char * gateway_model,
char * gateway_version,
char * sink_id);
bool Common_init(const char * gateway_id,
const char * gateway_model,
const char * gateway_version,
const char * sink_id);

char * Common_get_gateway_id(void);

Expand Down
8 changes: 4 additions & 4 deletions lib/wpc_proto/wpc_proto.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ static int open_and_check_connection(unsigned long baudrate, const char * port_n

app_proto_res_e WPC_Proto_initialize(const char * port_name,
unsigned long bitrate,
char * gateway_id,
char * gateway_model,
char * gateway_version,
char * sink_id)
const char * gateway_id,
const char * gateway_model,
const char * gateway_version,
const char * sink_id)
{
_Static_assert(WPC_PROTO_MAX_RESPONSE_SIZE >= (wp_GetConfigsResp_size + WPC_PROTO_GENERIC_MESSAGE_OVERHEAD),
"Max proto size too low");
Expand Down