nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches

◆ string_conversion_7bit_sms_packing()

uint8_t string_conversion_7bit_sms_packing ( uint8_t *  data,
uint8_t  data_len 
)

Performs SMS packing for a string using GSM 7 bit character set. The result is stored in the same memory buffer that contains the input string to be packed.

Description of the packing functionality: Unpacked data bits: bit number: 7 6 5 4 3 2 1 0 data byte 0: 0 1a 1b 1c 1d 1e 1f 1g d1 data byte 1: 0 2a 3b 2c 2d 2e 2f 2g d2 data byte 2: 0 3a 3b 3c 3d 3e 3f 3g d3 and so on...

Packed data bits: bit number: 7 6 5 4 3 2 1 0 data byte 0: 2g 1a 1b 1c 1d 1e 1f 1g d1>>0 | d2<<7 data byte 1: 3f 3g 2a 2b 2c 2d 2e 2f d2>>1 | d3<<6 data byte 2: 4e 4f 4g 3a 3b 3c 3d 3e d3>>2 | d4<<5 data byte 3: 5d 5e 5f 5g 4a 4b 4c 4d d4>>3 | d5<<4 data byte 4: 6c 6d 6e 6f 6g 5a 5b 5c d5>>4 | d6<<3 data byte 5: 7b 7c 7d 7e 7f 7g 6a 6b d6>>5 | d7<<2 data byte 6: 8a 8b 8c 8d 8e 8f 8g 7a d7>>6 | d8<<1 data byte 7: Ag 9a 9b 9c 9d 9e 9f 9g d9>>0 | dA<<7 data byte 8: Bf Bg Aa Ab Ac Ad Ae Af dA>>1 | dB<<6 and so on...

References: 3GPP TS 23.038 chapter 6.1.2.1: SMS Packing

Parameters
[in,out]dataPointer to array of characters to be packed (no null termination needed). Also the packed characters are stored into this buffer.
[in]data_lenNumber of characters to be packed
Returns
Number of valid bytes in the packed character data.