本文整理汇总了C++中Osal_MemSet函数的典型用法代码示例。如果您正苦于以下问题:C++ Osal_MemSet函数的具体用法?C++ Osal_MemSet怎么用?C++ Osal_MemSet使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Osal_MemSet函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: aci_l2cap_connection_parameter_update_response
tBleStatus aci_l2cap_connection_parameter_update_response(uint16_t conn_handle, uint16_t interval_min,
uint16_t interval_max, uint16_t slave_latency,
uint16_t timeout_multiplier, uint8_t id, uint8_t accept)
{
struct hci_request rq;
uint8_t status;
l2cap_conn_param_update_resp_cp cp;
cp.conn_handle = htobs(conn_handle);
cp.interval_min = htobs(interval_min);
cp.interval_max = htobs(interval_max);
cp.slave_latency = htobs(slave_latency);
cp.timeout_multiplier = htobs(timeout_multiplier);
cp.id = id;
cp.accept = accept;
Osal_MemSet(&rq, 0, sizeof(rq));
rq.ogf = OGF_VENDOR_CMD;
rq.ocf = OCF_L2CAP_CONN_PARAM_UPDATE_REQ;
rq.cparam = &cp;
rq.clen = L2CAP_CONN_PARAM_UPDATE_REQ_CP_SIZE;
rq.event = EVT_CMD_STATUS;
rq.rparam = &status;
rq.rlen = 1;
if (hci_send_req(&rq) < 0)
return BLE_STATUS_TIMEOUT;
return status;
}
示例2: aci_hal_set_tx_power_level
tBleStatus aci_hal_set_tx_power_level(uint8_t en_high_power, uint8_t pa_level)
{
struct hci_request rq;
hal_set_tx_power_level_cp cp;
uint8_t status;
cp.en_high_power = en_high_power;
cp.pa_level = pa_level;
Osal_MemSet(&rq, 0, sizeof(rq));
rq.ogf = OGF_VENDOR_CMD;
rq.ocf = OCF_HAL_SET_TX_POWER_LEVEL;
rq.cparam = &cp;
rq.clen = HAL_SET_TX_POWER_LEVEL_CP_SIZE;
rq.rparam = &status;
rq.rlen = 1;
if (hci_send_req(&rq, FALSE) < 0)
return BLE_STATUS_TIMEOUT;
if (status) {
return status;
}
return 0;
}
示例3: aci_gatt_signed_write_without_resp
tBleStatus aci_gatt_signed_write_without_resp(uint16_t conn_handle, uint16_t attr_handle,
uint8_t val_len, uint8_t* attr_val)
{
struct hci_request rq;
uint8_t status;
gatt_signed_write_without_resp_cp cp;
if(val_len > sizeof(cp.attr_val))
return BLE_STATUS_INVALID_PARAMS;
cp.conn_handle = htobs(conn_handle);
cp.attr_handle = htobs(attr_handle);
cp.val_len = val_len;
Osal_MemCpy(cp.attr_val, attr_val, val_len);
Osal_MemSet(&rq, 0, sizeof(rq));
rq.ogf = OGF_VENDOR_CMD;
rq.ocf = OCF_GATT_SIGNED_WRITE_WITHOUT_RESPONSE;
rq.cparam = &cp;
rq.clen = GATT_SIGNED_WRITE_WITHOUT_RESPONSE_CP_SIZE + val_len;
rq.rparam = &status;
rq.rlen = 1;
if (hci_send_req(&rq, FALSE) < 0)
return BLE_STATUS_TIMEOUT;
return status;
}
示例4: aci_gatt_read_handle_value_offset_IDB05A1
tBleStatus aci_gatt_read_handle_value_offset_IDB05A1(uint16_t attr_handle, uint8_t offset, uint16_t data_len, uint16_t *data_len_out_p, uint8_t *data)
{
struct hci_request rq;
gatt_read_handle_val_offset_cp cp;
gatt_read_handle_val_offset_rp rp;
if(data_len > sizeof(rp.value))
return BLE_STATUS_INVALID_PARAMS;
cp.attr_handle = htobs(attr_handle);
cp.offset = offset;
Osal_MemSet(&rq, 0, sizeof(rq));
rq.ogf = OGF_VENDOR_CMD;
rq.ocf = OCF_GATT_READ_HANDLE_VALUE_OFFSET;
rq.cparam = &cp;
rq.clen = sizeof(cp);
rq.rparam = &rp;
rq.rlen = sizeof(rp);
if (hci_send_req(&rq, FALSE) < 0)
return BLE_STATUS_TIMEOUT;
if(rp.status)
return rp.status;
*data_len_out_p = rp.value_len;
Osal_MemCpy(data, rp.value, MIN(data_len, *data_len_out_p));
return 0;
}
示例5: aci_gap_start_connection_update
tBleStatus aci_gap_start_connection_update(uint16_t conn_handle, uint16_t conn_min_interval,
uint16_t conn_max_interval, uint16_t conn_latency,
uint16_t supervision_timeout, uint16_t min_conn_length,
uint16_t max_conn_length)
{
struct hci_request rq;
gap_start_connection_update_cp cp;
uint8_t status;
cp.conn_handle = htobs(conn_handle);
cp.conn_min_interval = htobs(conn_min_interval);
cp.conn_max_interval = htobs(conn_max_interval);
cp.conn_latency = htobs(conn_latency);
cp.supervision_timeout = htobs(supervision_timeout);
cp.min_conn_length = htobs(min_conn_length);
cp.max_conn_length = htobs(max_conn_length);
Osal_MemSet(&rq, 0, sizeof(rq));
rq.ogf = OGF_VENDOR_CMD;
rq.ocf = OCF_GAP_START_CONNECTION_UPDATE;
rq.cparam = &cp;
rq.clen = sizeof(cp);
rq.event = EVT_CMD_STATUS;
rq.rparam = &status;
rq.rlen = 1;
if (hci_send_req(&rq, FALSE) < 0)
return BLE_STATUS_TIMEOUT;
return status;
}
示例6: aci_gatt_write_long_charac_val
tBleStatus aci_gatt_write_long_charac_val(uint16_t conn_handle, uint16_t attr_handle,
uint16_t val_offset, uint8_t val_len, const uint8_t* attr_val)
{
struct hci_request rq;
uint8_t status;
gatt_write_long_charac_val_cp cp;
if(val_len > sizeof(cp.attr_val))
return BLE_STATUS_INVALID_PARAMS;
cp.conn_handle = htobs(conn_handle);
cp.attr_handle = htobs(attr_handle);
cp.val_offset = htobs(val_offset);
cp.val_len = val_len;
Osal_MemCpy(cp.attr_val, attr_val, val_len);
Osal_MemSet(&rq, 0, sizeof(rq));
rq.ogf = OGF_VENDOR_CMD;
rq.ocf = OCF_GATT_WRITE_LONG_CHARAC_VAL;
rq.cparam = &cp;
rq.clen = GATT_WRITE_LONG_CHARAC_VAL_CP_SIZE + val_len;
rq.event = EVT_CMD_STATUS;
rq.rparam = &status;
rq.rlen = 1;
if (hci_send_req(&rq, FALSE) < 0)
return BLE_STATUS_TIMEOUT;
return status;
}
示例7: aci_gap_update_adv_data
tBleStatus aci_gap_update_adv_data(uint8_t AdvLen, const uint8_t *AdvData)
{
struct hci_request rq;
uint8_t status;
uint8_t buffer[32];
uint8_t indx = 0;
if (AdvLen > (sizeof(buffer)-1))
return BLE_STATUS_INVALID_PARAMS;
buffer[indx] = AdvLen;
indx++;
Osal_MemCpy(buffer + indx, AdvData, AdvLen);
indx += AdvLen;
Osal_MemSet(&rq, 0, sizeof(rq));
rq.ogf = OGF_VENDOR_CMD;
rq.ocf = OCF_GAP_UPDATE_ADV_DATA;
rq.cparam = (void *)buffer;
rq.clen = indx;
rq.rparam = &status;
rq.rlen = 1;
if (hci_send_req(&rq, FALSE) < 0)
return BLE_STATUS_TIMEOUT;
return status;
}
示例8: aci_gap_start_general_conn_establish_proc
tBleStatus aci_gap_start_general_conn_establish_proc(uint8_t scan_type, uint16_t scan_interval, uint16_t scan_window,
uint8_t own_address_type, uint8_t filter_duplicates, uint8_t use_reconn_addr, const tBDAddr reconn_addr)
{
struct hci_request rq;
gap_start_general_conn_establish_proc_cp cp;
uint8_t status;
cp.scan_type = scan_type;
cp.scan_interval = htobs(scan_interval);
cp.scan_window = htobs(scan_window);
cp.own_address_type = own_address_type;
cp.filter_duplicates = filter_duplicates;
cp.use_reconn_addr = use_reconn_addr;
Osal_MemCpy(cp.reconn_addr, reconn_addr, 6);
Osal_MemSet(&rq, 0, sizeof(rq));
rq.ogf = OGF_VENDOR_CMD;
rq.ocf = OCF_GAP_START_GENERAL_CONN_ESTABLISH_PROC;
rq.cparam = &cp;
rq.clen = sizeof(cp);
rq.event = EVT_CMD_STATUS;
rq.rparam = &status;
rq.rlen = 1;
if (hci_send_req(&rq, FALSE) < 0)
return BLE_STATUS_TIMEOUT;
return status;
}
示例9: aci_gatt_disc_all_charac_of_serv
tBleStatus aci_gatt_disc_all_charac_of_serv(uint16_t conn_handle, uint16_t start_attr_handle,
uint16_t end_attr_handle)
{
struct hci_request rq;
uint8_t status;
gatt_disc_all_charac_of_serv_cp cp;
cp.conn_handle = htobs(conn_handle);
cp.start_attr_handle = htobs(start_attr_handle);
cp.end_attr_handle = htobs(end_attr_handle);
Osal_MemSet(&rq, 0, sizeof(rq));
rq.ogf = OGF_VENDOR_CMD;
rq.ocf = OCF_GATT_DISC_ALL_CHARAC_OF_SERV;
rq.cparam = &cp;
rq.clen = GATT_DISC_ALL_CHARAC_OF_SERV_CP_SIZE;
rq.event = EVT_CMD_STATUS;
rq.rparam = &status;
rq.rlen = 1;
if (hci_send_req(&rq, FALSE) < 0)
return BLE_STATUS_TIMEOUT;
return status;
}
示例10: aci_gap_set_non_connectable
tBleStatus aci_gap_set_non_connectable(uint8_t adv_type)
#endif
{
struct hci_request rq;
gap_set_non_connectable_cp cp;
uint8_t status;
cp.advertising_event_type = adv_type;
#if BLUENRG_MS
cp.own_address_type = own_address_type;
#endif
Osal_MemSet(&rq, 0, sizeof(rq));
rq.ogf = OGF_VENDOR_CMD;
rq.ocf = OCF_GAP_SET_NON_CONNECTABLE;
rq.cparam = &cp;
rq.clen = sizeof(cp);
rq.rparam = &status;
rq.rlen = 1;
if (hci_send_req(&rq, FALSE) < 0)
return BLE_STATUS_TIMEOUT;
return status;
}
示例11: aci_gatt_disc_prim_service_by_uuid
tBleStatus aci_gatt_disc_prim_service_by_uuid(uint16_t conn_handle, uint8_t uuid_type, uint8_t* uuid)
{
struct hci_request rq;
uint8_t status;
gatt_disc_prim_service_by_uuid_cp cp;
uint8_t uuid_len;
if(uuid_type == UUID_TYPE_16){
uuid_len = 2;
}
else{
uuid_len = 16;
}
cp.conn_handle = htobs(conn_handle);
cp.uuid_type = uuid_type;
Osal_MemCpy(cp.uuid, uuid, uuid_len);
Osal_MemSet(&rq, 0, sizeof(rq));
rq.ogf = OGF_VENDOR_CMD;
rq.ocf = OCF_GATT_DISC_PRIM_SERVICE_BY_UUID;
rq.cparam = &cp;
rq.clen = GATT_DISC_PRIM_SERVICE_BY_UUID_CP_SIZE + uuid_len;
rq.event = EVT_CMD_STATUS;
rq.rparam = &status;
rq.rlen = 1;
if (hci_send_req(&rq, FALSE) < 0)
return BLE_STATUS_TIMEOUT;
return status;
}
示例12: aci_gatt_find_included_services
tBleStatus aci_gatt_find_included_services(uint16_t conn_handle, uint16_t start_service_handle,
uint16_t end_service_handle)
{
struct hci_request rq;
uint8_t status;
gatt_find_included_services_cp cp;
cp.conn_handle = htobs(conn_handle);
cp.start_handle = htobs(start_service_handle);
cp.end_handle = htobs(end_service_handle);
Osal_MemSet(&rq, 0, sizeof(rq));
rq.ogf = OGF_VENDOR_CMD;
rq.ocf = OCF_GATT_FIND_INCLUDED_SERVICES;
rq.cparam = &cp;
rq.clen = GATT_FIND_INCLUDED_SERVICES_CP_SIZE;
rq.event = EVT_CMD_STATUS;
rq.rparam = &status;
rq.rlen = 1;
if (hci_send_req(&rq, FALSE) < 0)
return BLE_STATUS_TIMEOUT;
return status;
}
示例13: aci_att_prepare_write_req
tBleStatus aci_att_prepare_write_req(uint16_t conn_handle, uint16_t attr_handle, uint16_t value_offset,
uint8_t attr_val_len, uint8_t* attr_val)
{
struct hci_request rq;
uint8_t status;
att_prepare_write_req_cp cp;
if(attr_val_len > sizeof(cp.attr_val))
return BLE_STATUS_INVALID_PARAMS;
cp.conn_handle = htobs(conn_handle);
cp.attr_handle = htobs(attr_handle);
cp.value_offset = htobs(value_offset);
cp.attr_val_len = attr_val_len;
Osal_MemCpy(cp.attr_val, attr_val, attr_val_len);
Osal_MemSet(&rq, 0, sizeof(rq));
rq.ogf = OGF_VENDOR_CMD;
rq.ocf = OCF_ATT_PREPARE_WRITE_REQ;
rq.cparam = &cp;
rq.clen = ATT_PREPARE_WRITE_REQ_CP_SIZE + attr_val_len;
rq.rparam = &status;
rq.rlen = 1;
if (hci_send_req(&rq, FALSE) < 0)
return BLE_STATUS_TIMEOUT;
return status;
}
示例14: aci_att_read_by_group_type_req
tBleStatus aci_att_read_by_group_type_req(uint16_t conn_handle, uint16_t start_handle, uint16_t end_handle,
uint8_t uuid_type, uint8_t* uuid)
{
struct hci_request rq;
uint8_t status;
att_read_by_group_type_req_cp cp;
uint8_t uuid_len;
if(uuid_type == UUID_TYPE_16){
uuid_len = 2;
}
else{
uuid_len = 16;
}
cp.conn_handle = htobs(conn_handle);
cp.start_handle = htobs(start_handle);
cp.end_handle = htobs(end_handle);
cp.uuid_type = uuid_type;
Osal_MemCpy(cp.uuid, uuid, uuid_len);
Osal_MemSet(&rq, 0, sizeof(rq));
rq.ogf = OGF_VENDOR_CMD;
rq.ocf = OCF_ATT_READ_BY_GROUP_TYPE_REQ;
rq.cparam = &cp;
rq.clen = ATT_READ_BY_GROUP_TYPE_REQ_CP_SIZE + uuid_len;
rq.rparam = &status;
rq.rlen = 1;
if (hci_send_req(&rq, FALSE) < 0)
return BLE_STATUS_TIMEOUT;
return status;
}
示例15: aci_att_find_by_type_value_req
tBleStatus aci_att_find_by_type_value_req(uint16_t conn_handle, uint16_t start_handle, uint16_t end_handle,
uint8_t* uuid, uint8_t attr_val_len, uint8_t* attr_val)
{
struct hci_request rq;
uint8_t status;
att_find_by_type_value_req_cp cp;
if(attr_val_len > sizeof(cp.attr_val))
return BLE_STATUS_INVALID_PARAMS;
cp.conn_handle = htobs(conn_handle);
cp.start_handle = htobs(start_handle);
cp.end_handle = htobs(end_handle);
Osal_MemCpy(cp.uuid, uuid, 2);
cp.attr_val_len = attr_val_len;
Osal_MemCpy(cp.attr_val, attr_val, attr_val_len);
Osal_MemSet(&rq, 0, sizeof(rq));
rq.ogf = OGF_VENDOR_CMD;
rq.ocf = OCF_ATT_FIND_BY_TYPE_VALUE_REQ;
rq.cparam = &cp;
rq.clen = ATT_FIND_BY_TYPE_VALUE_REQ_CP_SIZE + attr_val_len;
rq.rparam = &status;
rq.rlen = 1;
if (hci_send_req(&rq, FALSE) < 0)
return BLE_STATUS_TIMEOUT;
return status;
}