Jump to content

[C/C++] [Erledigt] Chibi SNR

Recommended Posts

Hallo Leute,

sieht jemand den Fehler in meinen Code? Ich versuche den SNR der Slave-Chibi auszulesen. Mit Java gehts unter C zeigt er mit 0.00000

#include <stdio.h>

#include "ip_connection.h"
#include "brick_master.h"

#define PORT 4223
#define UID "XXXXXXXXXXX" // Change to your UID

int main() {
        // Create IP connection to brickd
        IPConnection ipcon;
        if(ipcon_create(&ipcon, HOST, PORT) < 0) {
                fprintf(stderr, "Could not create connection\n");

        // Create device object
        Master master;
        master_create(&master, UID);

        // Add device to IP connection
        if(ipcon_add_device(&ipcon, &master) < 0) {
                fprintf(stderr, "Could not connect to Brick\n");
        // Don't use device before it is added to a connection

        uint16_t voltage;
        master_get_stack_voltage(&master, &voltage);
        uint16_t current;
        master_get_stack_current(&master, &current);

        printf("Stack Voltage: %f V\n", voltage/1000.0);
        printf("Stack Current: %f V\n", current/1000.0);

        // Get SNR
        uint8_t snr;
        master_get_chibi_signal_strength(&master, &snr);
        printf("%f", snr);


Vielleicht ist es einfach nur wieder "Betriebsblindheit"


Edit: Ich verwende die aktuellen Bindings.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...