Skip to content

[FW] Wrap up code as an importable FW package #63

Description

@aexzhou

Wrap up/refactor the current code into a format that's easy for any external firmware developer to utilize.
E.g.:
(you don't have to use these class names if you'd like to use something else)

//  In someone's code embedded in their controller:
PanoramaPacket mypacket;
PanoramaCommand mycommand;
PanoramaServer server = new();
server.init();
server.config(
  // configs, settings, etc. that can be modified by developers
);
server.start();

// main controller loop
while (1) {
    // sending of data
    mypacket.data = 1.2345;
    mypacket.sensorname = 'motor';
    mypacket.time = current_time;
    server.send_packet(mypacket);

    // receiving command from client-side
    server.try_get_command(&mycommand); // non-blocking check for command
    if (mycommand.command == 'stop') {   
        // do stop routine
    }
}

Please develop this by having the package files in its own directory, and use it by #include-ing it in your main.cpp firmware file (this also acts as an example of how to use our package library'

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions