Skip to content
Snippets Groups Projects
Commit 00578959 authored by Hauke Mehrtens's avatar Hauke Mehrtens
Browse files

BLE: FileTrans: Use LOG_ERR


Replace printf with LOG_ERR.

Signed-off-by: default avatarHauke Mehrtens <hauke@hauke-m.de>
parent 2a542de3
Branches
No related tags found
No related merge requests found
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include "hci_vs.h" #include "hci_vs.h"
#include <epicardium.h> #include <epicardium.h>
#include "modules/log.h"
#include "util/bstream.h" #include "util/bstream.h"
#include "att_api.h" #include "att_api.h"
...@@ -218,9 +219,11 @@ static void sendCrcResponse( ...@@ -218,9 +219,11 @@ static void sendCrcResponse(
msg, msg,
sizeof(answer) - len); sizeof(answer) - len);
len += strlen(msg); len += strlen(msg);
printf("BLE file transfer: %s\n", msg); LOG_ERR("filetrans", "%s\n", msg);
} else { } else {
printf("error message \"%s\" too long\n", msg); LOG_ERR("filetrans",
"error message \"%s\" too long\n",
msg);
} }
} }
...@@ -251,9 +254,10 @@ static int bleFileCreateOrOpen(char *filepath) ...@@ -251,9 +254,10 @@ static int bleFileCreateOrOpen(char *filepath)
if (ret == -ENOENT) { if (ret == -ENOENT) {
ret = epic_file_mkdir(filepath); ret = epic_file_mkdir(filepath);
if (ret) { if (ret) {
printf("mkdir failed: %s, ret: %i\n", LOG_ERR("filetrans",
filepath, "mkdir failed: %s, ret: %i\n",
ret); filepath,
ret);
return ret; return ret;
} }
} }
...@@ -341,8 +345,9 @@ static uint8_t handleCentralTX( ...@@ -341,8 +345,9 @@ static uint8_t handleCentralTX(
} else if ( } else if (
operation != ATT_PDU_EXEC_WRITE_REQ && operation != ATT_PDU_EXEC_WRITE_REQ &&
operation != ATT_PDU_WRITE_CMD) { operation != ATT_PDU_WRITE_CMD) {
printf("operation 0x%x not supported, try normal write\n", LOG_ERR("filetrans",
operation); "operation 0x%x not supported, try normal write\n",
operation);
return ATT_ERR_INVALID_PDU; return ATT_ERR_INVALID_PDU;
} }
...@@ -370,7 +375,7 @@ static uint8_t handleCentralTX( ...@@ -370,7 +375,7 @@ static uint8_t handleCentralTX(
return ATT_SUCCESS; return ATT_SUCCESS;
case 'E': case 'E':
printf("Error was acked"); LOG_ERR("filetrans", "Error was acked");
return ATT_SUCCESS; return ATT_SUCCESS;
default: default:
...@@ -401,7 +406,9 @@ static uint8_t writeCallback( ...@@ -401,7 +406,9 @@ static uint8_t writeCallback(
connId, handle, operation, offset, len, pValue, pAttr connId, handle, operation, offset, len, pValue, pAttr
); );
default: default:
printf("unsupported characteristic: %c\n", handle); LOG_ERR("filetrans",
"unsupported characteristic: %c\n",
handle);
return ATT_ERR_HANDLE; return ATT_ERR_HANDLE;
} }
} }
...@@ -413,7 +420,7 @@ static uint8_t readCallback( ...@@ -413,7 +420,7 @@ static uint8_t readCallback(
uint16_t offset, uint16_t offset,
attsAttr_t *pAttr attsAttr_t *pAttr
) { ) {
printf("read callback\n"); LOG_ERR("filetrans", "read callback\n");
return ATT_SUCCESS; return ATT_SUCCESS;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment