mirror of
https://github.com/drasko/open-ameba.git
synced 2025-07-31 12:31:04 +00:00
delete '!!!'
This commit is contained in:
parent
de57c04fb4
commit
ed4c83a935
44 changed files with 206 additions and 187 deletions
|
|
@ -153,7 +153,7 @@ int uartadapter_uart_read(ua_socket_t *ua_socket, void *read_buf, size_t size)
|
|||
if(!ua_socket->uart.overlap){
|
||||
memcpy(ptr, (ua_socket->uart.recv_buf+ pread_local), read_bytes );
|
||||
}else {
|
||||
ua_printf(UA_DEBUG, "uart recv buf is write overlap!!");
|
||||
ua_printf(UA_DEBUG, "uart recv buf is write overlap!");
|
||||
if((pread_local + read_bytes) > UA_UART_RECV_BUFFER_LEN){
|
||||
memcpy(ptr,(ua_socket->uart.recv_buf+ pread_local),(UA_UART_RECV_BUFFER_LEN-pread_local));
|
||||
memcpy(ptr+(UA_UART_RECV_BUFFER_LEN-pread_local), ua_socket->uart.recv_buf,read_bytes-(UA_UART_RECV_BUFFER_LEN- pread_local));
|
||||
|
|
@ -187,7 +187,7 @@ int uartadapter_uart_write(ua_socket_t *ua_socket, char *pbuf, size_t size)
|
|||
while(RtlDownSema(&ua_socket->uart.dma_tx) == pdTRUE){
|
||||
ret = serial_send_stream_dma(&ua_socket->uart.uart_sobj, pbuf, size);
|
||||
if(ret != HAL_OK){
|
||||
ua_printf(UA_ERROR, "uart dma tx error %d!!", ret);
|
||||
ua_printf(UA_ERROR, "uart dma tx error %d!", ret);
|
||||
RtlUpSema(&ua_socket->uart.dma_tx);
|
||||
return -1;
|
||||
}else{
|
||||
|
|
@ -459,7 +459,7 @@ void uartadapter_systemreload(void)
|
|||
|
||||
void uartadapter_gpio_irq (uint32_t id, gpio_irq_event event)
|
||||
{
|
||||
ua_printf(UA_DEBUG, "GPIO push button!!");
|
||||
ua_printf(UA_DEBUG, "GPIO push button!");
|
||||
|
||||
ua_gpio_irq_happen = 1;
|
||||
RtlUpSemaFromISR(&ua_exception_sema);
|
||||
|
|
@ -510,7 +510,7 @@ void uartadapter_gpio_led_mode(ua_socket_t *ua_socket, ua_led_mode_t mode)
|
|||
(void*)uartadapter_gtimer_timeout_handler, (uint32_t)&ua_socket->gpio.gpio_led);
|
||||
break;
|
||||
default:
|
||||
ua_printf(UA_ERROR, "Unknown GPIO LED mode!!");
|
||||
ua_printf(UA_ERROR, "Unknown GPIO LED mode!");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ void cloud_link_task(void *param){
|
|||
sprintf(j, "%.2f", humidity);
|
||||
#endif
|
||||
if(ret < 0)
|
||||
printf("\n<-----LOCAL LINK FAILED!!(get infor failed)\n");
|
||||
printf("\n<-----LOCAL LINK FAILED!(get infor failed)\n");
|
||||
else{
|
||||
gen_json_data(i,j, data);
|
||||
printf("\nCLOUD-LINK--Sending data : \n%s\n", data);
|
||||
|
|
@ -60,10 +60,10 @@ void cloud_link_task(void *param){
|
|||
if(gn_put(&googlenest, URI, data) != 0)
|
||||
printf("PUT data failed!\n");
|
||||
gn_close(&googlenest);
|
||||
printf("\n<=====CLOUD LINK OK!!\n");
|
||||
printf("\n<=====CLOUD LINK OK!\n");
|
||||
}
|
||||
else{
|
||||
printf("\n<=====CLOUD LINK FAILED!!(google nest connecting)\n");
|
||||
printf("\n<=====CLOUD LINK FAILED!(google nest connecting)\n");
|
||||
}
|
||||
free(data);
|
||||
vTaskDelay(10000);
|
||||
|
|
@ -72,7 +72,7 @@ void cloud_link_task(void *param){
|
|||
|
||||
}
|
||||
else
|
||||
printf("\n<=====CLOUD LINK FAILED!!(flash reading)\n");
|
||||
printf("\n<=====CLOUD LINK FAILED!(flash reading)\n");
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -318,15 +318,15 @@ static void local_link_task(void *param)
|
|||
sprintf(j, "%.2f", humidity);
|
||||
#endif
|
||||
if(ret < 0)
|
||||
printf("\r\n\r\n<-----LOCAL LINK FAILED!!(get infor failed)\r\n\r\n");
|
||||
printf("\r\n\r\n<-----LOCAL LINK FAILED!(get infor failed)\r\n\r\n");
|
||||
else{
|
||||
printf("\r\n\r\n----->START LOCAL LINKING\r\n\r\n");
|
||||
gen_json_data(i, j, data);
|
||||
printf("Sending data : %s\r\n", data);
|
||||
if (local_link(data) < 0)
|
||||
printf("\r\n\r\n<-----LOCAL LINK FAILED!!\r\n\r\n");
|
||||
printf("\r\n\r\n<-----LOCAL LINK FAILED!\r\n\r\n");
|
||||
else
|
||||
printf("\r\n\r\n<-----LOCAL LINK OK!!\r\n\r\n");
|
||||
printf("\r\n\r\n<-----LOCAL LINK OK!\r\n\r\n");
|
||||
vTaskDelay(1000);
|
||||
}
|
||||
}
|
||||
|
|
@ -502,10 +502,10 @@ static void pair_device_task(void)
|
|||
temp = NULL;
|
||||
}
|
||||
if(pair_device(tx_buffer, rx_buffer, 1) >= 0)
|
||||
printf("\r\n\r\n<===First handshake OK!!\r\n\r\n");
|
||||
printf("\r\n\r\n<===First handshake OK!\r\n\r\n");
|
||||
else{
|
||||
i--;
|
||||
printf("\r\n\r\n<===First handshake FAILED!!\r\n\r\n");
|
||||
printf("\r\n\r\n<===First handshake FAILED!\r\n\r\n");
|
||||
}
|
||||
}
|
||||
//Second handshake
|
||||
|
|
@ -558,11 +558,11 @@ static void pair_device_task(void)
|
|||
flash_stream_write(&iot_flash, FLASH_IOT_DATA, 33, (uint8_t *) data);
|
||||
IOT_DEBUG("PAIR_STATE: %d\r\n", PAIR_STATE[0]);
|
||||
}
|
||||
printf("\r\n\r\n<=====Second handshake OK!!\r\n\r\n");
|
||||
printf("\r\n\r\n<=====Second handshake OK!\r\n\r\n");
|
||||
}
|
||||
else{
|
||||
i = i - 2;
|
||||
printf("\r\n\r\n<=====Second handshake FAILED!!\r\n\r\n");
|
||||
printf("\r\n\r\n<=====Second handshake FAILED!\r\n\r\n");
|
||||
}
|
||||
}
|
||||
//Third handshake
|
||||
|
|
@ -586,15 +586,15 @@ static void pair_device_task(void)
|
|||
flash_stream_write(&iot_flash, FLASH_IOT_DATA, 97, (uint8_t *) data);
|
||||
IOT_DEBUG("PAIR_STATE: %d\r\n", PAIR_STATE[0]);
|
||||
|
||||
printf("\r\n\r\n<=======Third handshake OK!!\r\n\r\n");
|
||||
printf("\r\n\r\n<=======Third handshake OK!\r\n\r\n");
|
||||
}
|
||||
else{
|
||||
i = i - 3;
|
||||
printf("\r\n\r\n<=======Third handshake FAILED!!\r\n\r\n");
|
||||
printf("\r\n\r\n<=======Third handshake FAILED!\r\n\r\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
printf("\r\n\r\n<=========Pairing OK!!\r\n\r\n");
|
||||
printf("\r\n\r\n<=========Pairing OK!\r\n\r\n");
|
||||
}
|
||||
|
||||
static void mdns_task(void *param)
|
||||
|
|
@ -657,7 +657,7 @@ static void mdns_task(void *param)
|
|||
TXTRecordSetValue(&txtRecord, "CONTROL_TYPE", strlen("0"), "0");
|
||||
dnsServiceRef = mDNSRegisterService("ht_sensor", "_Ameba._tcp", "local", PORT, &txtRecord);
|
||||
TXTRecordDeallocate(&txtRecord);
|
||||
printf("\r\n\r\n<========Registering mDNS service OK!!\r\n\r\n");
|
||||
printf("\r\n\r\n<========Registering mDNS service OK!\r\n\r\n");
|
||||
pair_device_task();
|
||||
}
|
||||
//The device was paired
|
||||
|
|
@ -676,7 +676,7 @@ static void mdns_task(void *param)
|
|||
|
||||
dnsServiceRef = mDNSRegisterService("ht_sensor", "_Ameba._tcp", "local", PORT, &txtRecord);
|
||||
TXTRecordDeallocate(&txtRecord);
|
||||
printf("\r\n\r\n<========Registering mDNS service OK!! PAIR_STATE = 1\r\n\r\n");
|
||||
printf("\r\n\r\n<========Registering mDNS service OK! PAIR_STATE = 1\r\n\r\n");
|
||||
}
|
||||
#if PSEUDO_DATA
|
||||
printf("\r\n\r\n========>Using the speudo data\r\n\r\n");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue