Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unicast message received as broadcast message #12

Open
M1rk0 opened this issue Jul 25, 2022 · 2 comments
Open

unicast message received as broadcast message #12

M1rk0 opened this issue Jul 25, 2022 · 2 comments

Comments

@M1rk0
Copy link

M1rk0 commented Jul 25, 2022

Hello Florian, thanks for your work on this nice project.
I am getting some issues with unicast messages, sending messages like this:

MY_NODE_ID = 0x3;
ASB_BRIDGE_NODE_ID = 0x1;
bool sendTemp() {
    float temperature;
    ds18b20Sensors.requestTemperatures();
    temperature = ds18b20Sensors.getTempCByIndex(0);
    int firstTempPart = temperature;
    temperature -= firstTempPart;
    int secondTempPart = temperature * 10;
    Serial.println(firstTempPart);
    Serial.println(secondTempPart);
    const unsigned int targetAdress = ASB_BRIDGE_NODE_ID;
    const char tempPort = 0x10;
    const byte tempData[3] = {ASB_CMD_S_TEMP, firstTempPart, secondTempPart};
    const byte tempState = asb0.asbSend(ASB_PKGTYPE_UNICAST, targetAdress, tempPort, sizeof(tempData), tempData);
    return (tempState == 0);
}

and receiving them like this:

Type: 0x0
Target: 0x1
Source: 0x3
Port: 0xFFFFFFFF
Length: 0x3
  0xA0 0x1A 0x3

I am wondering, why it is not Type: 0x2 and Port: 0x10. My goal is, to get different Temperatures from one Node and use different ports for that.

I would appreciate If you have a hint for me solving this. Thanks

adlerweb added a commit that referenced this issue Jul 25, 2022
@adlerweb
Copy link
Owner

Looks like CAN was unable to detect unicast due to a hardcoded but outdated check. Could you try with the latest commit?

@M1rk0
Copy link
Author

M1rk0 commented Jul 26, 2022

I just flashed both nodes with the new commit, but i am getting the same output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants