asysbus icon indicating copy to clipboard operation
asysbus copied to clipboard

unicast message received as broadcast message

Open M1rk0 opened this issue 1 year ago • 2 comments

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

M1rk0 avatar Jul 25 '22 10:07 M1rk0

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

adlerweb avatar Jul 25 '22 14:07 adlerweb

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

M1rk0 avatar Jul 26 '22 09:07 M1rk0