Hi everyone, I working with two cc13xx device and I would like to implement a serial communication between device. I think that used a HyperTerminal, but I read on UART and not communicate.
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi everyone, I working with two cc13xx device and I would like to implement a serial communication between device. I think that used a HyperTerminal, but I read on UART and not communicate.
But the code that has written of the "toggle RED yellow" through the UART, uses the 6lowpan network? I would like something similar but with two devices
Do you intend to do the following action?
PC (Send LED toggle command by UART) ----> CC1310 -------RF-------> -CC1310 (Toggle LED connecting to CC1310)
No, I don't have the LAUCHXL-CC1310 I told you! I use cc1310 custom.
sudo make TARGET=srf06-cc26xx BOARD=srf06/cc13xx udp-server.bin
Hi Yakai, for rf communication between two devices i found in example / rime the example-broadcast.c code. Now I would like to turn on the device LED by writing the command from another device. I wrote this code, but it does not work. What do you think about it?
/* * Copyright (c) 2007, Swedish Institute of Computer Science. * All rights reserved. */ /** * \file * Testing the broadcast via radio * \author * Mario Castaldo */ #include "contiki.h" #include "net/rime/rime.h" #include "random.h" #include "dev/cc26xx-uart.h" #include "dev/serial-line.h" #include "dev/button-sensor.h" #include "dev/leds.h" #include <stdio.h> /*---------------------------------------------------------------------------*/ PROCESS(example_broadcast_process, "Broadcast example"); AUTOSTART_PROCESSES(&example_broadcast_process); /*---------------------------------------------------------------------------*/ PROCESS(test_serial, "Serial line test process"); //AUTOSTART_PROCESSES(&test_serial); /*---------------------------------------------------------------------------*/ //static void //broadcast_recv(struct broadcast_conn *c, const linkaddr_t *from) //{ //printf("broadcast message received from %d.%d: '%s'\n", //from->u8[0], from->u8[1], (char *)packetbuf_dataptr()); //} static const struct broadcast_callbacks broadcast_call; static struct broadcast_conn broadcast; /*---------------------------------------------------------------------------*/ PROCESS_THREAD(example_broadcast_process, ev, data) { static struct etimer et; PROCESS_EXITHANDLER(broadcast_close(&broadcast);) PROCESS_BEGIN(); broadcast_open(&broadcast, 129, &broadcast_call); while(1) { /* Delay 2-4 seconds */ etimer_set(&et, CLOCK_SECOND * 4 + random_rand() % (CLOCK_SECOND * 4)); PROCESS_WAIT_EVENT_UNTIL(etimer_expired(&et)); packetbuf_copyfrom("Hello", 6); broadcast_send(&broadcast); printf("broadcast message sent\n"); } PROCESS_END(); } /*---------------------------------------------------------------------------*/ PROCESS_THREAD(test_serial, ev, data) { PROCESS_BEGIN(); cc26xx_uart_set_input(serial_line_input_byte); for(;;) { PROCESS_YIELD(); if(ev == serial_line_event_message) { printf("received line: %s\n", (char *)data); if(strcmp(data,"ON")==0) leds_on(LEDS_YELLOW); else if(strcmp(data,"OFF")==0) leds_off(LEDS_YELLOW); } } PROCESS_END(); } /*---------------------------------------------------------------------------*/