void RPMessage::write(RLFrame& dest) const { // All relay-layer messages (GSM 04.11 7.3) have the same 2-byte header. dest.resize(bitsNeeded()); size_t wp=0; dest.writeField(wp,0,5); // Note that we add one for the n->ms direction. // See GSM 04.11 8.2.2 Table 8.3 dest.writeField(wp,MTI()+1,3); dest.writeField(wp,mReference,8); // After the header, fill in the body. writeBody(dest,wp); }