set-freq-mask

wayland/m5stack-unit-lorawan/set-freq-mask

Set frequency band mask. For example: 0-7 channel has mask of 0001, 8-15 channel has mask of 0002, and so on.
set-freq-mask
@/set-freq-mask
Set frequency band mask. For example: 0-7 channel has mask of 0001, 8-15 channel has mask of 0002, and so on.
DEV@/lorawan-device
A lorawan-device.
Maskstring
Frequency mask.
UPDpulse
Update
set-freq-mask
DEV
Mask
UPD
Done
Donepulse
To use the node in your project you should have the wayland/m5stack-unit-lorawan library installed. Use the “File → Add Library” menu item in XOD IDE if you don’t have it yet. See Using libraries for more info.

C++ implementation

#pragma XOD evaluate_on_pin disable
#pragma XOD evaluate_on_pin enable input_UPD

node {

    void evaluate(Context ctx) {
        if (!isInputDirty<input_UPD>(ctx))
            return;

        auto LoRaWAN = getValue<input_DEV>(ctx);
        auto xMask = getValue<input_Mask>(ctx);

        int N=length(xMask)+1;
        char cMask[N];
        for(int i=0;i<N;i++)
            cMask[i]=0;
        dump(xMask, cMask);

        LoRaWAN->setFreqMask(cMask);

        emitValue<output_Done>(ctx, 1);
    }
}