rem: apdu[3] = SERVICE_CONFIRMED_WRITE_PROPERTY;
add: apdu[3] = SERVICE_CONFIRMED_ATOMIC_WRITE_FILE;
context: int awf_encode_apdu(  uint8_t *apdu,   uint8_t invoke_id,  BACNET_WRITE_PROPERTY_DATA *data){  int apdu_len = 0; // total length of the apdu, return value  if (apdu)  {    apdu[0] = PDU_TYPE_CONFIRMED_SERVICE_REQUEST;    apdu[1] = encode_max_segs_max_apdu(0, Device_Max_APDU_Length_Accepted());    apdu[2] = invoke_id;     apdu[3] = SERVICE_CONFIRMED_WRITE_PROPERTY;     // service choice    apdu_len = 4;    apdu_len += encode_context_object_id(&apdu[apdu_len], 0,      data->object_type, data->object_instance);    apdu_len += encode_context_enumerated(&apdu[apdu_len], 1,      data->access);    apdu_len += encode_opening_tag(&apdu[apdu_len], 2);    switch (data->access)    {      case FILE_RECORD_ACCESS:        apdu_len += encode_tagged_signed(&apdu[apdu_len],          data->fileStartRecord);        apdu_len += encode_tagged_unsigned(&apdu[apdu_len],          data->returnedRecordCount);        apdu_len += encode_tagged_octet_string(&apdu[apdu_len],          data->fileData, data->fileDataLength);        break;      case FILE_STREAM_ACCESS:      default:        apdu_len += encode_tagged_signed(&apdu[apdu_len],          data->fileStartPosition);        apdu_len += encode_tagged_octet_string(&apdu[apdu_len],          data->fileData, data->fileDataLength);        break;    }    apdu_len += encode_closing_tag(&apdu[apdu_len], 2);  }    return apdu_len;}