static int bt_hf_agent_send_at_cmd(GDBusMethodInvocation *context, char *atcmd);
static int hf_handle_rx_at_cmd(bt_hf_agent_info_t *bt_hf_info, const char *buf);
+
+void __bt_hf_agent_print_at_buffer(char *message, const char *buf)
+{
+
+ int i = 0;
+ char s[BT_HF_DATA_BUF_SIZE] = {0, };
+ gboolean hide = FALSE;
+
+ gboolean has_clcc = FALSE;
+ gboolean has_clip = FALSE;
+ gboolean has_ccwa = FALSE;
+ char *xsat_ptr;
+
+ strncpy(s, buf, BT_HF_DATA_BUF_SIZE - 1);
+
+ has_clcc = strstr(buf, "CLCC:") ? TRUE : FALSE;
+ if (has_clcc == TRUE)
+ goto done;
+ has_clip = strstr(buf, "+CLIP:") ? TRUE : FALSE;
+ if (has_clip == TRUE)
+ goto done;
+ has_ccwa = strstr(buf, "+CCWA:") ? TRUE : FALSE;
+
+done:
+ /* +XSAT: 11,DISC */
+ xsat_ptr = strstr(s, "11,DISC,");
+ if (xsat_ptr) {
+ xsat_ptr = xsat_ptr + 8;
+ int x = 0;
+ while (xsat_ptr[x] != '\0' && xsat_ptr[x] != '\r' && xsat_ptr[x] != '\n') {
+ xsat_ptr[x] = 'X';
+ x++;
+ }
+ }
+
+ /* AT+XSAT=11,Q_CT,X,XXXX */
+ xsat_ptr = strstr(s, "11,Q_CT,");
+ if (xsat_ptr) {
+ xsat_ptr = xsat_ptr + 8;
+ int x = 0;
+ while (xsat_ptr[x] != '\0' && xsat_ptr[x] != '\r' && xsat_ptr[x] != '\n') {
+ if (x > 1) /* ignore 0 and 1 position */
+ xsat_ptr[x] = 'X';
+ x++;
+ }
+ }
+
+ i = 0;
+ while (s[i] != '\0') {
+ if (s[i] == '\r' || s[i] == '\n') {
+ s[i] = '.';
+ } else {
+ if (s[i] == '\"')
+ hide = hide ? FALSE : TRUE;
+ else if ((has_clcc || has_clip || has_ccwa) && hide) {
+ if (i % 2)
+ s[i] = 'X';
+ }
+ }
+ i++;
+ }
+ if (message)
+ INFO("%s Buffer = %s, Length = %d ", message, s, strlen(s));
+ else
+ INFO("%s", s);
+}
+
static GQuark __bt_hf_agent_error_quark(void)
{
DBG("");
g_variant_get(parameters, "(&s)", &cmd);
- DBG("Going to call SendAtCmd, cmd is = [%s]\n", cmd);
+ DBG("Going to call SendAtCmd\n");
ret = bt_hf_agent_send_at_cmd(context, cmd);
if (ret)
goto fail;
if (bt_hf_info.slc == FALSE)
return FALSE;
- if (pending_flag)
- DBG("*** Add Pending queue request for = %s **** ", at);
- else
- DBG("Add Pending queue respnse for = %s ", at);
+ DBG("Add Pending queue. (pending_flag is %s)",
+ pending_flag ? "TRUE" : "FALSE");
bt_hf_agent_send_at_info *cmd = g_new0(bt_hf_agent_send_at_info, 1);
cmd->id = ++g_id;
ERR("Failed to select the Codec");
}
-void __bt_hf_agent_print_at_buffer(char *message, const char *buf)
-{
-
- int i = 0;
- char s[BT_HF_DATA_BUF_SIZE] = {0, };
- gboolean hide = FALSE;
-
- gboolean has_clcc = FALSE;
- gboolean has_clip = FALSE;
- gboolean has_ccwa = FALSE;
- char *xsat_ptr;
-
- strncpy(s, buf, BT_HF_DATA_BUF_SIZE - 1);
-
- has_clcc = strstr(buf, "CLCC:") ? TRUE : FALSE;
- if (has_clcc == TRUE)
- goto done;
- has_clip = strstr(buf, "+CLIP:") ? TRUE : FALSE;
- if (has_clip == TRUE)
- goto done;
- has_ccwa = strstr(buf, "+CCWA:") ? TRUE : FALSE;
-
-done:
- /* +XSAT: 11,DISC */
- xsat_ptr = strstr(s, "11,DISC,");
- if (xsat_ptr) {
- xsat_ptr = xsat_ptr + 8;
- int x = 0;
- while (xsat_ptr[x] != '\0' && xsat_ptr[x] != '\r' && xsat_ptr[x] != '\n') {
- xsat_ptr[x] = 'X';
- x++;
- }
- }
-
- /* AT+XSAT=11,Q_CT,X,XXXX */
- xsat_ptr = strstr(s, "11,Q_CT,");
- if (xsat_ptr) {
- xsat_ptr = xsat_ptr + 8;
- int x = 0;
- while (xsat_ptr[x] != '\0' && xsat_ptr[x] != '\r' && xsat_ptr[x] != '\n') {
- if (x > 1) /* ignore 0 and 1 position */
- xsat_ptr[x] = 'X';
- x++;
- }
- }
-
- i = 0;
- while (s[i] != '\0') {
- if (s[i] == '\r' || s[i] == '\n') {
- s[i] = '.';
- } else {
- if (s[i] == '\"')
- hide = hide ? FALSE : TRUE;
- else if ((has_clcc || has_clip || has_ccwa) && hide) {
- if (i % 2)
- s[i] = 'X';
- }
- }
- i++;
- }
- if (message)
- INFO("%s Buffer = %s, Length = %d ", message, s, strlen(s));
- else
- INFO("%s", s);
-}
-
static int __bt_hf_agent_handler_ciev(bt_hf_agent_info_t *bt_hf_info, const char *buf)
{
gchar *indicator;
g_io_channel_flush(io_chan, NULL);
if (count > 2 && data[2] == 'D') { /* ATDXXXXX */
- INFO("Send only buffer size =[%d] No len = %d - Send <<<<<| %s",
- count, count - 6, "ATDXXXXXXX");
+ INFO("[HF AT CMD] Send only without queue <<<<<: Buffer = %s, Length = %d ",
+ "ATDXXXXXXX", count);
snprintf(prev_cmd, BT_HF_CMD_BUF_SIZE, "%s", data);
} else {
- INFO("No queue....Send only buffer size =[%d] - Send <<<<<| %s",
- count, data);
+ __bt_hf_agent_print_at_buffer("[HF AT CMD] Send only without queue <<<<<:",
+ data);
}
send_flag++;
g_io_channel_flush(io_chan, NULL);
if (count > 2 && data[2] == 'D') /* ATDXXXXX */
- INFO("Send only buffer size =[%d] No len = %d - Send <<<<<| %s",
- count, count - 6, "ATDXXXXXXX");
+ INFO("[HF AT CMD] Send only <<<<<: Buffer = %s, Length = %d ",
+ "ATDXXXXXXX", count);
else
- INFO("Send only buffer size =[%d] - Send <<<<<| %s", count, data);
+ __bt_hf_agent_print_at_buffer("[HF AT CMD] Send only <<<<<:",
+ data);
send_flag++;
DBG("Ref %d(after) on Send only buffer size =[%d] - Send <<<<<| %s",