For RevB MBED Hardware, with the new boot sequence. This example establishes a transparent link between the mbed USB CDC port and the modem (LISA) on the C027. You can use it to use the standard u-blox tools such as m-center or any terminal program. These tools can then connect to the serial port and talk directly to the modem. Baudrate should be set to 115200 baud and is fixed. m-center can be downloaded from u-blox website following this link: http://www.u-blox.com/en/evaluation-tools-a-software/u-center/m-center.html

Dependencies:   C027-REVB UbloxUSBModem mbed

main.cpp

Committer:
dixter1
Date:
2013-12-14
Revision:
2:c4ad86683060
Parent:
1:15b5edb4a91f

File content as of revision 2:c4ad86683060:

#include "mbed.h"
#include "C027.h"

Ticker ticker;
DigitalOut led1(LED);
DigitalOut led2(LED1);
CAN can1(CANRD, CANTD);
Serial pc(USBTX, USBRX);

char counter = 0;

void send() {
    if(can1.write(CANMessage(1337, &counter, 1))) {
        pc.printf("Message sent: %d\r\n", counter);
        counter++;
    }
    led1 = !led1;
}

int main() {

    DigitalOut can_standby(CANS);
    
    // enable the CAN interface
    //   take it out of standby
    can_standby = 0;
    
    pc.baud(MDMBAUD);
    
    pc.printf( "Starting CAN Testing\r\n");

    CANMessage msg;
    while(1) {

        if(can1.read(msg)) {
            pc.printf("Message received: %d\r\n", msg.data[0]);
            led2 = !led2;
        }
        
        wait(0.2);
        
        send();
    }
}