Code Monkey home page Code Monkey logo

at-command's Introduction

AT Commander

The AT Commander is a C library (with an optional C++ wrapper) for controller an embedded module that uses an AT command set.

Supported AT Platforms

  • Roving Networks
    • RN-41
    • RN-42
  • Digi
    • XBee

Firmware

There are examples in this repository for a few platforms that you can flash to set the baud rate of an attached RN-42:

  • Arduino / chipKIT
  • LPC17xx

C API Example

For a full working example on the Arduion platform, see the arduino directory.

A brief example:

AtCommanderConfig config;
config.platform = AT_PLATFORM_RN42;
config.write_function = write_byte
config.read_function = read_byte
config.delay_function = delay;

// Set the baud to 115200, if it's not already correct
bool baud_set = at_commander_set_baud(&config, 115200);

char device_id[20];
at_commander_get_device_id(&config, device_id, sizeof(device_id));

// Send an arbitrary "get" request:
AtCommand my_get_command = {
    request_format: "GB",
    expected_response: NULL,
    error_response: "ERR"
};

char response[25];
at_commander_get(config, &my_get_command, response, sizeof(response));

// Send an arbitrary "set" command, with arguments
AtCommand my_set_command = {
    request_format: "SR,%s",
    expected_response: "AOK",
    error_response: "ERR"
};

at_commander_set(config, &my_set_command, "Z");

C++ API Example

TODO, might look like this:

AtCommander commander(AT_PLATFORM_RN42, Serial.write, Serial.read, delay);
commander.setBaud(115200);

Testing

The library includes a test suite that uses the check C unit test library.

$ script/bootstrap.sh
$ make test

Authors

Chris Peplin [email protected]

License

Copyright (c) 2013 Ford Motor Company

Licensed under the BSD license.

at-command's People

Contributors

peplin avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.