question: protected static byte [ ] buildPayload ( SendMessageType sendMessageType , MedtronicCNLSession pumpSession , byte [ ] payload ) throws EncryptionException { byte payloadLength = ( byte ) ( payload == null ? 0 : payload . length ) ; ByteBuffer sendPayloadBuffer = ByteBuffer . allocate ( ENCRYPTED_ENVELOPE_SIZE + payloadLength + CRC_SIZE ) ; sendPayloadBuffer . order ( ByteOrder . BIG_ENDIAN ) ; sendPayloadBuffer . put ( sendSequenceNumber ( sendMessageType ) ) ; sendPayloadBuffer . putShort ( sendMessageType . value ) ; if ( payloadLength != 0 ) { sendPayloadBuffer . put ( payload ) ; } sendPayloadBuffer . putShort ( ( short ) MessageUtils . CRC16CCITT ( sendPayloadBuffer . array ( ) , 0xffff , 0x1021 , ENCRYPTED_ENVELOPE_SIZE + payloadLength ) ) ; ByteBuffer payloadBuffer = ByteBuffer . allocate ( ENVELOPE_SIZE + sendPayloadBuffer . capacity ( ) ) ; payloadBuffer . order ( ByteOrder . LITTLE_ENDIAN ) ; payloadBuffer . putLong ( pumpSession . getPumpMAC ( ) ) ; payloadBuffer . put ( ( byte ) pumpSession . getMedtronicSequenceNumber ( ) ) ; payloadBuffer . put ( ( byte ) 0x10 ) ; payloadBuffer . put ( ( byte ) sendPayloadBuffer . capacity ( ) ) ; payloadBuffer . put ( encrypt ( pumpSession . getKey ( ) , pumpSession . getIV ( ) , sendPayloadBuffer . array ( ) ) ) ; return payloadBuffer . array ( ) ; }
target:  MedtronicSendMessage: +-----------------+------------------------------+--------------+-------------------+--------------------------------+ | LE long pumpMAC | byte medtronicSequenceNumber | byte unknown | byte Payload size | byte[] Encrypted Payload bytes | +-----------------+------------------------------+--------------+-------------------+--------------------------------+ <p/> MedtronicSendMessage (decrypted payload): +-------------------------+----------------------+----------------------+--------------------+ | byte sendSequenceNumber | BE short sendMessageType | byte[] Payload bytes | BE short CCITT CRC | +-------------------------+----------------------+----------------------+--------------------+