1# Azure IoT JSON 2 3## Azure IoT JSON Reader 4 5**nx_azure_iot_json_reader_with_buffer_init** 6*** 7<div style="text-align: right">Initializes JSON Reader</div> 8 9**Prototype** 10```c 11UINT nx_azure_iot_json_reader_with_buffer_init(NX_AZURE_IOT_JSON_READER *reader_ptr, 12 const UCHAR *buffer_ptr, UINT buffer_len); 13``` 14**Description** 15 16<p>Initializes an #NX_AZURE_IOT_JSON_READER to read the JSON payload contained within the provided 17buffer. </p> 18 19**Parameters** 20| Name | Description | 21| - |:-| 22| reader_ptr [out] | A pointer to an #NX_AZURE_IOT_JSON_READER instance to initialize. | 23| buffer_ptr [in] | An pointer to buffer containing the JSON text to read. | 24| buffer_len [in] | Length of buffer. | 25 26**Return Values** 27* NX_AZURE_IOT_SUCCESS Successfully initialized JSON reader. 28 29**Allowed From** 30 31Initialization, Threads 32 33**Example** 34 35**See Also** 36 37<div style="page-break-after: always;"></div> 38 39**nx_azure_iot_json_reader_init** 40*** 41<div style="text-align: right">Initializes JSON Reader</div> 42 43**Prototype** 44```c 45UINT nx_azure_iot_json_reader_init(NX_AZURE_IOT_JSON_READER *reader_ptr, 46 NX_PACKET *packet_ptr); 47``` 48**Description** 49 50<p>Initializes an #NX_AZURE_IOT_JSON_READER to read the JSON payload contained within #NX_PACKET</p> 51 52**Parameters** 53 54| Name | Description | 55| - |:-| 56| reader_ptr [out] | A pointer to an #NX_AZURE_IOT_JSON_READER instance to initialize. | 57| packet_ptr [in] | A pointer to #NX_PACKET containing the JSON text. | 58 59**Return Values** 60* NX_AZURE_IOT_SUCCESS Successfully initialized JSON reader. 61 62**Allowed From** 63 64Threads 65 66**Example** 67 68**See Also** 69 70<div style="page-break-after: always;"></div> 71 72**nx_azure_iot_json_reader_deinit** 73*** 74<div style="text-align: right">De-initializes JSON Reader</div> 75 76**Prototype** 77```c 78UINT nx_azure_iot_json_reader_deinit(NX_AZURE_IOT_JSON_READER *reader_ptr); 79 80``` 81**Description** 82 83<p>De-initializes an #NX_AZURE_IOT_JSON_READER</p> 84 85**Parameters** 86 87| Name | Description | 88| - |:-| 89| reader_ptr [in] | A pointer to an #NX_AZURE_IOT_JSON_READER instance to de-initialize | 90 91**Return Values** 92* NX_AZURE_IOT_SUCCESS Successfully de-initialized JSON reader. 93 94**Allowed From** 95 96Threads 97 98**Example** 99 100**See Also** 101 102<div style="page-break-after: always;"></div> 103 104**nx_azure_iot_json_reader_next_token** 105*** 106<div style="text-align: right">Move to next JSON token</div> 107 108**Prototype** 109```c 110UINT nx_azure_iot_json_reader_next_token(NX_AZURE_IOT_JSON_READER *reader_ptr); 111 112``` 113**Description** 114 115<p>Reads the next token in the JSON text and updates the reader state.</p> 116 117**Parameters** 118 119| Name | Description | 120| - |:-| 121| reader_ptr [in] | A pointer to an #NX_AZURE_IOT_JSON_READER instance containing the JSON to read. | 122 123**Return Values** 124* NX_AZURE_IOT_SUCCESS The token was read successfully. 125 126**Allowed From** 127 128Threads 129 130**Example** 131 132**See Also** 133 134<div style="page-break-after: always;"></div> 135 136**nx_azure_iot_json_reader_skip_children** 137*** 138<div style="text-align: right">Reads and skips over any nested JSON elements</div> 139 140**Prototype** 141```c 142UINT nx_azure_iot_json_reader_skip_children(NX_AZURE_IOT_JSON_READER *reader_ptr); 143 144``` 145**Description** 146 147<p>Reads and skips over any nested JSON elements.</p> 148 149**Parameters** 150 151| Name | Description | 152| - |:-| 153| reader_ptr [in] | A pointer to an #NX_AZURE_IOT_JSON_READER instance containing the JSON to read. | 154 155**Return Values** 156* NX_AZURE_IOT_SUCCESS The children of the current JSON token are skipped successfully. 157 158**Allowed From** 159 160Threads 161 162**Example** 163 164**See Also** 165 166<div style="page-break-after: always;"></div> 167 168**nx_azure_iot_json_reader_token_bool_get** 169*** 170<div style="text-align: right">Gets the JSON token's boolean value</div> 171 172**Prototype** 173```c 174UINT nx_azure_iot_json_reader_token_bool_get(NX_AZURE_IOT_JSON_READER *reader_ptr, 175 UINT *value_ptr); 176 177``` 178**Description** 179 180<p>Gets the JSON token's boolean value.</p> 181 182**Parameters** 183 184| Name | Description | 185| - |:-| 186| reader_ptr [in] | A pointer to an #NX_AZURE_IOT_JSON_READER instance containing the JSON to read. | 187| value_ptr [out] | A pointer to a variable to receive the value. | 188 189**Return Values** 190* NX_AZURE_IOT_SUCCESS The boolean value is returned. 191 192**Allowed From** 193 194Threads 195 196**Example** 197 198**See Also** 199 200<div style="page-break-after: always;"></div> 201 202**nx_azure_iot_json_reader_token_uint32_get** 203*** 204<div style="text-align: right">Gets the JSON token's number as a 32-bit unsigned integer</div> 205 206**Prototype** 207```c 208UINT nx_azure_iot_json_reader_token_uint32_get(NX_AZURE_IOT_JSON_READER *reader_ptr, 209 uint32_t *value_ptr); 210 211``` 212**Description** 213 214<p>Gets the JSON token's number as a 32-bit unsigned integer.</p> 215 216**Parameters** 217 218| Name | Description | 219| - |:-| 220| reader_ptr [in] | A pointer to an #NX_AZURE_IOT_JSON_READER instance containing the JSON to read. | 221| value_ptr [out] | A pointer to a variable to receive the value. | 222 223**Return Values** 224* NX_AZURE_IOT_SUCCESS The number is returned. 225 226**Allowed From** 227 228Threads 229 230**Example** 231 232**See Also** 233 234<div style="page-break-after: always;"></div> 235 236**nx_azure_iot_json_reader_token_int32_get** 237*** 238<div style="text-align: right">Gets the JSON token's number as a 32-bit signed integer</div> 239 240**Prototype** 241```c 242UINT nx_azure_iot_json_reader_token_int32_get(NX_AZURE_IOT_JSON_READER *reader_ptr, 243 int32_t *value_ptr); 244 245``` 246**Description** 247 248<p>Gets the JSON token's number as a 32-bit signed integer.</p> 249 250**Parameters** 251 252| Name | Description | 253| - |:-| 254| reader_ptr [in] | A pointer to an #NX_AZURE_IOT_JSON_READER instance containing the JSON to read. | 255| value_ptr [out] | A pointer to a variable to receive the value. | 256 257**Return Values** 258* NX_AZURE_IOT_SUCCESS The number is returned. 259 260**Allowed From** 261 262Threads 263 264**Example** 265 266**See Also** 267 268<div style="page-break-after: always;"></div> 269 270**nx_azure_iot_json_reader_token_double_get** 271*** 272<div style="text-align: right">Gets the JSON token's number as a `double`</div> 273 274**Prototype** 275```c 276UINT nx_azure_iot_json_reader_token_double_get(NX_AZURE_IOT_JSON_READER *reader_ptr, 277 double *value_ptr); 278 279``` 280**Description** 281 282<p>Gets the JSON token's number as a `double`.</p> 283 284**Parameters** 285 286| Name | Description | 287| - |:-| 288| reader_ptr [in] | A pointer to an #NX_AZURE_IOT_JSON_READER instance containing the JSON to read. | 289| value_ptr [out] | A pointer to a variable to receive the value. | 290 291**Return Values** 292* NX_AZURE_IOT_SUCCESS The number is returned. 293 294**Allowed From** 295 296Threads 297 298**Example** 299 300**See Also** 301 302<div style="page-break-after: always;"></div> 303 304**nx_azure_iot_json_reader_token_string_get** 305*** 306<div style="text-align: right">Gets the JSON token's string</div> 307 308**Prototype** 309```c 310UINT nx_azure_iot_json_reader_token_string_get(NX_AZURE_IOT_JSON_READER *reader_ptr, 311 UCHAR *buffer_ptr, UINT buffer_size, UINT *bytes_copied); 312 313``` 314**Description** 315 316<p>Gets the JSON token's string after unescaping it, if required.</p> 317 318**Parameters** 319 320| Name | Description | 321| - |:-| 322| reader_ptr [in] | A pointer to an #NX_AZURE_IOT_JSON_READER instance containing the JSON to read. | 323| buffer_ptr [out] | A pointer to a buffer where the string should be copied into. | 324| buffer_size [in] | The maximum available space within the buffer referred to by buffer_ptr. | 325| bytes_copied [out] | Contains the number of bytes written to the destination which denote the length of the unescaped string. | 326 327**Return Values** 328* NX_AZURE_IOT_SUCCESS The string is returned. 329 330**Allowed From** 331 332Threads 333 334**Example** 335 336**See Also** 337 338<div style="page-break-after: always;"></div> 339 340**nx_azure_iot_json_reader_token_is_text_equal** 341*** 342<div style="text-align: right">Compare token to text</div> 343 344**Prototype** 345```c 346UINT nx_azure_iot_json_reader_token_is_text_equal(NX_AZURE_IOT_JSON_READER *reader_ptr, 347 UCHAR *expected_text_ptr, UINT expected_text_len); 348 349``` 350**Description** 351 352<p>Determines whether the unescaped JSON token value that the #NX_AZURE_IOT_JSON_READER points to is equal to the expected text within the provided buffer bytes by doing a case-sensitive comparison.</p> 353 354**Parameters** 355 356| Name | Description | 357| - |:-| 358| reader_ptr [in] | A pointer to an #NX_AZURE_IOT_JSON_READER instance containing the JSON to read. | 359| expected_text_ptr [in] | A pointer to lookup text to compare the token against. | 360| expected_text_len [in] | Length of expected_text_ptr. | 361 362**Return Values** 363* NX_TRUE If the current JSON token value in the JSON source semantically matches the expected lookup text. 364* NX_FALSE Otherwise. 365 366**Allowed From** 367 368Threads 369 370**Example** 371 372**See Also** 373 374<div style="page-break-after: always;"></div> 375 376**nx_azure_iot_json_reader_token_type** 377*** 378<div style="text-align: right">Determines type of token currently #NX_AZURE_IOT_JSON_READER points to</div> 379 380**Prototype** 381```c 382UINT nx_azure_iot_json_reader_token_type(NX_AZURE_IOT_JSON_READER *reader_ptr); 383 384``` 385**Description** 386 387<p>Determines type of token currently #NX_AZURE_IOT_JSON_READER points to..</p> 388 389**Parameters** 390 391| Name | Description | 392| - |:-| 393| reader_ptr [in] | A pointer to an #NX_AZURE_IOT_JSON_READER instance containing the JSON to read. | 394 395**Return Values** 396* NX_AZURE_IOT_READER_TOKEN_NONE There is no value. 397* NX_AZURE_IOT_READER_TOKEN_BEGIN_OBJECT The token kind is the start of a JSON object. 398* NX_AZURE_IOT_READER_TOKEN_END_OBJECT The token kind is the end of a JSON object. 399* NX_AZURE_IOT_READER_TOKEN_BEGIN_ARRAY The token kind is the start of a JSON array. 400* NX_AZURE_IOT_READER_TOKEN_END_ARRAY The token kind is the end of a JSON array. 401* NX_AZURE_IOT_READER_TOKEN_PROPERTY_NAME The token kind is a JSON property name. 402* NX_AZURE_IOT_READER_TOKEN_STRING The token kind is a JSON string. 403* NX_AZURE_IOT_READER_TOKEN_NUMBER The token kind is a JSON number. 404* NX_AZURE_IOT_READER_TOKEN_TRUE The token kind is the JSON literal `true`. 405* NX_AZURE_IOT_READER_TOKEN_FALSE The token kind is the JSON literal `false`. 406* NX_AZURE_IOT_READER_TOKEN_NULL The token kind is the JSON literal `null`. 407 408**Allowed From** 409 410Threads 411 412**Example** 413 414**See Also** 415 416<div style="page-break-after: always;"></div> 417 418## Azure IoT JSON Writer 419 420**nx_azure_iot_json_writer_init** 421*** 422<div style="text-align: right">Initializes an JSON writer</div> 423 424**Prototype** 425```c 426UINT nx_azure_iot_json_writer_init(NX_AZURE_IOT_JSON_WRITER *json_writer_ptr, 427 NX_PACKET *packet_ptr, UINT wait_option); 428``` 429**Description** 430 431<p>Initializes an #NX_AZURE_IOT_JSON_WRITER which writes JSON text into a NX_PACKET.</p> 432 433**Parameters** 434| Name | Description | 435| - |:-| 436| json_writer_ptr [out] | A pointer to an #NX_AZURE_IOT_JSON_WRITER the instance to initialize. | 437| packet_ptr [in] | A pointer to #NX_PACKET. | 438| wait_option [in] | Ticks to wait for allocating next packet | 439 440**Return Values** 441* NX_AZURE_IOT_SUCCESS Successfully initialized JSON writer. 442 443**Allowed From** 444 445Initialization, Threads 446 447**Example** 448 449**See Also** 450 451<div style="page-break-after: always;"></div> 452 453**nx_azure_iot_json_writer_with_buffer_init** 454*** 455<div style="text-align: right">Initializes an JSON writer</div> 456 457**Prototype** 458```c 459UINT nx_azure_iot_json_writer_with_buffer_init(NX_AZURE_IOT_JSON_WRITER *json_writer_ptr, 460 UCHAR *buffer_ptr, UINT buffer_len); 461``` 462**Description** 463 464<p>Initializes an #NX_AZURE_IOT_JSON_WRITER which writes JSON text into a buffer passed.</p> 465 466**Parameters** 467| Name | Description | 468| - |:-| 469| json_writer_ptr [out] | A pointer to an #NX_AZURE_IOT_JSON_WRITER the instance to initialize. | 470| buffer_ptr [in] | A buffer pointer to which JSON text will be written. | 471| buffer_len [in] | Length of buffer. | 472 473**Return Values** 474* NX_AZURE_IOT_SUCCESS Successfully initialized JSON writer. 475 476**Allowed From** 477 478Initialization, Threads 479 480**Example** 481 482**See Also** 483 484<div style="page-break-after: always;"></div> 485 486**nx_azure_iot_json_writer_deinit** 487*** 488<div style="text-align: right">De-initializes an JSON writer</div> 489 490**Prototype** 491```c 492UINT nx_azure_iot_json_writer_deinit(NX_AZURE_IOT_JSON_WRITER *json_writer_ptr); 493``` 494**Description** 495 496<p>Deinitializes an #NX_AZURE_IOT_JSON_WRITER.</p> 497 498**Parameters** 499| Name | Description | 500| - |:-| 501| json_writer_ptr [in] | A pointer to an #NX_AZURE_IOT_JSON_WRITER the instance to de-initialize. | 502 503**Return Values** 504* NX_AZURE_IOT_SUCCESS Successfully de-initialized JSON writer. 505 506**Allowed From** 507 508Initialization, Threads 509 510**Example** 511 512**See Also** 513 514<div style="page-break-after: always;"></div> 515 516**nx_azure_iot_json_writer_append_property_with_int32_value** 517*** 518<div style="text-align: right">Appends the UTF-8 property name and value where value is int32</div> 519 520**Prototype** 521```c 522UINT nx_azure_iot_json_writer_append_property_with_int32_value(NX_AZURE_IOT_JSON_WRITER *json_writer_ptr, 523 const UCHAR *property_name, UINT property_name_len, 524 int32_t value); 525``` 526**Description** 527 528<p>Appends the UTF-8 property name and value where value is int32.</p> 529 530**Parameters** 531| Name | Description | 532| - |:-| 533| json_writer_ptr [in] | A pointer to an #NX_AZURE_IOT_JSON_WRITER. | 534| property_name [in] | The UTF-8 encoded property name of the JSON value to be written. The name is escaped before writing | 535| property_name_len [in] | Length of property_name. | 536| value [in] | The value to be written as a JSON number. | 537 538**Return Values** 539* NX_AZURE_IOT_SUCCESS The property name and int32 value was appended successfully. 540 541**Allowed From** 542 543Initialization, Threads 544 545**Example** 546 547**See Also** 548 549<div style="page-break-after: always;"></div> 550 551**nx_azure_iot_json_writer_append_property_with_double_value** 552*** 553<div style="text-align: right">Appends the UTF-8 property name and value where value is double</div> 554 555**Prototype** 556```c 557UINT nx_azure_iot_json_writer_append_property_with_double_value(NX_AZURE_IOT_JSON_WRITER *json_writer_ptr, 558 const UCHAR *property_name, UINT property_name_len, 559 double value, UINT fractional_digits); 560``` 561**Description** 562 563<p>Appends the UTF-8 property name and value where value is double.</p> 564 565**Parameters** 566| Name | Description | 567| - |:-| 568| json_writer_ptr [in] | A pointer to an #NX_AZURE_IOT_JSON_WRITER. | 569| property_name [in] | The UTF-8 encoded property name of the JSON value to be written. The name is escaped before writing | 570| property_name_len [in] | Length of property_name. | 571| value [in] | The value to be written as a JSON number. | 572| fractional_digits [in] | The number of digits of the value to write after the decimal point and truncate the rest. | 573 574**Return Values** 575* NX_AZURE_IOT_SUCCESS The property name and double value was appended successfully. 576 577**Allowed From** 578 579Initialization, Threads 580 581**Example** 582 583**See Also** 584 585<div style="page-break-after: always;"></div> 586 587**nx_azure_iot_json_writer_append_property_with_bool_value** 588*** 589<div style="text-align: right">Appends the UTF-8 property name and value where value is boolean</div> 590 591**Prototype** 592```c 593UINT nx_azure_iot_json_writer_append_property_with_bool_value(NX_AZURE_IOT_JSON_WRITER *json_writer_ptr, 594 const UCHAR *property_name, UINT property_name_len, 595 UINT value); 596``` 597**Description** 598 599<p>Appends the UTF-8 property name and value where value is boolean.</p> 600 601**Parameters** 602| Name | Description | 603| - |:-| 604| json_writer_ptr [in] | A pointer to an #NX_AZURE_IOT_JSON_WRITER. | 605| property_name [in] | The UTF-8 encoded property name of the JSON value to be written. The name is escaped before writing | 606| property_name_len [in] | Length of property_name. | 607| value [in] | The value to be written as a JSON literal `true` or `false`. | 608 609**Return Values** 610* NX_AZURE_IOT_SUCCESS The property name and bool value was appended successfully. 611 612**Allowed From** 613 614Initialization, Threads 615 616**Example** 617 618**See Also** 619 620<div style="page-break-after: always;"></div> 621 622**nx_azure_iot_json_writer_append_property_with_string_value** 623*** 624<div style="text-align: right">Appends the UTF-8 property name and value where value is string</div> 625 626**Prototype** 627```c 628UINT nx_azure_iot_json_writer_append_property_with_string_value(NX_AZURE_IOT_JSON_WRITER *json_writer_ptr, 629 const UCHAR *property_name, UINT property_name_len, 630 const UCHAR *value, UINT value_len); 631``` 632**Description** 633 634<p>Appends the UTF-8 property name and value where value is string.</p> 635 636**Parameters** 637| Name | Description | 638| - |:-| 639| json_writer_ptr [in] | A pointer to an #NX_AZURE_IOT_JSON_WRITER. | 640| property_name [in] | The UTF-8 encoded property name of the JSON value to be written. The name is escaped before writing | 641| property_name_len [in] | Length of property_name. | 642| value [in] | The UTF-8 encoded property name of the JSON value to be written. The name is escaped before writing. | 643| value_len [in] | Length of value. | 644 645**Return Values** 646* NX_AZURE_IOT_SUCCESS The property name and string value was appended successfully. 647 648**Allowed From** 649 650Initialization, Threads 651 652**Example** 653 654**See Also** 655 656<div style="page-break-after: always;"></div> 657 658**nx_azure_iot_json_writer_get_bytes_used** 659*** 660<div style="text-align: right">Returns the length containing the JSON text written to the underlying buffer</div> 661 662**Prototype** 663```c 664UINT nx_azure_iot_json_writer_get_bytes_used(NX_AZURE_IOT_JSON_WRITER *json_writer_ptr); 665``` 666**Description** 667 668<p>Returns the length containing the JSON text written to the underlying buffer.</p> 669 670**Parameters** 671| Name | Description | 672| - |:-| 673| json_writer_ptr [in] | A pointer to an #NX_AZURE_IOT_JSON_WRITER. | 674 675**Return Values** 676* UINT Value containing the length of JSON text built so far. 677 678**Allowed From** 679 680Initialization, Threads 681 682**Example** 683 684**See Also** 685 686<div style="page-break-after: always;"></div> 687 688**nx_azure_iot_json_writer_append_string** 689*** 690<div style="text-align: right">Appends the UTF-8 text value (as a JSON string) into the buffer</div> 691 692**Prototype** 693```c 694UINT nx_azure_iot_json_writer_append_string(NX_AZURE_IOT_JSON_WRITER *json_writer_ptr, 695 const UCHAR *value, UINT value_len); 696``` 697**Description** 698 699<p>Appends the UTF-8 text value (as a JSON string) into the buffer.</p> 700 701**Parameters** 702| Name | Description | 703| - |:-| 704| json_writer_ptr [in] | A pointer to an #NX_AZURE_IOT_JSON_WRITER. | 705| value [in] | Pointer of UCHAR buffer that contains UTF-8 encoded value to be written as a JSON string The value is escaped before writing. | 706| value_len [in] | Length of value. | 707 708**Return Values** 709* NX_AZURE_IOT_SUCCESS The string value was appended successfully. 710 711**Allowed From** 712 713Initialization, Threads 714 715**Example** 716 717**See Also** 718 719<div style="page-break-after: always;"></div> 720 721**nx_azure_iot_json_writer_append_json_text** 722*** 723<div style="text-align: right">Appends an existing UTF-8 encoded JSON text into the buffer</div> 724 725**Prototype** 726```c 727UINT nx_azure_iot_json_writer_append_json_text(NX_AZURE_IOT_JSON_WRITER *json_writer_ptr, 728 const UCHAR *json, UINT json_len); 729``` 730**Description** 731 732<p>Appends an existing UTF-8 encoded JSON text into the buffer, useful for appending nested JSON.</p> 733 734**Parameters** 735| Name | Description | 736| - |:-| 737| json_writer_ptr [in] | A pointer to an #NX_AZURE_IOT_JSON_WRITER. | 738| json [in] | A pointer to single, possibly nested, valid, UTF-8 encoded, JSON value to be written as is, without any formatting or spacing changes. No modifications are made to this text, including escaping. | 739| json_len [in] | Length of json. | 740 741 742**Return Values** 743* NX_AZURE_IOT_SUCCESS The provided json_text was appended successfully. 744 745**Allowed From** 746 747Initialization, Threads 748 749**Example** 750 751**See Also** 752 753<div style="page-break-after: always;"></div> 754 755**nx_azure_iot_json_writer_append_property_name** 756*** 757<div style="text-align: right">Appends property name</div> 758 759**Prototype** 760```c 761UINT nx_azure_iot_json_writer_append_property_name(NX_AZURE_IOT_JSON_WRITER *json_writer_ptr, 762 const UCHAR *value, UINT value_len); 763``` 764**Description** 765 766<p>Appends the UTF-8 property name (as a JSON string) which is the first part of a name/value pair of a JSON object.</p> 767 768**Parameters** 769| Name | Description | 770| - |:-| 771| json_writer_ptr [in] | A pointer to an #NX_AZURE_IOT_JSON_WRITER. | 772| value [in] | The UTF-8 encoded property name of the JSON value to be written. The name is escaped before writing. | 773| value_len [in] | Length of property name. | 774 775**Return Values** 776* NX_AZURE_IOT_SUCCESS The property name was appended successfully. 777 778**Allowed From** 779 780Initialization, Threads 781 782**Example** 783 784**See Also** 785 786<div style="page-break-after: always;"></div> 787 788**nx_azure_iot_json_writer_append_bool** 789*** 790<div style="text-align: right">Appends a boolean value</div> 791 792**Prototype** 793```c 794UINT nx_azure_iot_json_writer_append_bool(NX_AZURE_IOT_JSON_WRITER *json_writer_ptr, UINT value); 795``` 796**Description** 797 798<p>Appends a boolean value (as a JSON literal `true` or `false`).</p> 799 800**Parameters** 801| Name | Description | 802| - |:-| 803| json_writer_ptr [in] | A pointer to an #NX_AZURE_IOT_JSON_WRITER. | 804| value [in] | The value to be written as a JSON literal `true` or `false`. | 805 806**Return Values** 807* NX_AZURE_IOT_SUCCESS The bool was appended successfully. 808 809**Allowed From** 810 811Initialization, Threads 812 813**Example** 814 815**See Also** 816 817<div style="page-break-after: always;"></div> 818 819**nx_azure_iot_json_writer_append_int32** 820*** 821<div style="text-align: right">Appends a number value.</div> 822 823**Prototype** 824```c 825UINT nx_azure_iot_json_writer_append_int32(NX_AZURE_IOT_JSON_WRITER *json_writer_ptr, int32_t value); 826``` 827**Description** 828 829<p>Appends an `int32_t` number value.</p> 830 831**Parameters** 832| Name | Description | 833| - |:-| 834| json_writer_ptr [in] | A pointer to an #NX_AZURE_IOT_JSON_WRITER. | 835| value [in] | The value to be written as a JSON number. | 836 837**Return Values** 838* NX_AZURE_IOT_SUCCESS The number was appended successfully. 839 840**Allowed From** 841 842Initialization, Threads 843 844**Example** 845 846**See Also** 847 848<div style="page-break-after: always;"></div> 849 850**nx_azure_iot_json_writer_append_double** 851*** 852<div style="text-align: right">Appends a number value.</div> 853 854**Prototype** 855```c 856UINT nx_azure_iot_json_writer_append_double(NX_AZURE_IOT_JSON_WRITER *json_writer_ptr, 857 double value, int32_t fractional_digits); 858``` 859**Description** 860 861<p>Appends a `double` number value.</p> 862 863**Parameters** 864| Name | Description | 865| - |:-| 866| json_writer_ptr [in] | A pointer to an #NX_AZURE_IOT_JSON_WRITER. | 867| value [in] | The value to be written as a JSON number. | 868| fractional_digits [in] | The number of digits of the value to write after the decimal point and truncate the rest. | 869 870**Return Values** 871* NX_AZURE_IOT_SUCCESS The number was appended successfully. 872 873**Allowed From** 874 875Initialization, Threads 876 877**Example** 878 879**See Also** 880 881<div style="page-break-after: always;"></div> 882 883**nx_azure_iot_json_writer_append_null** 884*** 885<div style="text-align: right">Appends the JSON literal `null`</div> 886 887**Prototype** 888```c 889UINT nx_azure_iot_json_writer_append_null(NX_AZURE_IOT_JSON_WRITER *json_writer_ptr); 890``` 891**Description** 892 893<p>Appends the JSON literal `null`.</p> 894 895**Parameters** 896| Name | Description | 897| - |:-| 898| json_writer_ptr [in] | A pointer to an #NX_AZURE_IOT_JSON_WRITER. | 899 900**Return Values** 901* NX_AZURE_IOT_SUCCESS `null` was appended successfully. 902 903**Allowed From** 904 905Initialization, Threads 906 907**Example** 908 909**See Also** 910 911<div style="page-break-after: always;"></div> 912 913**nx_azure_iot_json_writer_append_begin_object** 914*** 915<div style="text-align: right">Appends the beginning of a JSON object</div> 916 917**Prototype** 918```c 919UINT nx_azure_iot_json_writer_append_begin_object(NX_AZURE_IOT_JSON_WRITER *json_writer_ptr); 920``` 921**Description** 922 923<p>Appends the beginning of a JSON object (i.e. `{`).</p> 924 925**Parameters** 926| Name | Description | 927| - |:-| 928| json_writer_ptr [in] | A pointer to an #NX_AZURE_IOT_JSON_WRITER. | 929 930**Return Values** 931* NX_AZURE_IOT_SUCCESS Object start was appended successfully. 932 933**Allowed From** 934 935Initialization, Threads 936 937**Example** 938 939**See Also** 940 941<div style="page-break-after: always;"></div> 942 943**nx_azure_iot_json_writer_append_begin_array** 944*** 945<div style="text-align: right">Appends the beginning of a JSON array</div> 946 947**Prototype** 948```c 949UINT nx_azure_iot_json_writer_append_begin_array(NX_AZURE_IOT_JSON_WRITER *json_writer_ptr); 950``` 951**Description** 952 953<p>Appends the beginning of a JSON array (i.e. `[`).</p> 954 955**Parameters** 956| Name | Description | 957| - |:-| 958| json_writer_ptr [in] | A pointer to an #NX_AZURE_IOT_JSON_WRITER. | 959 960**Return Values** 961* NX_AZURE_IOT_SUCCESS Array start was appended successfully. 962 963**Allowed From** 964 965Initialization, Threads 966 967**Example** 968 969**See Also** 970 971<div style="page-break-after: always;"></div> 972 973**nx_azure_iot_json_writer_append_end_object** 974*** 975<div style="text-align: right">Appends the end of the current JSON object</div> 976 977**Prototype** 978```c 979UINT nx_azure_iot_json_writer_append_end_object(NX_AZURE_IOT_JSON_WRITER *json_writer_ptr); 980``` 981**Description** 982 983<p>Appends the end of the current JSON object (i.e. `}`).</p> 984 985**Parameters** 986| Name | Description | 987| - |:-| 988| json_writer_ptr [in] | A pointer to an #NX_AZURE_IOT_JSON_WRITER. | 989 990**Return Values** 991* NX_AZURE_IOT_SUCCESS Object end was appended successfully. 992 993**Allowed From** 994 995Initialization, Threads 996 997**Example** 998 999**See Also** 1000 1001<div style="page-break-after: always;"></div> 1002 1003**nx_azure_iot_json_writer_append_end_array** 1004*** 1005<div style="text-align: right">Appends the end of the current JSON array</div> 1006 1007**Prototype** 1008```c 1009UINT nx_azure_iot_json_writer_append_end_array(NX_AZURE_IOT_JSON_WRITER *json_writer_ptr); 1010``` 1011**Description** 1012 1013<p>Appends the end of the current JSON array (i.e. `]`).</p> 1014 1015**Parameters** 1016| Name | Description | 1017| - |:-| 1018| json_writer_ptr [in] | A pointer to an #NX_AZURE_IOT_JSON_WRITER. | 1019 1020**Return Values** 1021* NX_AZURE_IOT_SUCCESS Array end was appended successfully. 1022 1023**Allowed From** 1024 1025Initialization, Threads 1026 1027**Example** 1028 1029**See Also** 1030 1031<div style="page-break-after: always;"></div> 1032