Commit 85e6f754 authored by Lucas Russo's avatar Lucas Russo

libbpmclient: fix bpm_client_new () signature

To maintain compatibility with existing code, we have
reversed bpm_client_new () function to the old one and
create two new bpm_client_new_* () type of fuuntions to
set the timeout: bpm_client_new_time () and
bpm_client_new_log_mode_time ().
parent 795e3cee
......@@ -20,10 +20,18 @@ struct _smio_afc_diag_revision_data_t;
/************************ Our API ***********************/
/********************************************************/
/* Create an instance of the BPM client. This must be called
* before any operation involving communicating with the BPM
* server. Return an instance of the bpm client */
bpm_client_t *bpm_client_new (char *broker_endp, int verbose,
const char *log_file_name);
/* Create an instance of the BPM client. This must be called
* before any operation involving communicating with the BPM
* server, specifying the send/recv timeout in ms.
* Return an instance of the bpm client */
bpm_client_t *bpm_client_new_time (char *broker_endp, int verbose,
const char *log_file_name, uint32_t timeout);
/* Create an instance of the BPM client, with the log filemode specified
......@@ -31,6 +39,13 @@ bpm_client_t *bpm_client_new (char *broker_endp, int verbose,
* involving communicating with the BPM server. Return an instance of the bpm
* client */
bpm_client_t *bpm_client_new_log_mode (char *broker_endp, int verbose,
const char *log_file_name, const char *log_mode);
/* Create an instance of the BPM client, with the log filemode specified
* by "log_mode" as in fopen () call, and the send/recv timeout in ms.
* This must be called before any operation involving communicating with the
* BPM server. Return an instance of the bpm client */
bpm_client_t *bpm_client_new_log_mode_time (char *broker_endp, int verbose,
const char *log_file_name, const char *log_mode, uint32_t timeout);
/* Destroy an instance of the BPM client. This must be called
......
......@@ -38,6 +38,7 @@
#define BPMCLIENT_DFLT_LOG_MODE "w"
#define BPMCLIENT_MLM_CONNECT_TIMEOUT 1000 /* in ms */
#define BPMCLIENT_DFLT_TIMEOUT 1000 /* in ms */
/* Our structure */
struct _bpm_client_t {
......@@ -91,19 +92,33 @@ acq_chan_t acq_chan[END_CHAN_ID] = { [0] = {.chan = ADC0_CHAN_ID, .sample_
/************************ Our API ***********************/
/********************************************************/
bpm_client_t *bpm_client_new (char *broker_endp, int verbose,
const char *log_file_name, uint32_t timeout)
const char *log_file_name)
{
return _bpm_client_new (broker_endp, verbose, log_file_name,
BPMCLIENT_DFLT_LOG_MODE, timeout);
BPMCLIENT_DFLT_LOG_MODE, BPMCLIENT_DFLT_TIMEOUT);
}
bpm_client_t *bpm_client_new_log_mode (char *broker_endp, int verbose,
const char *log_file_name, const char *log_mode)
{
return _bpm_client_new (broker_endp, verbose, log_file_name,
log_mode, BPMCLIENT_DFLT_TIMEOUT);
}
bpm_client_t *bpm_client_new_log_mode_time (char *broker_endp, int verbose,
const char *log_file_name, const char *log_mode, uint32_t timeout)
{
return _bpm_client_new (broker_endp, verbose, log_file_name,
log_mode, timeout);
}
bpm_client_t *bpm_client_new_time (char *broker_endp, int verbose,
const char *log_file_name, uint32_t timeout)
{
return _bpm_client_new (broker_endp, verbose, log_file_name,
BPMCLIENT_DFLT_LOG_MODE, timeout);
}
void bpm_client_destroy (bpm_client_t **self_p)
{
assert (self_p);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment