cbc-apitool: Make character set configurable

osmo-cbc already supported the transmission of UCS2 characters for quite
some time.  However, the cbc-apitool didn't expose this capability so

Change-Id: Ia7291238f3b0af8ff9f476fce9a7805e12821d8c
Related: OS#6028
This commit is contained in:
Harald Welte 2023-10-18 19:40:14 +02:00 committed by laforge
parent 311673c365
commit 7ae4b6d61f
2 changed files with 4 additions and 1 deletions

View File

@ -63,7 +63,7 @@ def do_create_cbs(args):
'payload': {
'payload_decoded': {
'character_set': "gsm",
'character_set': args.character_set,
#'language': 'en',
'data_utf8': args.payload_data_utf8,
#'data_utf8': "Mahlzeit1 Mahlzeit2 Mahlzeit3 Mahlzeit4 Mahlzeit5 Mahlzeit6 Mahlzeit7 Mahlzeit8"
@ -126,6 +126,7 @@ def main(argv):
parser_c_cbs.add_argument("--repetition-period", type=int, help='Repetition Period', default=5)
parser_c_cbs.add_argument("--num-of-bcast", type=int, help='Number of Broadcasts', default=999)
parser_c_cbs.add_argument("--payload-data-utf8", type=str, help='Payload Data in UTF8', required=True)
parser_c_cbs.add_argument("--character-set", type=str, help='Character Set', default="gsm", choices=["gsm","ucs2","8bit"])
parser_c_etws = subparsers.add_parser('create-etws', help='Create a new ETWS message')

View File

@ -50,6 +50,8 @@ You can create a new CBS message using `cbc-apitool create-cbs`.
*--payload-data-utf8 PAYLOAD_DATA_UTF8*::
Payload data (typically text message) in UTF8 encoding. Will be
transcoded to 7bit GSM alphabet internally.
*--character-set {gsm,8bit,ucs2}*::
Character set to be used for the message. Default: gsm
==== `create-etws` Options