Giter Site home page Giter Site logo

ni-libraries's People

Contributors

thadhouse avatar peterjohnson avatar prateekma avatar sciencewhiz avatar

Stargazers

gvl610 avatar Guilherme Samuel avatar Josh L avatar Austin Shalit avatar Connor Worley avatar

Watchers

 avatar James Cloos avatar Austin Shalit avatar  avatar  avatar  avatar Cody Hale avatar

ni-libraries's Issues

FRC_NetworkCommunication_CANSessionMux_sendMessage gives a status of -44089

I'm writing a simple CAN demo without WPILib. The title, I suppose, says it all.
My code:

int32_t createCANId(int deviceID, int deviceType, int manufacturerType, int32_t apiId) { // Shamelessly stolen from WPILib (and fixed to use sensible datatypes)
  int32_t createdId = 0;
  createdId |= ((int32_t)(deviceType) & 0x1F) << 24;
  createdId |= ((int32_t)(manufacturerType) & 0xFF) << 16;
  createdId |= (apiId & 0x3FF) << 6;
  createdId |= deviceID & 0x3F;
  return createdId;
}

void sendMessage(int id){
    uint8_t message[8] = {
        0, 0, 0, 0, 0, 0, 0, 0
    };
    int32_t status;
    FRC_NetworkCommunication_CANSessionMux_sendMessage(createCANId(id, 0, 0, 0), message, 8, 0, &status);
    if (status != 0){
        std::cout << "A can frame failed to send: " << (long)status << std::endl;
    }
    usleep(100000);
}

(Edited, as I'm not capable of disclosing some constant values)

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.