1 /* 2 * Copyright (C) 2021 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef SMP_CMD_H 17 #define SMP_CMD_H 18 19 #include <stdint.h> 20 21 #include "btstack.h" 22 #include "packet.h" 23 #include "smp.h" 24 25 #ifdef __cplusplus 26 extern "C" { 27 #endif 28 29 typedef void (*SMP_SendDataCb)(uint16_t aclHandle, int result); 30 31 int SMP_SendPairingRequest(uint16_t handle, const SMP_PairParam *pairReqParam, SMP_SendDataCb cb); 32 int SMP_SendPairingResponse(uint16_t handle, const SMP_PairParam *pairRspParam, SMP_SendDataCb cb); 33 int SMP_SendPairingConfirm(uint16_t handle, const uint8_t *confirm, SMP_SendDataCb cb); 34 int SMP_SendPairingRandom(uint16_t handle, const uint8_t *random, SMP_SendDataCb cb); 35 int SMP_SendPairingFailed(uint16_t handle, uint8_t reason, SMP_SendDataCb cb); 36 int SMP_SendPairingPublicKey(uint16_t handle, const uint8_t *publicKey, SMP_SendDataCb cb); 37 int SMP_SendPairingDHKeyCheck(uint16_t handle, const uint8_t *dhKeyCheck, SMP_SendDataCb cb); 38 int SMP_SendEncryptionInformation(uint16_t handle, const uint8_t *ltk, SMP_SendDataCb cb); 39 int SMP_SendMasterIdentification(uint16_t handle, uint16_t ediv, const uint8_t *rand, SMP_SendDataCb cb); 40 int SMP_SendIdentityInformation(uint16_t handle, const uint8_t *irk, SMP_SendDataCb cb); 41 int SMP_SendIdentityAddressInformation(uint16_t handle, const BtAddr *addr, SMP_SendDataCb cb); 42 int SMP_SendSigningInformation(uint16_t handle, const uint8_t *csrk, SMP_SendDataCb cb); 43 int SMP_SendSecurityRequest(uint16_t handle, uint8_t authReq, SMP_SendDataCb cb); 44 45 #ifdef __cplusplus 46 } 47 #endif 48 49 #endif