public static KnxCEMI CreateStatusCEMI(byte messageCode, string destinationAddress) { KnxCEMI cemi = new KnxCEMI() { message_code = messageCode != 0x00 ? messageCode : (byte)0x11, aditional_info_length = 0, control_field_1 = 0xAC, control_field_2 = KnxHelper.IsAddressIndividual(destinationAddress) ? (byte)0x50 : (byte)0xF0, destination_address = destinationAddress, apdu = new byte[] { 0x00 }, _isstatus = true }; return(cemi); }
public static KnxCEMI CreateActionCEMI(byte messageCode, string destinationAddress, byte[] asdu) { KnxCEMI cemi = new KnxCEMI() { message_code = messageCode != 0x00 ? messageCode : (byte)0x11, aditional_info_length = 0, control_field_1 = 0xAC, control_field_2 = KnxHelper.IsAddressIndividual(destinationAddress) ? (byte)0x50 : (byte)0xF0, destination_address = destinationAddress, apdu = new byte[asdu.Length] }; cemi.apdu[0] = (byte)(0x80 | (asdu[0] & 0x3f)); for (var i = 1; i < asdu.Length; i++) { cemi.apdu[i] = asdu[i]; } return(cemi); }