diff options
498 files changed, 10312 insertions, 22695 deletions
diff --git a/OWNERS_chromeos b/OWNERS_chromeos index 0280ec47df..075a04e5e3 100644 --- a/OWNERS_chromeos +++ b/OWNERS_chromeos @@ -1,6 +1,5 @@ # Project owners abhishekpandit@google.com -sonnysasaka@google.com # Audio enshuo@google.com @@ -12,3 +11,12 @@ whalechang@google.com michaelfsun@google.com laikatherine@google.com yinghsu@google.com +apusaka@google.com +deanliao@google.com +chharry@google.com +melhuishj@google.com +johnlai@google.com +mmandlik@google.com +sarveshkalwit@google.com +howardchung@google.com +jiangzp@google.com diff --git a/android/app/Android.bp b/android/app/Android.bp index b66f1a74a8..d29294636f 100644 --- a/android/app/Android.bp +++ b/android/app/Android.bp @@ -323,6 +323,7 @@ android_app { enabled: true, javacflags: [ "-Xep:AlmostJavadoc:ERROR", + "-Xep:AlreadyChecked:ERROR", "-Xep:AndroidFrameworkBinderIdentity:ERROR", "-Xep:AndroidFrameworkEfficientStrings:ERROR", "-Xep:AndroidFrameworkRequiresPermission:ERROR", @@ -330,25 +331,43 @@ android_app { "-Xep:ClassCanBeStatic:ERROR", "-Xep:DateFormatConstant:ERROR", "-Xep:EmptyBlockTag:ERROR", + "-Xep:EqualsGetClass:ERROR", + "-Xep:FallThrough:ERROR", "-Xep:HidingField:ERROR", "-Xep:InlineMeInliner:ERROR", "-Xep:InvalidBlockTag:ERROR", "-Xep:InvalidParam:ERROR", + "-Xep:LoopOverCharArray:ERROR", "-Xep:MissingCasesInEnumSwitch:ERROR", "-Xep:MockNotUsedInProduction:ERROR", "-Xep:ModifyCollectionInEnhancedForLoop:ERROR", + "-Xep:NarrowCalculation:ERROR", "-Xep:NonApiType:ERROR", + "-Xep:NonAtomicVolatileUpdate:ERROR", "-Xep:NonCanonicalType:ERROR", "-Xep:NotJavadoc:ERROR", + "-Xep:ObjectEqualsForPrimitives:ERROR", + "-Xep:OperatorPrecedence:ERROR", + "-Xep:ReferenceEquality:ERROR", "-Xep:ReturnAtTheEndOfVoidFunction:ERROR", "-Xep:StringCaseLocaleUsage:ERROR", "-Xep:StringCharset:ERROR", + "-Xep:ToStringReturnsNull:ERROR", "-Xep:UnnecessaryStringBuilder:ERROR", + "-Xep:UnrecognisedJavadocTag:ERROR", "-Xep:UnusedMethod:ERROR", "-Xep:UnusedNestedClass:ERROR", "-Xep:UnusedVariable:ERROR", "-Xep:WaitNotInLoop:ERROR", - "-XepExcludedPaths:.*/srcjars/.*", // Exclude generated files + + // After fixing this errorprone, we decided to not merge the change. + // It is not very readable and the benefits are minimal when looking + // at the size of the maps used in the Bluetooth application. + // See https://r.android.com/3200511 + "-Xep:AndroidFrameworkEfficientCollections:OFF", + + // Exclude generated files + "-XepExcludedPaths:.*/srcjars/.*", ], }, min_sdk_version: "Tiramisu", diff --git a/android/app/OWNERS b/android/app/OWNERS index 03331fb492..5fc9a5e30f 100644 --- a/android/app/OWNERS +++ b/android/app/OWNERS @@ -3,6 +3,7 @@ cmanton@google.com eruffieux@google.com hallstrom@google.com +henrichataing@google.com jpawlowski@google.com mylesgw@google.com okamil@google.com diff --git a/android/app/aidl/android/bluetooth/IBluetooth.aidl b/android/app/aidl/android/bluetooth/IBluetooth.aidl index d05152e5c4..c950d1dbbe 100644 --- a/android/app/aidl/android/bluetooth/IBluetooth.aidl +++ b/android/app/aidl/android/bluetooth/IBluetooth.aidl @@ -46,6 +46,7 @@ import android.os.ResultReceiver; */ interface IBluetooth { + // TODO: b/357645528 - delete aidl method @JavaPassthrough(annotation="@android.annotation.RequiresNoPermission") int getState(); @@ -121,7 +122,7 @@ interface IBluetooth int getRemoteClass(in BluetoothDevice device, in AttributionSource attributionSource); @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)") List<ParcelUuid> getRemoteUuids(in BluetoothDevice device, in AttributionSource attributionSource); - @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})") + @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED}, conditional=true)") boolean fetchRemoteUuids(in BluetoothDevice device, in int transport, in AttributionSource attributionSource); @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)") boolean sdpSearch(in BluetoothDevice device, in ParcelUuid uuid, in AttributionSource attributionSource); @@ -280,6 +281,8 @@ interface IBluetooth @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})") Bundle getPreferredAudioProfiles(in BluetoothDevice device, in AttributionSource source); @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})") + int isDualModeAudioEnabled(in AttributionSource attributionSource); + @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})") int registerPreferredAudioProfilesChangedCallback(in IBluetoothPreferredAudioProfilesCallback callback, in AttributionSource attributionSource); @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})") int unregisterPreferredAudioProfilesChangedCallback(in IBluetoothPreferredAudioProfilesCallback callback, in AttributionSource attributionSource); diff --git a/android/app/aidl/android/bluetooth/IBluetoothGatt.aidl b/android/app/aidl/android/bluetooth/IBluetoothGatt.aidl index 5d41e27bfc..e09f6e9d03 100644 --- a/android/app/aidl/android/bluetooth/IBluetoothGatt.aidl +++ b/android/app/aidl/android/bluetooth/IBluetoothGatt.aidl @@ -174,7 +174,7 @@ interface IBluetoothGatt { in boolean confirm, in byte[] value, in AttributionSource attributionSource); @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)") void disconnectAll(in AttributionSource attributionSource); - @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)") + @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_SCAN)") int numHwTrackFiltersAvailable(in AttributionSource attributionSource); @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)") void leSubrateRequest(in int clientIf, in String address, in int subrateMin, in int subrateMax, in int maxLatency, diff --git a/android/app/aidl/android/bluetooth/IBluetoothHeadsetClient.aidl b/android/app/aidl/android/bluetooth/IBluetoothHeadsetClient.aidl index eef7d80e6c..59c5f98bfb 100644 --- a/android/app/aidl/android/bluetooth/IBluetoothHeadsetClient.aidl +++ b/android/app/aidl/android/bluetooth/IBluetoothHeadsetClient.aidl @@ -33,15 +33,15 @@ interface IBluetoothHeadsetClient { @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)") boolean disconnect(in BluetoothDevice device, in AttributionSource attributionSource); - @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)") + @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})") List<BluetoothDevice> getConnectedDevices(in AttributionSource attributionSource); - @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)") + @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})") List<BluetoothDevice> getDevicesMatchingConnectionStates(in int[] states, in AttributionSource attributionSource); - @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)") + @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})") int getConnectionState(in BluetoothDevice device, in AttributionSource attributionSource); - @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)") + @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})") boolean setConnectionPolicy(in BluetoothDevice device, int connectionPolicy, in AttributionSource attributionSource); - @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)") + @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})") int getConnectionPolicy(in BluetoothDevice device, in AttributionSource attributionSource); @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)") @@ -51,7 +51,7 @@ interface IBluetoothHeadsetClient { @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)") List<BluetoothHeadsetClientCall> getCurrentCalls(in BluetoothDevice device, in AttributionSource attributionSource); - @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)") + @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})") Bundle getCurrentAgEvents(in BluetoothDevice device, in AttributionSource attributionSource); @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)") diff --git a/android/app/aidl/android/bluetooth/IBluetoothLeAudio.aidl b/android/app/aidl/android/bluetooth/IBluetoothLeAudio.aidl index 7e9d96ceb9..f026d2c1a0 100644 --- a/android/app/aidl/android/bluetooth/IBluetoothLeAudio.aidl +++ b/android/app/aidl/android/bluetooth/IBluetoothLeAudio.aidl @@ -60,9 +60,9 @@ interface IBluetoothLeAudio { @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})") void setCodecConfigPreference(in int groupId, in BluetoothLeAudioCodecConfig inputCodecConfig, in BluetoothLeAudioCodecConfig outputCodecConfig, in AttributionSource source); @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})") - void registerCallback(in IBluetoothLeAudioCallback callback, in AttributionSource attributionSource); + oneway void registerCallback(in IBluetoothLeAudioCallback callback, in AttributionSource attributionSource); @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})") - void unregisterCallback(in IBluetoothLeAudioCallback callback, in AttributionSource attributionSource); + oneway void unregisterCallback(in IBluetoothLeAudioCallback callback, in AttributionSource attributionSource); @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})") void setCcidInformation(in ParcelUuid userUuid, in int ccid, in int contextType, in AttributionSource attributionSource); @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})") diff --git a/android/app/aidl/android/bluetooth/IBluetoothMapClient.aidl b/android/app/aidl/android/bluetooth/IBluetoothMapClient.aidl index 66a25941cd..a06a7fc0dc 100644 --- a/android/app/aidl/android/bluetooth/IBluetoothMapClient.aidl +++ b/android/app/aidl/android/bluetooth/IBluetoothMapClient.aidl @@ -31,16 +31,17 @@ interface IBluetoothMapClient { boolean connect(in BluetoothDevice device, in AttributionSource attributionSource); @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf = { android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED })") boolean disconnect(in BluetoothDevice device, in AttributionSource attributionSource); - @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)") + @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf = { android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED })") List<BluetoothDevice> getConnectedDevices(in AttributionSource attributionSource); - @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)") + @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf = { android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED })") List<BluetoothDevice> getDevicesMatchingConnectionStates(in int[] states, in AttributionSource attributionSource); - @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)") + @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf = { android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED })") int getConnectionState(in BluetoothDevice device, in AttributionSource attributionSource); @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf = { android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED })") boolean setConnectionPolicy(in BluetoothDevice device,in int connectionPolicy, in AttributionSource attributionSource); @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf = { android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED })") int getConnectionPolicy(in BluetoothDevice device, in AttributionSource attributionSource); + @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf = { android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.SEND_SMS })") boolean sendMessage(in BluetoothDevice device, in Uri[] contacts, in String message, in PendingIntent sentIntent, in PendingIntent deliveryIntent, in AttributionSource attributionSource); } diff --git a/android/app/aidl/android/bluetooth/IBluetoothPbapClient.aidl b/android/app/aidl/android/bluetooth/IBluetoothPbapClient.aidl index 1512e44a64..7cc66d08ac 100644 --- a/android/app/aidl/android/bluetooth/IBluetoothPbapClient.aidl +++ b/android/app/aidl/android/bluetooth/IBluetoothPbapClient.aidl @@ -29,11 +29,11 @@ interface IBluetoothPbapClient { boolean connect(in BluetoothDevice device, in AttributionSource attributionSource); @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})") boolean disconnect(in BluetoothDevice device, in AttributionSource attributionSource); - @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)") + @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})") List<BluetoothDevice> getConnectedDevices(in AttributionSource attributionSource); - @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)") + @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})") List<BluetoothDevice> getDevicesMatchingConnectionStates(in int[] states, in AttributionSource attributionSource); - @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)") + @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})") int getConnectionState(in BluetoothDevice device, in AttributionSource attributionSource); @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})") boolean setConnectionPolicy(in BluetoothDevice device, int connectionPolicy, in AttributionSource attributionSource); diff --git a/android/app/aidl/android/bluetooth/IBluetoothScan.aidl b/android/app/aidl/android/bluetooth/IBluetoothScan.aidl index 636e149fe4..de597d292b 100644 --- a/android/app/aidl/android/bluetooth/IBluetoothScan.aidl +++ b/android/app/aidl/android/bluetooth/IBluetoothScan.aidl @@ -58,6 +58,6 @@ interface IBluetoothScan { @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_SCAN)") void transferSetInfo(in BluetoothDevice bda, in int serviceData, in int advertisingHandle, in IPeriodicAdvertisingCallback callback, in AttributionSource attributionSource); - @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)") + @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_SCAN)") int numHwTrackFiltersAvailable(in AttributionSource attributionSource); } diff --git a/android/app/jni/com_android_bluetooth_avrcp_target.cpp b/android/app/jni/com_android_bluetooth_avrcp_target.cpp index 064f63f3e8..d717ad0d8d 100644 --- a/android/app/jni/com_android_bluetooth_avrcp_target.cpp +++ b/android/app/jni/com_android_bluetooth_avrcp_target.cpp @@ -62,6 +62,7 @@ static uint16_t getCurrentPlayerId(); static std::vector<MediaPlayerInfo> getMediaPlayerList(); using SetBrowsedPlayerCb = MediaInterface::SetBrowsedPlayerCallback; static void setBrowsedPlayer(uint16_t player_id, SetBrowsedPlayerCb); +static uint16_t setAddressedPlayer(uint16_t player_id); using GetFolderItemsCb = MediaInterface::FolderItemsCallback; static void getFolderItems(uint16_t player_id, std::string media_id, GetFolderItemsCb cb); static void playItem(uint16_t player_id, bool now_playing, std::string media_id); @@ -146,10 +147,19 @@ public: getFolderItems(player_id, media_id, folder_cb); } + void GetAddressedPlayer(GetAddressedPlayerCallback cb) override { + uint16_t current_player = getCurrentPlayerId(); + cb.Run(current_player); + } + void SetBrowsedPlayer(uint16_t player_id, SetBrowsedPlayerCallback browse_cb) override { setBrowsedPlayer(player_id, browse_cb); } + void SetAddressedPlayer(uint16_t player_id, SetAddressedPlayerCallback addressed_cb) override { + addressed_cb.Run(setAddressedPlayer(player_id)); + } + void RegisterUpdateCallback(MediaCallbacks* callback) override { // TODO(apanicke): Allow multiple registrations in the future mServiceCallbacks = callback; @@ -209,6 +219,7 @@ static jmethodID method_getCurrentMediaId; static jmethodID method_getNowPlayingList; static jmethodID method_setBrowsedPlayer; +static jmethodID method_setAddressedPlayer; static jmethodID method_getCurrentPlayerId; static jmethodID method_getMediaPlayerList; static jmethodID method_getFolderItemsRequest; @@ -695,6 +706,19 @@ static void setBrowsedPlayerResponseNative(JNIEnv* env, jobject /* object */, ji set_browsed_player_cb.Run(success == JNI_TRUE, root, num_items); } +static uint16_t setAddressedPlayer(uint16_t player_id) { + log::debug(""); + std::shared_lock<std::shared_timed_mutex> lock(callbacks_mutex); + CallbackEnv sCallbackEnv(__func__); + if (!sCallbackEnv.valid() || !mJavaInterface) { + return 0u; + } + + jint new_player = + sCallbackEnv->CallIntMethod(mJavaInterface, method_setAddressedPlayer, player_id); + return static_cast<int>(new_player) & 0xFFFF; +} + static void getFolderItemsResponseNative(JNIEnv* env, jobject /* object */, jstring parent_id, jobject list) { log::debug(""); @@ -1065,6 +1089,7 @@ int register_com_android_bluetooth_avrcp_target(JNIEnv* env) { {"getCurrentPlayerId", "()I", &method_getCurrentPlayerId}, {"getMediaPlayerList", "()Ljava/util/List;", &method_getMediaPlayerList}, {"setBrowsedPlayer", "(I)V", &method_setBrowsedPlayer}, + {"setAddressedPlayer", "(I)I", &method_setAddressedPlayer}, {"getFolderItemsRequest", "(ILjava/lang/String;)V", &method_getFolderItemsRequest}, {"playItem", "(IZLjava/lang/String;)V", &method_playItem}, {"setActiveDevice", "(Ljava/lang/String;)V", &method_setActiveDevice}, diff --git a/android/app/jni/com_android_bluetooth_hap_client.cpp b/android/app/jni/com_android_bluetooth_hap_client.cpp index fdbc7c37e5..295a207a4c 100644 --- a/android/app/jni/com_android_bluetooth_hap_client.cpp +++ b/android/app/jni/com_android_bluetooth_hap_client.cpp @@ -51,6 +51,7 @@ static std::shared_timed_mutex interface_mutex; static jobject mCallbacksObj = nullptr; static std::shared_timed_mutex callbacks_mutex; +static jfieldID sCallbacksField; static struct { jclass clazz; @@ -86,7 +87,8 @@ public: return; } - sCallbackEnv->SetByteArrayRegion(addr.get(), 0, sizeof(RawAddress), (jbyte*)&bd_addr); + sCallbackEnv->SetByteArrayRegion(addr.get(), 0, sizeof(RawAddress), + reinterpret_cast<const jbyte*>(&bd_addr)); sCallbackEnv->CallVoidMethod(mCallbacksObj, method_onConnectionStateChanged, (jint)state, addr.get()); } @@ -104,7 +106,8 @@ public: log::error("Failed to new bd addr jbyteArray for device available"); return; } - sCallbackEnv->SetByteArrayRegion(addr.get(), 0, sizeof(RawAddress), (jbyte*)&bd_addr); + sCallbackEnv->SetByteArrayRegion(addr.get(), 0, sizeof(RawAddress), + reinterpret_cast<const jbyte*>(&bd_addr)); sCallbackEnv->CallVoidMethod(mCallbacksObj, method_onDeviceAvailable, addr.get(), (jint)features); @@ -123,7 +126,8 @@ public: log::error("Failed to new bd addr jbyteArray for device available"); return; } - sCallbackEnv->SetByteArrayRegion(addr.get(), 0, sizeof(RawAddress), (jbyte*)&bd_addr); + sCallbackEnv->SetByteArrayRegion(addr.get(), 0, sizeof(RawAddress), + reinterpret_cast<const jbyte*>(&bd_addr)); sCallbackEnv->CallVoidMethod(mCallbacksObj, method_onFeaturesUpdate, addr.get(), (jint)features); @@ -144,8 +148,9 @@ public: log::error("Failed to new bd addr jbyteArray for preset selected"); return; } - sCallbackEnv->SetByteArrayRegion(addr.get(), 0, sizeof(RawAddress), - (jbyte*)&std::get<RawAddress>(addr_or_group_id)); + sCallbackEnv->SetByteArrayRegion( + addr.get(), 0, sizeof(RawAddress), + reinterpret_cast<jbyte*>(&std::get<RawAddress>(addr_or_group_id))); sCallbackEnv->CallVoidMethod(mCallbacksObj, method_onActivePresetSelected, addr.get(), (jint)preset_index); @@ -170,8 +175,9 @@ public: log::error("Failed to new bd addr jbyteArray for preset select error"); return; } - sCallbackEnv->SetByteArrayRegion(addr.get(), 0, sizeof(RawAddress), - (jbyte*)&std::get<RawAddress>(addr_or_group_id)); + sCallbackEnv->SetByteArrayRegion( + addr.get(), 0, sizeof(RawAddress), + reinterpret_cast<jbyte*>(&std::get<RawAddress>(addr_or_group_id))); sCallbackEnv->CallVoidMethod(mCallbacksObj, method_onActivePresetSelectError, addr.get(), (jint)error_code); @@ -222,8 +228,9 @@ public: log::error("Failed to new bd addr jbyteArray for preset name"); return; } - sCallbackEnv->SetByteArrayRegion(addr.get(), 0, sizeof(RawAddress), - (jbyte*)&std::get<RawAddress>(addr_or_group_id)); + sCallbackEnv->SetByteArrayRegion( + addr.get(), 0, sizeof(RawAddress), + reinterpret_cast<jbyte*>(&std::get<RawAddress>(addr_or_group_id))); sCallbackEnv->CallVoidMethod(mCallbacksObj, method_onPresetInfo, addr.get(), (jint)info_reason, presets_array); @@ -234,8 +241,8 @@ public: } } - virtual void OnPresetInfoError(std::variant<RawAddress, int> addr_or_group_id, - uint8_t preset_index, ErrorCode error_code) override { + void OnPresetInfoError(std::variant<RawAddress, int> addr_or_group_id, uint8_t preset_index, + ErrorCode error_code) override { std::shared_lock<std::shared_timed_mutex> lock(callbacks_mutex); CallbackEnv sCallbackEnv(__func__); if (!sCallbackEnv.valid() || mCallbacksObj == nullptr) { @@ -249,8 +256,9 @@ public: log::error("Failed to new bd addr jbyteArray for preset name get error"); return; } - sCallbackEnv->SetByteArrayRegion(addr.get(), 0, sizeof(RawAddress), - (jbyte*)&std::get<RawAddress>(addr_or_group_id)); + sCallbackEnv->SetByteArrayRegion( + addr.get(), 0, sizeof(RawAddress), + reinterpret_cast<jbyte*>(&std::get<RawAddress>(addr_or_group_id))); sCallbackEnv->CallVoidMethod(mCallbacksObj, method_onPresetInfoError, addr.get(), (jint)preset_index, (jint)error_code); @@ -276,8 +284,9 @@ public: log::error("Failed to new bd addr jbyteArray for preset name set error"); return; } - sCallbackEnv->SetByteArrayRegion(addr.get(), 0, sizeof(RawAddress), - (jbyte*)&std::get<RawAddress>(addr_or_group_id)); + sCallbackEnv->SetByteArrayRegion( + addr.get(), 0, sizeof(RawAddress), + reinterpret_cast<jbyte*>(&std::get<RawAddress>(addr_or_group_id))); sCallbackEnv->CallVoidMethod(mCallbacksObj, method_onPresetNameSetError, addr.get(), (jint)preset_index, (jint)error_code); @@ -291,7 +300,7 @@ public: static HasClientCallbacksImpl sHasClientCallbacks; -static void initNative(JNIEnv* env, jobject object) { +static void initNative(JNIEnv* env, jobject obj) { std::unique_lock<std::shared_timed_mutex> interface_lock(interface_mutex); std::unique_lock<std::shared_timed_mutex> callbacks_lock(callbacks_mutex); @@ -313,7 +322,7 @@ static void initNative(JNIEnv* env, jobject object) { mCallbacksObj = nullptr; } - if ((mCallbacksObj = env->NewGlobalRef(object)) == nullptr) { + if ((mCallbacksObj = env->NewGlobalRef(env->GetObjectField(obj, sCallbacksField))) == nullptr) { log::error("Failed to allocate Global Ref for Hearing Access Callbacks"); return; } @@ -325,7 +334,8 @@ static void initNative(JNIEnv* env, jobject object) { return; } - sHasClientInterface = (HasClientInterface*)btInf->get_profile_interface(BT_PROFILE_HAP_CLIENT_ID); + sHasClientInterface = const_cast<HasClientInterface*>(reinterpret_cast<const HasClientInterface*>( + btInf->get_profile_interface(BT_PROFILE_HAP_CLIENT_ID))); if (sHasClientInterface == nullptr) { log::error("Failed to get Bluetooth Hearing Access Service Client Interface"); return; @@ -368,7 +378,7 @@ static jboolean connectHapClientNative(JNIEnv* env, jobject /* object */, jbyteA return JNI_FALSE; } - RawAddress* tmpraw = (RawAddress*)addr; + RawAddress* tmpraw = reinterpret_cast<RawAddress*>(addr); sHasClientInterface->Connect(*tmpraw); env->ReleaseByteArrayElements(address, addr, 0); return JNI_TRUE; @@ -387,7 +397,7 @@ static jboolean disconnectHapClientNative(JNIEnv* env, jobject /* object */, jby return JNI_FALSE; } - RawAddress* tmpraw = (RawAddress*)addr; + RawAddress* tmpraw = reinterpret_cast<RawAddress*>(addr); sHasClientInterface->Disconnect(*tmpraw); env->ReleaseByteArrayElements(address, addr, 0); return JNI_TRUE; @@ -407,7 +417,7 @@ static void selectActivePresetNative(JNIEnv* env, jobject /* object */, jbyteArr return; } - RawAddress* tmpraw = (RawAddress*)addr; + RawAddress* tmpraw = reinterpret_cast<RawAddress*>(addr); sHasClientInterface->SelectActivePreset(*tmpraw, preset_index); env->ReleaseByteArrayElements(address, addr, 0); } @@ -436,7 +446,7 @@ static void nextActivePresetNative(JNIEnv* env, jobject /* object */, jbyteArray return; } - RawAddress* tmpraw = (RawAddress*)addr; + RawAddress* tmpraw = reinterpret_cast<RawAddress*>(addr); sHasClientInterface->NextActivePreset(*tmpraw); env->ReleaseByteArrayElements(address, addr, 0); } @@ -464,7 +474,7 @@ static void previousActivePresetNative(JNIEnv* env, jobject /* object */, jbyteA return; } - RawAddress* tmpraw = (RawAddress*)addr; + RawAddress* tmpraw = reinterpret_cast<RawAddress*>(addr); sHasClientInterface->PreviousActivePreset(*tmpraw); env->ReleaseByteArrayElements(address, addr, 0); } @@ -494,7 +504,7 @@ static void getPresetInfoNative(JNIEnv* env, jobject /* object */, jbyteArray ad return; } - RawAddress* tmpraw = (RawAddress*)addr; + RawAddress* tmpraw = reinterpret_cast<RawAddress*>(addr); sHasClientInterface->GetPresetInfo(*tmpraw, preset_index); env->ReleaseByteArrayElements(address, addr, 0); } @@ -520,7 +530,7 @@ static void setPresetNameNative(JNIEnv* env, jobject /* object */, jbyteArray ad env->ReleaseStringUTFChars(name, value); } - RawAddress* tmpraw = (RawAddress*)addr; + RawAddress* tmpraw = reinterpret_cast<RawAddress*>(addr); sHasClientInterface->SetPresetName(*tmpraw, preset_index, std::move(name_str)); env->ReleaseByteArrayElements(address, addr, 0); } @@ -545,19 +555,26 @@ static void groupSetPresetNameNative(JNIEnv* env, jobject /* object */, jint gro int register_com_android_bluetooth_hap_client(JNIEnv* env) { const JNINativeMethod methods[] = { - {"initNative", "()V", (void*)initNative}, - {"cleanupNative", "()V", (void*)cleanupNative}, - {"connectHapClientNative", "([B)Z", (void*)connectHapClientNative}, - {"disconnectHapClientNative", "([B)Z", (void*)disconnectHapClientNative}, - {"selectActivePresetNative", "([BI)V", (void*)selectActivePresetNative}, - {"groupSelectActivePresetNative", "(II)V", (void*)groupSelectActivePresetNative}, - {"nextActivePresetNative", "([B)V", (void*)nextActivePresetNative}, - {"groupNextActivePresetNative", "(I)V", (void*)groupNextActivePresetNative}, - {"previousActivePresetNative", "([B)V", (void*)previousActivePresetNative}, - {"groupPreviousActivePresetNative", "(I)V", (void*)groupPreviousActivePresetNative}, - {"getPresetInfoNative", "([BI)V", (void*)getPresetInfoNative}, - {"setPresetNameNative", "([BILjava/lang/String;)V", (void*)setPresetNameNative}, - {"groupSetPresetNameNative", "(IILjava/lang/String;)V", (void*)groupSetPresetNameNative}, + {"initNative", "()V", reinterpret_cast<void*>(initNative)}, + {"cleanupNative", "()V", reinterpret_cast<void*>(cleanupNative)}, + {"connectHapClientNative", "([B)Z", reinterpret_cast<void*>(connectHapClientNative)}, + {"disconnectHapClientNative", "([B)Z", + reinterpret_cast<void*>(disconnectHapClientNative)}, + {"selectActivePresetNative", "([BI)V", reinterpret_cast<void*>(selectActivePresetNative)}, + {"groupSelectActivePresetNative", "(II)V", + reinterpret_cast<void*>(groupSelectActivePresetNative)}, + {"nextActivePresetNative", "([B)V", reinterpret_cast<void*>(nextActivePresetNative)}, + {"groupNextActivePresetNative", "(I)V", + reinterpret_cast<void*>(groupNextActivePresetNative)}, + {"previousActivePresetNative", "([B)V", + reinterpret_cast<void*>(previousActivePresetNative)}, + {"groupPreviousActivePresetNative", "(I)V", + reinterpret_cast<void*>(groupPreviousActivePresetNative)}, + {"getPresetInfoNative", "([BI)V", reinterpret_cast<void*>(getPresetInfoNative)}, + {"setPresetNameNative", "([BILjava/lang/String;)V", + reinterpret_cast<void*>(setPresetNameNative)}, + {"groupSetPresetNameNative", "(IILjava/lang/String;)V", + reinterpret_cast<void*>(groupSetPresetNameNative)}, }; const int result = REGISTER_NATIVE_METHODS( env, "com/android/bluetooth/hap/HapClientNativeInterface", methods); @@ -565,6 +582,12 @@ int register_com_android_bluetooth_hap_client(JNIEnv* env) { return result; } + jclass jniHapClientNativeInterfaceClass = + env->FindClass("com/android/bluetooth/hap/HapClientNativeInterface"); + sCallbacksField = env->GetFieldID(jniHapClientNativeInterfaceClass, "mHapClientNativeCallback", + "Lcom/android/bluetooth/hap/HapClientNativeCallback;"); + env->DeleteLocalRef(jniHapClientNativeInterfaceClass); + const JNIJavaMethod javaMethods[] = { {"onConnectionStateChanged", "(I[B)V", &method_onConnectionStateChanged}, {"onDeviceAvailable", "([BI)V", &method_onDeviceAvailable}, @@ -582,7 +605,7 @@ int register_com_android_bluetooth_hap_client(JNIEnv* env) { {"onPresetInfoError", "([BII)V", &method_onPresetInfoError}, {"onGroupPresetInfoError", "(III)V", &method_onGroupPresetInfoError}, }; - GET_JAVA_METHODS(env, "com/android/bluetooth/hap/HapClientNativeInterface", javaMethods); + GET_JAVA_METHODS(env, "com/android/bluetooth/hap/HapClientNativeCallback", javaMethods); const JNIJavaMethod javaHapPresetMethods[] = { {"<init>", "(ILjava/lang/String;ZZ)V", diff --git a/android/app/jni/com_android_bluetooth_vc.cpp b/android/app/jni/com_android_bluetooth_vc.cpp index f56b913afe..986605dab1 100644 --- a/android/app/jni/com_android_bluetooth_vc.cpp +++ b/android/app/jni/com_android_bluetooth_vc.cpp @@ -67,7 +67,7 @@ public: addr.get()); } - void OnVolumeStateChanged(const RawAddress& bd_addr, uint8_t volume, bool mute, + void OnVolumeStateChanged(const RawAddress& bd_addr, uint8_t volume, bool mute, uint8_t flags, bool isAutonomous) override { log::info(""); @@ -86,7 +86,7 @@ public: sCallbackEnv->SetByteArrayRegion(addr.get(), 0, sizeof(RawAddress), (jbyte*)&bd_addr); sCallbackEnv->CallVoidMethod(mCallbacksObj, method_onVolumeStateChanged, (jint)volume, - (jboolean)mute, addr.get(), (jboolean)isAutonomous); + (jboolean)mute, (jint)flags, addr.get(), (jboolean)isAutonomous); } void OnGroupVolumeStateChanged(int group_id, uint8_t volume, bool mute, @@ -533,7 +533,7 @@ int register_com_android_bluetooth_vc(JNIEnv* env) { const JNIJavaMethod javaMethods[] = { {"onConnectionStateChanged", "(I[B)V", &method_onConnectionStateChanged}, - {"onVolumeStateChanged", "(IZ[BZ)V", &method_onVolumeStateChanged}, + {"onVolumeStateChanged", "(IZI[BZ)V", &method_onVolumeStateChanged}, {"onGroupVolumeStateChanged", "(IZIZ)V", &method_onGroupVolumeStateChanged}, {"onDeviceAvailable", "(I[B)V", &method_onDeviceAvailable}, {"onExtAudioOutVolumeOffsetChanged", "(II[B)V", &method_onExtAudioOutVolumeOffsetChanged}, diff --git a/android/app/src/com/android/bluetooth/BluetoothMethodProxy.java b/android/app/src/com/android/bluetooth/BluetoothMethodProxy.java index dc7d8464ca..f6d065eb76 100644 --- a/android/app/src/com/android/bluetooth/BluetoothMethodProxy.java +++ b/android/app/src/com/android/bluetooth/BluetoothMethodProxy.java @@ -248,6 +248,7 @@ public class BluetoothMethodProxy { } /** Proxies {@link PeriodicAdvertisingManager#transferSync}. */ + @SuppressLint("AndroidFrameworkRequiresPermission") // TODO: b/350563786 public void periodicAdvertisingManagerTransferSync( PeriodicAdvertisingManager manager, BluetoothDevice bda, @@ -257,6 +258,7 @@ public class BluetoothMethodProxy { } /** Proxies {@link PeriodicAdvertisingManager#transferSetInfo}. */ + @SuppressLint("AndroidFrameworkRequiresPermission") // TODO: b/350563786 public void periodicAdvertisingManagerTransferSetInfo( PeriodicAdvertisingManager manager, BluetoothDevice bda, diff --git a/android/app/src/com/android/bluetooth/BluetoothObexTransport.java b/android/app/src/com/android/bluetooth/BluetoothObexTransport.java index d6f09ad310..3c57ec1600 100644 --- a/android/app/src/com/android/bluetooth/BluetoothObexTransport.java +++ b/android/app/src/com/android/bluetooth/BluetoothObexTransport.java @@ -113,7 +113,7 @@ public class BluetoothObexTransport implements ObexTransport { return null; } String identityAddress = - Flags.identityAddressNullIfUnknown() + Flags.identityAddressNullIfNotKnown() ? Utils.getBrEdrAddress(mSocket.getRemoteDevice()) : mSocket.getRemoteDevice().getIdentityAddress(); return mSocket.getConnectionType() == BluetoothSocket.TYPE_RFCOMM diff --git a/android/app/src/com/android/bluetooth/a2dp/A2dpNativeInterface.java b/android/app/src/com/android/bluetooth/a2dp/A2dpNativeInterface.java index aa0c8dad3c..2de9f0d8fa 100644 --- a/android/app/src/com/android/bluetooth/a2dp/A2dpNativeInterface.java +++ b/android/app/src/com/android/bluetooth/a2dp/A2dpNativeInterface.java @@ -169,7 +169,7 @@ public class A2dpNativeInterface { if (device == null) { return Utils.getBytesFromAddress("00:00:00:00:00:00"); } - if (Flags.identityAddressNullIfUnknown()) { + if (Flags.identityAddressNullIfNotKnown()) { return Utils.getByteBrEdrAddress(device); } else { return mAdapterService.getByteIdentityAddress(device); diff --git a/android/app/src/com/android/bluetooth/a2dpsink/A2dpSinkNativeInterface.java b/android/app/src/com/android/bluetooth/a2dpsink/A2dpSinkNativeInterface.java index 6493c72aa1..42e7a033f1 100644 --- a/android/app/src/com/android/bluetooth/a2dpsink/A2dpSinkNativeInterface.java +++ b/android/app/src/com/android/bluetooth/a2dpsink/A2dpSinkNativeInterface.java @@ -81,7 +81,7 @@ public class A2dpSinkNativeInterface { } private byte[] getByteAddress(BluetoothDevice device) { - if (Flags.identityAddressNullIfUnknown()) { + if (Flags.identityAddressNullIfNotKnown()) { return Utils.getByteBrEdrAddress(device); } else { return mAdapterService.getByteIdentityAddress(device); diff --git a/android/app/src/com/android/bluetooth/audio_util/MediaPlayerList.java b/android/app/src/com/android/bluetooth/audio_util/MediaPlayerList.java index 1e3780346a..3e54ef3b5b 100644 --- a/android/app/src/com/android/bluetooth/audio_util/MediaPlayerList.java +++ b/android/app/src/com/android/bluetooth/audio_util/MediaPlayerList.java @@ -102,6 +102,7 @@ public class MediaPlayerList { Collections.synchronizedMap(new HashMap<Integer, MediaBrowserWrapper>()); private int mActivePlayerId = NO_ACTIVE_PLAYER; private int mBrowsingPlayerId = NO_ACTIVE_PLAYER; + private int mAddressedPlayerId = NO_ACTIVE_PLAYER; private MediaUpdateCallback mCallback; private boolean mAudioPlaybackIsActive = false; @@ -329,7 +330,9 @@ public class MediaPlayerList { /** returns the current player ID. */ public int getCurrentPlayerId() { - if (Flags.browsingRefactor()) { + if (Flags.setAddressedPlayer()) { + return mAddressedPlayerId; + } else if (Flags.browsingRefactor()) { return mBrowsingPlayerId; } else { return BLUETOOTH_PLAYER_ID; @@ -350,7 +353,16 @@ public class MediaPlayerList { return mMediaPlayers.get(mActivePlayerId); } - /** This is used to send passthrough command to media session */ + /** Returns the {@link #MediaPlayerWrapper} with ID matching {@link #mAddressedPlayerId}. */ + public MediaPlayerWrapper getAddressedPlayer() { + return mMediaPlayers.get(mAddressedPlayerId); + } + + /** + * This is used to send passthrough command to media session + * + * <p>Note: This is used only by MCP, AVRCP uses AvrcpTargetService. + */ public void sendMediaKeyEvent(int key, boolean pushed) { if (mMediaSessionManager == null) { Log.d(TAG, "Bluetooth is turning off, ignore it"); @@ -363,19 +375,20 @@ public class MediaPlayerList { public void getPlayerRoot(int playerId, GetPlayerRootCallback cb) { if (Flags.browsingRefactor()) { - mBrowsingPlayerId = playerId; - if (haveMediaBrowser(playerId)) { - MediaBrowserWrapper wrapper = mMediaBrowserWrappers.get(playerId); - wrapper.getRootId( - (rootId) -> { - wrapper.getFolderItems( - rootId, - (parentId, itemList) -> { - cb.run(playerId, true, rootId, itemList.size()); - }); - }); - sendFolderUpdate(false, true, false); + if (!haveMediaBrowser(playerId)) { + cb.run(playerId, false, "", 0); + return; } + mBrowsingPlayerId = playerId; + MediaBrowserWrapper wrapper = mMediaBrowserWrappers.get(playerId); + wrapper.getRootId( + (rootId) -> { + wrapper.getFolderItems( + rootId, + (parentId, itemList) -> { + cb.run(playerId, true, rootId, itemList.size()); + }); + }); } else { // Fix PTS AVRCP/TG/MCN/CB/BI-02-C if (Utils.isPtsTestMode()) { @@ -398,6 +411,18 @@ public class MediaPlayerList { } } + /** Sets which player the AV/C commands should be addressed to. */ + public int setAddressedPlayer(int playerId) { + if (!Flags.setAddressedPlayer()) { + return BLUETOOTH_PLAYER_ID; + } + if (mMediaPlayerIds.containsValue(playerId)) { + mAddressedPlayerId = playerId; + sendFolderUpdate(false, true, false); + } + return mAddressedPlayerId; + } + /** Returns a list valid browsable players. */ public List<PlayerInfo> getMediaPlayerList() { List<PlayerInfo> ret = new ArrayList<PlayerInfo>(); @@ -564,8 +589,15 @@ public class MediaPlayerList { } long queueItemId = Long.parseLong(m.group(1)); - if (getActivePlayer() != null) { - getActivePlayer().playItemFromQueue(queueItemId); + + MediaPlayerWrapper player; + if (Flags.setAddressedPlayer()) { + player = getAddressedPlayer(); + } else { + player = getActivePlayer(); + } + if (player != null) { + player.playItemFromQueue(queueItemId); } } @@ -894,7 +926,11 @@ public class MediaPlayerList { // tells us otherwise if (playerId == mActivePlayerId && playerId != NO_ACTIVE_PLAYER) { getActivePlayer().unregisterCallback(); + if (mAddressedPlayerId == mActivePlayerId) { + mAddressedPlayerId = NO_ACTIVE_PLAYER; + } mActivePlayerId = NO_ACTIVE_PLAYER; + List<Metadata> queue = new ArrayList<Metadata>(); queue.add(Util.empty_data()); MediaData newData = new MediaData(Util.empty_data(), null, queue); @@ -948,6 +984,13 @@ public class MediaPlayerList { if (Utils.isPtsTestMode()) { sendFolderUpdate(true, true, false); + } else if (Flags.setAddressedPlayer()) { + // If the new active player has been set by Addressed player key event + // We don't send an addressed player update. + if (mActivePlayerId != mAddressedPlayerId) { + mAddressedPlayerId = mActivePlayerId; + sendFolderUpdate(false, true, false); + } } MediaData data = getActivePlayer().getCurrentMediaData(); diff --git a/android/app/src/com/android/bluetooth/avrcp/AvrcpNativeInterface.java b/android/app/src/com/android/bluetooth/avrcp/AvrcpNativeInterface.java index 448bb60010..caad2c7d77 100644 --- a/android/app/src/com/android/bluetooth/avrcp/AvrcpNativeInterface.java +++ b/android/app/src/com/android/bluetooth/avrcp/AvrcpNativeInterface.java @@ -96,7 +96,7 @@ public class AvrcpNativeInterface { void setBipClientStatus(BluetoothDevice device, boolean connected) { String identityAddress = - Flags.identityAddressNullIfUnknown() + Flags.identityAddressNullIfNotKnown() ? Utils.getBrEdrAddress(device) : mAdapterService.getIdentityAddress(device.getAddress()); setBipClientStatusNative(identityAddress, connected); @@ -192,6 +192,11 @@ public class AvrcpNativeInterface { setBrowsedPlayerResponseNative(playerId, success, rootId, numItems); } + int setAddressedPlayer(int playerId) { + d("setAddressedPlayer: playerId=" + playerId); + return mAvrcpService.setAddressedPlayer(playerId); + } + void getFolderItemsRequest(int playerId, String mediaId) { d("getFolderItemsRequest: playerId=" + playerId + " mediaId=" + mediaId); mAvrcpService.getFolderItems(playerId, mediaId, (a, b) -> getFolderItemsResponse(a, b)); @@ -236,7 +241,7 @@ public class AvrcpNativeInterface { boolean disconnectDevice(BluetoothDevice device) { String identityAddress = - Flags.identityAddressNullIfUnknown() + Flags.identityAddressNullIfNotKnown() ? Utils.getBrEdrAddress(device) : mAdapterService.getIdentityAddress(device.getAddress()); d("disconnectDevice: identityAddress=" + identityAddress); @@ -277,7 +282,7 @@ public class AvrcpNativeInterface { void sendVolumeChanged(BluetoothDevice device, int volume) { d("sendVolumeChanged: volume=" + volume); String identityAddress = - Flags.identityAddressNullIfUnknown() + Flags.identityAddressNullIfNotKnown() ? Utils.getBrEdrAddress(device) : mAdapterService.getIdentityAddress(device.getAddress()); sendVolumeChangedNative(identityAddress, volume); diff --git a/android/app/src/com/android/bluetooth/avrcp/AvrcpTargetService.java b/android/app/src/com/android/bluetooth/avrcp/AvrcpTargetService.java index 6e107e0bc6..8c4c0f94b2 100644 --- a/android/app/src/com/android/bluetooth/avrcp/AvrcpTargetService.java +++ b/android/app/src/com/android/bluetooth/avrcp/AvrcpTargetService.java @@ -47,6 +47,7 @@ import com.android.bluetooth.btservice.AdapterService; import com.android.bluetooth.btservice.MetricsLogger; import com.android.bluetooth.btservice.ProfileService; import com.android.bluetooth.btservice.ServiceFactory; +import com.android.bluetooth.flags.Flags; import com.android.internal.annotations.VisibleForTesting; import java.util.List; @@ -485,6 +486,11 @@ public class AvrcpTargetService extends ProfileService { mMediaPlayerList.getPlayerRoot(playerId, cb); } + /** See {@link MediaPlayerList#setAddressedPlayer}. */ + int setAddressedPlayer(int playerId) { + return mMediaPlayerList.setAddressedPlayer(playerId); + } + /** See {@link MediaPlayerList#getFolderItems}. */ void getFolderItems(int playerId, String mediaId, MediaPlayerList.GetFolderItemsCallback cb) { mMediaPlayerList.getFolderItems(playerId, mediaId, cb); @@ -499,8 +505,22 @@ public class AvrcpTargetService extends ProfileService { /** Informs {@link AudioManager} of an incoming key event from a remote device. */ void sendMediaKeyEvent(int key, boolean pushed) { + MediaPlayerWrapper activePlayer = mMediaPlayerList.getActivePlayer(); + if (Flags.setAddressedPlayer()) { + MediaPlayerWrapper addressedPlayer = mMediaPlayerList.getAddressedPlayer(); + // A/V controls should be sent to the addressed player. + // We don't have a way to set a media player as the active session so we + // keep the active device playing until we receive a PLAY event for the + // addressed player. Other events will still be broadcasted to active player. + if (addressedPlayer != null + && KeyEvent.KEYCODE_MEDIA_PLAY == AvrcpPassthrough.toKeyCode(key) + && activePlayer != addressedPlayer) { + addressedPlayer.playCurrent(); + return; + } + } + BluetoothDevice activeDevice = getA2dpActiveDevice(); - MediaPlayerWrapper player = mMediaPlayerList.getActivePlayer(); mMediaKeyEventLogger.logd( TAG, "sendMediaKeyEvent:" @@ -511,7 +531,7 @@ public class AvrcpTargetService extends ProfileService { + " pushed=" + pushed + " to " - + (player == null ? null : player.getPackageName())); + + (activePlayer == null ? null : activePlayer.getPackageName())); int action = pushed ? KeyEvent.ACTION_DOWN : KeyEvent.ACTION_UP; KeyEvent event = new KeyEvent(action, AvrcpPassthrough.toKeyCode(key)); mAudioManager.dispatchMediaKeyEvent(event); diff --git a/android/app/src/com/android/bluetooth/avrcpcontroller/AvrcpCoverArtManager.java b/android/app/src/com/android/bluetooth/avrcpcontroller/AvrcpCoverArtManager.java index 7ac0842b01..a48b2d5ea2 100644 --- a/android/app/src/com/android/bluetooth/avrcpcontroller/AvrcpCoverArtManager.java +++ b/android/app/src/com/android/bluetooth/avrcpcontroller/AvrcpCoverArtManager.java @@ -128,7 +128,8 @@ public class AvrcpCoverArtManager { */ public static boolean isValidImageHandle(String handle) { if (handle == null || handle.length() != 7) return false; - for (char c : handle.toCharArray()) { + for (int i = 0; i < handle.length(); i++) { + char c = handle.charAt(i); if (!Character.isDigit(c)) { return false; } diff --git a/android/app/src/com/android/bluetooth/avrcpcontroller/AvrcpItem.java b/android/app/src/com/android/bluetooth/avrcpcontroller/AvrcpItem.java index 7d248b0058..14bcf1fbdc 100644 --- a/android/app/src/com/android/bluetooth/avrcpcontroller/AvrcpItem.java +++ b/android/app/src/com/android/bluetooth/avrcpcontroller/AvrcpItem.java @@ -276,20 +276,20 @@ public class AvrcpItem { AvrcpItem other = ((AvrcpItem) o); return Objects.equals(mUuid, other.getUuid()) && Objects.equals(mDevice, other.getDevice()) - && Objects.equals(mUid, other.getUid()) - && Objects.equals(mItemType, other.getItemType()) - && Objects.equals(mType, other.getType()) + && mUid == other.getUid() + && mItemType == other.getItemType() + && mType == other.getType() && Objects.equals(mTitle, other.getTitle()) && Objects.equals(mDisplayableName, other.getDisplayableName()) && Objects.equals(mArtistName, other.getArtistName()) && Objects.equals(mAlbumName, other.getAlbumName()) - && Objects.equals(mTrackNumber, other.getTrackNumber()) - && Objects.equals(mTotalNumberOfTracks, other.getTotalNumberOfTracks()) + && mTrackNumber == other.getTrackNumber() + && mTotalNumberOfTracks == other.getTotalNumberOfTracks() && Objects.equals(mGenre, other.getGenre()) - && Objects.equals(mPlayingTime, other.getPlayingTime()) + && mPlayingTime == other.getPlayingTime() && Objects.equals(mCoverArtHandle, other.getCoverArtHandle()) - && Objects.equals(mPlayable, other.isPlayable()) - && Objects.equals(mBrowsable, other.isBrowsable()) + && mPlayable == other.isPlayable() + && mBrowsable == other.isBrowsable() && Objects.equals(mImageUri, other.getCoverArtLocation()); } diff --git a/android/app/src/com/android/bluetooth/avrcpcontroller/bip/BipAttachmentFormat.java b/android/app/src/com/android/bluetooth/avrcpcontroller/bip/BipAttachmentFormat.java index 75042d678c..2ad9b2c801 100644 --- a/android/app/src/com/android/bluetooth/avrcpcontroller/bip/BipAttachmentFormat.java +++ b/android/app/src/com/android/bluetooth/avrcpcontroller/bip/BipAttachmentFormat.java @@ -145,16 +145,19 @@ public class BipAttachmentFormat { @Override public boolean equals(Object o) { - if (o == this) return true; - if (!(o instanceof BipAttachmentFormat)) return false; + if (o == this) { + return true; + } + if (!(o instanceof BipAttachmentFormat a)) { + return false; + } - BipAttachmentFormat a = (BipAttachmentFormat) o; - return a.getContentType() == getContentType() - && a.getName() == getName() - && a.getCharset() == getCharset() + return a.getContentType().equals(getContentType()) + && a.getName().equals(getName()) + && Objects.equals(a.getCharset(), getCharset()) && a.getSize() == getSize() - && a.getCreatedDate() == getCreatedDate() - && a.getModifiedDate() == getModifiedDate(); + && Objects.equals(a.getCreatedDate(), getCreatedDate()) + && Objects.equals(a.getModifiedDate(), getModifiedDate()); } @Override diff --git a/android/app/src/com/android/bluetooth/avrcpcontroller/bip/BipDateTime.java b/android/app/src/com/android/bluetooth/avrcpcontroller/bip/BipDateTime.java index 380111aa81..5771776fa0 100644 --- a/android/app/src/com/android/bluetooth/avrcpcontroller/bip/BipDateTime.java +++ b/android/app/src/com/android/bluetooth/avrcpcontroller/bip/BipDateTime.java @@ -16,6 +16,8 @@ package com.android.bluetooth.avrcpcontroller; +import android.annotation.SuppressLint; + import com.android.bluetooth.Utils; import java.util.Calendar; @@ -113,14 +115,18 @@ public class BipDateTime { @Override public boolean equals(Object o) { - if (o == this) return true; - if (!(o instanceof BipDateTime)) return false; + if (o == this) { + return true; + } + if (!(o instanceof BipDateTime d)) { + return false; + } - BipDateTime d = (BipDateTime) o; - return d.isUtc() == isUtc() && d.getTime() == getTime(); + return d.isUtc() == isUtc() && Objects.equals(d.getTime(), getTime()); } @Override + @SuppressLint("ToStringReturnsNull") public String toString() { Date d = getTime(); if (d == null) { diff --git a/android/app/src/com/android/bluetooth/avrcpcontroller/bip/BipEncoding.java b/android/app/src/com/android/bluetooth/avrcpcontroller/bip/BipEncoding.java index 72d3819167..bfc346d0df 100644 --- a/android/app/src/com/android/bluetooth/avrcpcontroller/bip/BipEncoding.java +++ b/android/app/src/com/android/bluetooth/avrcpcontroller/bip/BipEncoding.java @@ -21,6 +21,7 @@ import android.util.SparseArray; import com.google.common.base.Ascii; import java.util.HashMap; +import java.util.Objects; /** * Represents an encoding method in which a BIP image is available. @@ -172,12 +173,15 @@ public class BipEncoding { @Override public boolean equals(Object o) { - if (o == this) return true; - if (!(o instanceof BipEncoding)) return false; + if (o == this) { + return true; + } + if (!(o instanceof BipEncoding e)) { + return false; + } - BipEncoding e = (BipEncoding) o; return e.getType() == getType() - && e.getProprietaryEncodingId() == getProprietaryEncodingId(); + && Objects.equals(e.getProprietaryEncodingId(), getProprietaryEncodingId()); } @Override diff --git a/android/app/src/com/android/bluetooth/avrcpcontroller/bip/BipImageDescriptor.java b/android/app/src/com/android/bluetooth/avrcpcontroller/bip/BipImageDescriptor.java index 3eae52076a..b41b87387d 100644 --- a/android/app/src/com/android/bluetooth/avrcpcontroller/bip/BipImageDescriptor.java +++ b/android/app/src/com/android/bluetooth/avrcpcontroller/bip/BipImageDescriptor.java @@ -16,6 +16,7 @@ package com.android.bluetooth.avrcpcontroller; +import android.annotation.SuppressLint; import android.util.Log; import android.util.Xml; @@ -28,6 +29,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.StringWriter; import java.nio.charset.StandardCharsets; +import java.util.Objects; /** * Contains the metadata that describes either (1) the desired size of a image to be downloaded or @@ -250,18 +252,22 @@ public class BipImageDescriptor { @Override public boolean equals(Object o) { - if (o == this) return true; - if (!(o instanceof BipImageDescriptor)) return false; + if (o == this) { + return true; + } + if (!(o instanceof BipImageDescriptor d)) { + return false; + } - BipImageDescriptor d = (BipImageDescriptor) o; - return d.getEncoding() == getEncoding() - && d.getPixel() == getPixel() - && d.getTransformation() == getTransformation() + return Objects.equals(d.getEncoding(), getEncoding()) + && Objects.equals(d.getPixel(), getPixel()) + && Objects.equals(d.getTransformation(), getTransformation()) && d.getSize() == getSize() && d.getMaxSize() == getMaxSize(); } @Override + @SuppressLint("ToStringReturnsNull") // Since this is used for encoding to xml public String toString() { if (mEncoding == null || mPixel == null) { error( diff --git a/android/app/src/com/android/bluetooth/avrcpcontroller/bip/BipImageFormat.java b/android/app/src/com/android/bluetooth/avrcpcontroller/bip/BipImageFormat.java index cb564b639e..7f278932cf 100644 --- a/android/app/src/com/android/bluetooth/avrcpcontroller/bip/BipImageFormat.java +++ b/android/app/src/com/android/bluetooth/avrcpcontroller/bip/BipImageFormat.java @@ -16,6 +16,7 @@ package com.android.bluetooth.avrcpcontroller; +import android.annotation.SuppressLint; import android.util.Log; import java.util.Objects; @@ -166,19 +167,23 @@ public class BipImageFormat { @Override public boolean equals(Object o) { - if (o == this) return true; - if (!(o instanceof BipImageFormat)) return false; + if (o == this) { + return true; + } + if (!(o instanceof BipImageFormat f)) { + return false; + } - BipImageFormat f = (BipImageFormat) o; return f.getType() == getType() - && f.getEncoding() == getEncoding() - && f.getPixel() == getPixel() - && f.getTransformation() == getTransformation() + && Objects.equals(f.getEncoding(), getEncoding()) + && Objects.equals(f.getPixel(), getPixel()) + && Objects.equals(f.getTransformation(), getTransformation()) && f.getSize() == getSize() && f.getMaxSize() == getMaxSize(); } @Override + @SuppressLint("ToStringReturnsNull") // Since this is used for encoding to xml public String toString() { if (mEncoding == null || mEncoding.getType() == BipEncoding.UNKNOWN diff --git a/android/app/src/com/android/bluetooth/avrcpcontroller/bip/BipImageProperties.java b/android/app/src/com/android/bluetooth/avrcpcontroller/bip/BipImageProperties.java index e49d9dd5a9..442b03f529 100644 --- a/android/app/src/com/android/bluetooth/avrcpcontroller/bip/BipImageProperties.java +++ b/android/app/src/com/android/bluetooth/avrcpcontroller/bip/BipImageProperties.java @@ -16,6 +16,7 @@ package com.android.bluetooth.avrcpcontroller; +import android.annotation.SuppressLint; import android.util.Log; import android.util.Xml; @@ -298,6 +299,7 @@ public class BipImageProperties { } @Override + @SuppressLint("ToStringReturnsNull") // Since this is used for encoding to xml public String toString() { StringWriter writer = new StringWriter(); XmlSerializer xmlMsgElement = Xml.newSerializer(); diff --git a/android/app/src/com/android/bluetooth/avrcpcontroller/bip/BipPixel.java b/android/app/src/com/android/bluetooth/avrcpcontroller/bip/BipPixel.java index f3be13363d..a07b3daf5a 100644 --- a/android/app/src/com/android/bluetooth/avrcpcontroller/bip/BipPixel.java +++ b/android/app/src/com/android/bluetooth/avrcpcontroller/bip/BipPixel.java @@ -197,9 +197,11 @@ public class BipPixel { private static int determinePixelType(String pixel) { if (pixel == null || pixel.length() > 23) return TYPE_UNKNOWN; int delimCount = 0; - for (char c : pixel.toCharArray()) { + for (int i = 0; i < pixel.length(); i++) { + char c = pixel.charAt(i); if (c == '*') delimCount++; } + return delimCount > 0 && delimCount <= 3 ? delimCount : TYPE_UNKNOWN; } @@ -209,10 +211,13 @@ public class BipPixel { @Override public boolean equals(Object o) { - if (o == this) return true; - if (!(o instanceof BipPixel)) return false; + if (o == this) { + return true; + } + if (!(o instanceof BipPixel p)) { + return false; + } - BipPixel p = (BipPixel) o; return p.getType() == getType() && p.getMinWidth() == getMinWidth() && p.getMaxWidth() == getMaxWidth() diff --git a/android/app/src/com/android/bluetooth/avrcpcontroller/bip/BipTransformation.java b/android/app/src/com/android/bluetooth/avrcpcontroller/bip/BipTransformation.java index 31e4f29a86..2e5cf2ced3 100644 --- a/android/app/src/com/android/bluetooth/avrcpcontroller/bip/BipTransformation.java +++ b/android/app/src/com/android/bluetooth/avrcpcontroller/bip/BipTransformation.java @@ -16,6 +16,7 @@ package com.android.bluetooth.avrcpcontroller; +import android.annotation.SuppressLint; import android.util.Log; import com.google.common.base.Ascii; @@ -143,15 +144,21 @@ public class BipTransformation { @Override public boolean equals(Object o) { - if (o == this) return true; - if (o == null && !supportsAny()) return true; - if (!(o instanceof BipTransformation)) return false; + if (o == this) { + return true; + } + if (o == null && !supportsAny()) { + return true; + } + if (!(o instanceof BipTransformation t)) { + return false; + } - BipTransformation t = (BipTransformation) o; return mSupportedTransformations.equals(t.mSupportedTransformations); } @Override + @SuppressLint("ToStringReturnsNull") public String toString() { if (!supportsAny()) return null; StringBuilder transformations = new StringBuilder(); diff --git a/android/app/src/com/android/bluetooth/btservice/ActiveDeviceManager.java b/android/app/src/com/android/bluetooth/btservice/ActiveDeviceManager.java index e9fb75c4a9..b964318759 100644 --- a/android/app/src/com/android/bluetooth/btservice/ActiveDeviceManager.java +++ b/android/app/src/com/android/bluetooth/btservice/ActiveDeviceManager.java @@ -812,7 +812,7 @@ public class ActiveDeviceManager implements AdapterService.BluetoothStateCallbac @Override public void onAudioDevicesRemoved(AudioDeviceInfo[] removedDevices) { Log.d(TAG, "onAudioDevicesRemoved"); - if (!Flags.fallbackWhenWiredAudioDisconnected()) { + if (!Flags.admFallbackWhenWiredAudioDisconnected()) { return; } if (!Arrays.stream(removedDevices) @@ -1121,7 +1121,7 @@ public class ActiveDeviceManager implements AdapterService.BluetoothStateCallbac if (Objects.equals(a2dpFallbackDevice, device)) { Log.d(TAG, "Found an A2DP fallback device: " + device); setA2dpActiveDevice(device); - if (Flags.alwaysFallbackToAvailableDevice()) { + if (Flags.admAlwaysFallbackToAvailableDevice()) { setHfpActiveDevice(headsetFallbackDevice); } else { if (Objects.equals(headsetFallbackDevice, device)) { @@ -1152,7 +1152,7 @@ public class ActiveDeviceManager implements AdapterService.BluetoothStateCallbac if (Objects.equals(headsetFallbackDevice, device)) { Log.d(TAG, "Found a HFP fallback device: " + device); setHfpActiveDevice(device); - if (Flags.alwaysFallbackToAvailableDevice()) { + if (Flags.admAlwaysFallbackToAvailableDevice()) { setA2dpActiveDevice(a2dpFallbackDevice); } else { if (Objects.equals(a2dpFallbackDevice, device)) { diff --git a/android/app/src/com/android/bluetooth/btservice/AdapterProperties.java b/android/app/src/com/android/bluetooth/btservice/AdapterProperties.java index 2eb338c04e..0f4c2cbadb 100644 --- a/android/app/src/com/android/bluetooth/btservice/AdapterProperties.java +++ b/android/app/src/com/android/bluetooth/btservice/AdapterProperties.java @@ -617,7 +617,7 @@ class AdapterProperties { void cleanupPrevBondRecordsFor(BluetoothDevice device) { String address = device.getAddress(); String identityAddress = - Flags.identityAddressNullIfUnknown() + Flags.identityAddressNullIfNotKnown() ? Utils.getBrEdrAddress(device, mService) : mService.getIdentityAddress(address); int deviceType = mRemoteDevices.getDeviceProperties(device).getDeviceType(); @@ -633,7 +633,7 @@ class AdapterProperties { for (BluetoothDevice existingDevice : mBondedDevices) { String existingAddress = existingDevice.getAddress(); String existingIdentityAddress = - Flags.identityAddressNullIfUnknown() + Flags.identityAddressNullIfNotKnown() ? Utils.getBrEdrAddress(existingDevice, mService) : mService.getIdentityAddress(existingAddress); int existingDeviceType = @@ -1185,7 +1185,7 @@ class AdapterProperties { for (BluetoothDevice device : mBondedDevices) { String address = device.getAddress(); String brEdrAddress = - Flags.identityAddressNullIfUnknown() + Flags.identityAddressNullIfNotKnown() ? Utils.getBrEdrAddress(device) : mService.getIdentityAddress(address); if (brEdrAddress.equals(address)) { diff --git a/android/app/src/com/android/bluetooth/btservice/AdapterService.java b/android/app/src/com/android/bluetooth/btservice/AdapterService.java index a4678d629a..95c02297b9 100644 --- a/android/app/src/com/android/bluetooth/btservice/AdapterService.java +++ b/android/app/src/com/android/bluetooth/btservice/AdapterService.java @@ -179,6 +179,7 @@ import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; import java.util.UUID; import java.util.concurrent.CompletableFuture; @@ -1152,7 +1153,9 @@ public class AdapterService extends Service { } private void invalidateBluetoothGetStateCache() { - BluetoothAdapter.invalidateBluetoothGetStateCache(); + if (!Flags.broadcastAdapterStateWithCallback()) { + BluetoothAdapter.invalidateBluetoothGetStateCache(); + } } void updateLeAudioProfileServiceState() { @@ -1183,7 +1186,9 @@ public class AdapterService extends Service { void updateAdapterState(int prevState, int newState) { mAdapterProperties.setState(newState); - invalidateBluetoothGetStateCache(); + if (!Flags.broadcastAdapterStateWithCallback()) { + invalidateBluetoothGetStateCache(); + } // Only BluetoothManagerService should be registered int n = mRemoteCallbacks.beginBroadcast(); @@ -1261,7 +1266,7 @@ public class AdapterService extends Service { .orElse(BluetoothProperties.snoop_log_filter_profile_map_values.EMPTY); if (!(sSnoopLogSettingAtEnable == snoopLogSetting) - || !(sDefaultSnoopLogSettingAtEnable == snoopDefaultModeSetting) + || !(Objects.equals(sDefaultSnoopLogSettingAtEnable, snoopDefaultModeSetting)) || !(sSnoopLogFilterHeadersSettingAtEnable == snoopLogFilterHeadersSettingAtEnable) || !(sSnoopLogFilterProfileA2dpSettingAtEnable @@ -1481,7 +1486,9 @@ public class AdapterService extends Service { BluetoothAdapter.invalidateGetProfileConnectionStateCache(); BluetoothAdapter.invalidateIsOffloadedFilteringSupportedCache(); BluetoothDevice.invalidateBluetoothGetBondStateCache(); - BluetoothAdapter.invalidateBluetoothGetStateCache(); + if (!Flags.broadcastAdapterStateWithCallback()) { + BluetoothAdapter.invalidateBluetoothGetStateCache(); + } BluetoothAdapter.invalidateGetAdapterConnectionStateCache(); BluetoothMap.invalidateBluetoothGetConnectionStateCache(); BluetoothSap.invalidateBluetoothGetConnectionStateCache(); @@ -2239,7 +2246,9 @@ public class AdapterService extends Service { AdapterServiceBinder(AdapterService svc) { mService = svc; - mService.invalidateBluetoothGetStateCache(); + if (!Flags.broadcastAdapterStateWithCallback()) { + mService.invalidateBluetoothGetStateCache(); + } BluetoothAdapter.getDefaultAdapter().disableBluetoothGetStateCache(); } @@ -2250,6 +2259,7 @@ public class AdapterService extends Service { return mService; } + // TODO: b/357645528 - delete getState method @Override public int getState() { AdapterService service = getService(); @@ -2849,7 +2859,7 @@ public class AdapterService extends Service { @Override public int connectAllEnabledProfiles(BluetoothDevice device, AttributionSource source) { AdapterService service = getService(); - if (service == null) { + if (service == null || !service.isEnabled()) { return BluetoothStatusCodes.ERROR_BLUETOOTH_NOT_ENABLED; } if (!callerIsSystemOrActiveOrManagedUser(service, TAG, "connectAllEnabledProfiles")) { @@ -3729,7 +3739,7 @@ public class AdapterService extends Service { service.enforceCallingOrSelfPermission(BLUETOOTH_PRIVILEGED, null); - return service.mDatabaseManager.getCustomMeta(device, key); + return service.getMetadata(device, key); } @Override @@ -3982,6 +3992,24 @@ public class AdapterService extends Service { } @Override + public int isDualModeAudioEnabled(AttributionSource source) { + AdapterService service = getService(); + if (service == null) { + return BluetoothStatusCodes.ERROR_BLUETOOTH_NOT_ENABLED; + } + if (!Utils.checkConnectPermissionForDataDelivery(service, source, TAG)) { + return BluetoothStatusCodes.ERROR_MISSING_BLUETOOTH_CONNECT_PERMISSION; + } + service.enforceCallingOrSelfPermission(BLUETOOTH_PRIVILEGED, null); + + if (!Utils.isDualModeAudioEnabled()) { + return BluetoothStatusCodes.FEATURE_NOT_SUPPORTED; + } + + return BluetoothStatusCodes.SUCCESS; + } + + @Override public int registerPreferredAudioProfilesChangedCallback( IBluetoothPreferredAudioProfilesCallback callback, AttributionSource source) { AdapterService service = getService(); @@ -3999,7 +4027,7 @@ public class AdapterService extends Service { service.enforceCallingOrSelfPermission(BLUETOOTH_PRIVILEGED, null); // If LE only mode is enabled, the dual mode audio feature is disabled - if (!isDualModeAudioEnabled()) { + if (!Utils.isDualModeAudioEnabled()) { return BluetoothStatusCodes.FEATURE_NOT_SUPPORTED; } @@ -4680,7 +4708,7 @@ public class AdapterService extends Service { return Utils.getBytesFromAddress(deviceProp.getIdentityAddress()); } - if (Flags.identityAddressNullIfUnknown()) { + if (Flags.identityAddressNullIfNotKnown()) { // Return null if identity address unknown return null; } else { @@ -4703,7 +4731,7 @@ public class AdapterService extends Service { if (deviceProp != null && deviceProp.getIdentityAddress() != null) { return deviceProp.getIdentityAddress(); } else { - if (Flags.identityAddressNullIfUnknown()) { + if (Flags.identityAddressNullIfNotKnown()) { // Return null if identity address unknown return null; } else { diff --git a/android/app/src/com/android/bluetooth/btservice/BluetoothSocketManagerBinder.java b/android/app/src/com/android/bluetooth/btservice/BluetoothSocketManagerBinder.java index dba4dd5159..d3062c3707 100644 --- a/android/app/src/com/android/bluetooth/btservice/BluetoothSocketManagerBinder.java +++ b/android/app/src/com/android/bluetooth/btservice/BluetoothSocketManagerBinder.java @@ -58,7 +58,7 @@ class BluetoothSocketManagerBinder extends IBluetoothSocketManager.Stub { } String brEdrAddress = - Flags.identityAddressNullIfUnknown() + Flags.identityAddressNullIfNotKnown() ? Utils.getBrEdrAddress(device) : mService.getIdentityAddress(device.getAddress()); diff --git a/android/app/src/com/android/bluetooth/btservice/BondStateMachine.java b/android/app/src/com/android/bluetooth/btservice/BondStateMachine.java index 7eb33a8e05..6909bc6d49 100644 --- a/android/app/src/com/android/bluetooth/btservice/BondStateMachine.java +++ b/android/app/src/com/android/bluetooth/btservice/BondStateMachine.java @@ -202,7 +202,7 @@ final class BondStateMachine extends StateMachine { Log.e( TAG, "In stable state, received invalid newState: " - + state2str(newState)); + + bondStateToString(newState)); } break; case BONDED_INTENT_DELAY: @@ -599,9 +599,9 @@ final class BondStateMachine extends StateMachine { "Bond State Change Intent:" + device + " " - + state2str(oldState) + + bondStateToString(oldState) + " => " - + state2str(newState)); + + bondStateToString(newState)); } void bondStateChangeCallback(int status, byte[] address, int newState, int hciReason) { @@ -803,7 +803,7 @@ final class BondStateMachine extends StateMachine { } } - private String state2str(int state) { + public static String bondStateToString(int state) { if (state == BluetoothDevice.BOND_NONE) { return "BOND_NONE"; } else if (state == BluetoothDevice.BOND_BONDING) { diff --git a/android/app/src/com/android/bluetooth/btservice/MetricsLogger.java b/android/app/src/com/android/bluetooth/btservice/MetricsLogger.java index 5735ae0e3a..4c8c9bc727 100644 --- a/android/app/src/com/android/bluetooth/btservice/MetricsLogger.java +++ b/android/app/src/com/android/bluetooth/btservice/MetricsLogger.java @@ -546,6 +546,21 @@ public class MetricsLogger { BluetoothStatsLog.BLUETOOTH_HASHED_DEVICE_NAME_REPORTED, metricId, sha256); } + public void logBluetoothEvent(BluetoothDevice device, int eventType, int state, int uid) { + + if (mAdapterService.getMetricId(device) == 0 || !mInitialized) { + return; + } + + BluetoothStatsLog.write( + BluetoothStatsLog.BLUETOOTH_CROSS_LAYER_EVENT_REPORTED, + eventType, + state, + uid, + mAdapterService.getMetricId(device), + getRemoteDeviceInfoProto(device)); + } + protected static String getSha256String(String name) { if (name.isEmpty()) { return ""; diff --git a/android/app/src/com/android/bluetooth/btservice/PhonePolicy.java b/android/app/src/com/android/bluetooth/btservice/PhonePolicy.java index 23e97a40c1..3bc46b66e0 100644 --- a/android/app/src/com/android/bluetooth/btservice/PhonePolicy.java +++ b/android/app/src/com/android/bluetooth/btservice/PhonePolicy.java @@ -1125,9 +1125,19 @@ public class PhonePolicy implements AdapterService.BluetoothStateCallback { * @param uuids are the services supported by the remote device */ void onUuidsDiscovered(BluetoothDevice device, ParcelUuid[] uuids) { - debugLog("onUuidsDiscovered: discovered services for device " + device); + int bondState = mAdapterService.getBondState(device); + debugLog( + "onUuidsDiscovered: discovered services for device " + + device + + " (" + + BondStateMachine.bondStateToString(bondState) + + ")"); if (uuids != null) { - processInitProfilePriorities(device, uuids); + if (!Flags.unbondedProfileForbidFix() || bondState != BluetoothDevice.BOND_NONE) { + processInitProfilePriorities(device, uuids); + } else { + debugLog("Device in BOND_NONE state, won't connect profiles" + device); + } } else { warnLog("onUuidsDiscovered: uuids is null for device " + device); } diff --git a/android/app/src/com/android/bluetooth/gatt/GattNativeInterface.java b/android/app/src/com/android/bluetooth/gatt/GattNativeInterface.java index 79f3638f6e..c0a2ca18ef 100644 --- a/android/app/src/com/android/bluetooth/gatt/GattNativeInterface.java +++ b/android/app/src/com/android/bluetooth/gatt/GattNativeInterface.java @@ -438,7 +438,7 @@ public class GattNativeInterface { /** * Connect to the remote Gatt server * - * @see {@link BluetoothDevice#connectGatt} for parameters. + * @see BluetoothDevice#connectGatt for parameters. */ public void gattClientConnect( int clientIf, diff --git a/android/app/src/com/android/bluetooth/hap/HapClientNativeCallback.java b/android/app/src/com/android/bluetooth/hap/HapClientNativeCallback.java new file mode 100644 index 0000000000..3fef07078d --- /dev/null +++ b/android/app/src/com/android/bluetooth/hap/HapClientNativeCallback.java @@ -0,0 +1,179 @@ +/* + * Copyright 2024 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.bluetooth.hap; + +import static com.android.bluetooth.hap.HapClientStackEvent.EVENT_TYPE_CONNECTION_STATE_CHANGED; +import static com.android.bluetooth.hap.HapClientStackEvent.EVENT_TYPE_DEVICE_AVAILABLE; +import static com.android.bluetooth.hap.HapClientStackEvent.EVENT_TYPE_DEVICE_FEATURES; +import static com.android.bluetooth.hap.HapClientStackEvent.EVENT_TYPE_ON_ACTIVE_PRESET_SELECTED; +import static com.android.bluetooth.hap.HapClientStackEvent.EVENT_TYPE_ON_ACTIVE_PRESET_SELECT_ERROR; +import static com.android.bluetooth.hap.HapClientStackEvent.EVENT_TYPE_ON_PRESET_INFO; +import static com.android.bluetooth.hap.HapClientStackEvent.EVENT_TYPE_ON_PRESET_INFO_ERROR; +import static com.android.bluetooth.hap.HapClientStackEvent.EVENT_TYPE_ON_PRESET_NAME_SET_ERROR; + +import static java.util.Objects.requireNonNull; + +import android.bluetooth.BluetoothDevice; +import android.bluetooth.BluetoothHapPresetInfo; + +import com.android.bluetooth.btservice.AdapterService; +import com.android.internal.annotations.VisibleForTesting; + +import java.util.ArrayList; +import java.util.Arrays; + +/** Hearing Access Profile Client Native Callback (from native to Java). */ +public class HapClientNativeCallback { + private static final String TAG = HapClientNativeCallback.class.getSimpleName(); + + private final AdapterService mAdapterService; + private final HapClientService mHapClientService; + + HapClientNativeCallback(AdapterService adapterService, HapClientService hapClientService) { + mAdapterService = requireNonNull(adapterService); + mHapClientService = requireNonNull(hapClientService); + } + + private BluetoothDevice getDevice(byte[] address) { + return mAdapterService.getDeviceFromByte(address); + } + + @VisibleForTesting + void onConnectionStateChanged(int state, byte[] address) { + HapClientStackEvent event = new HapClientStackEvent(EVENT_TYPE_CONNECTION_STATE_CHANGED); + event.device = getDevice(address); + event.valueInt1 = state; + + mHapClientService.messageFromNative(event); + } + + @VisibleForTesting + void onDeviceAvailable(byte[] address, int features) { + HapClientStackEvent event = new HapClientStackEvent(EVENT_TYPE_DEVICE_AVAILABLE); + event.device = getDevice(address); + event.valueInt1 = features; + + mHapClientService.messageFromNative(event); + } + + @VisibleForTesting + void onFeaturesUpdate(byte[] address, int features) { + HapClientStackEvent event = new HapClientStackEvent(EVENT_TYPE_DEVICE_FEATURES); + event.device = getDevice(address); + event.valueInt1 = features; + + mHapClientService.messageFromNative(event); + } + + @VisibleForTesting + void onActivePresetSelected(byte[] address, int presetIndex) { + HapClientStackEvent event = new HapClientStackEvent(EVENT_TYPE_ON_ACTIVE_PRESET_SELECTED); + event.device = getDevice(address); + event.valueInt1 = presetIndex; + + mHapClientService.messageFromNative(event); + } + + @VisibleForTesting + void onActivePresetGroupSelected(int groupId, int presetIndex) { + HapClientStackEvent event = new HapClientStackEvent(EVENT_TYPE_ON_ACTIVE_PRESET_SELECTED); + event.valueInt1 = presetIndex; + event.valueInt2 = groupId; + + mHapClientService.messageFromNative(event); + } + + @VisibleForTesting + void onActivePresetSelectError(byte[] address, int resultCode) { + HapClientStackEvent event = + new HapClientStackEvent(EVENT_TYPE_ON_ACTIVE_PRESET_SELECT_ERROR); + event.device = getDevice(address); + event.valueInt1 = resultCode; + + mHapClientService.messageFromNative(event); + } + + @VisibleForTesting + void onActivePresetGroupSelectError(int groupId, int resultCode) { + HapClientStackEvent event = + new HapClientStackEvent(EVENT_TYPE_ON_ACTIVE_PRESET_SELECT_ERROR); + event.valueInt1 = resultCode; + event.valueInt2 = groupId; + + mHapClientService.messageFromNative(event); + } + + @VisibleForTesting + void onPresetInfo(byte[] address, int infoReason, BluetoothHapPresetInfo[] presets) { + HapClientStackEvent event = new HapClientStackEvent(EVENT_TYPE_ON_PRESET_INFO); + event.device = getDevice(address); + event.valueInt2 = infoReason; + event.valueList = new ArrayList<>(Arrays.asList(presets)); + + mHapClientService.messageFromNative(event); + } + + @VisibleForTesting + void onGroupPresetInfo(int groupId, int infoReason, BluetoothHapPresetInfo[] presets) { + HapClientStackEvent event = new HapClientStackEvent(EVENT_TYPE_ON_PRESET_INFO); + event.valueInt2 = infoReason; + event.valueInt3 = groupId; + event.valueList = new ArrayList<>(Arrays.asList(presets)); + + mHapClientService.messageFromNative(event); + } + + @VisibleForTesting + void onPresetNameSetError(byte[] address, int presetIndex, int resultCode) { + HapClientStackEvent event = new HapClientStackEvent(EVENT_TYPE_ON_PRESET_NAME_SET_ERROR); + event.device = getDevice(address); + event.valueInt1 = resultCode; + event.valueInt2 = presetIndex; + + mHapClientService.messageFromNative(event); + } + + @VisibleForTesting + void onGroupPresetNameSetError(int groupId, int presetIndex, int resultCode) { + HapClientStackEvent event = new HapClientStackEvent(EVENT_TYPE_ON_PRESET_NAME_SET_ERROR); + event.valueInt1 = resultCode; + event.valueInt2 = presetIndex; + event.valueInt3 = groupId; + + mHapClientService.messageFromNative(event); + } + + @VisibleForTesting + void onPresetInfoError(byte[] address, int presetIndex, int resultCode) { + HapClientStackEvent event = new HapClientStackEvent(EVENT_TYPE_ON_PRESET_INFO_ERROR); + event.device = getDevice(address); + event.valueInt1 = resultCode; + event.valueInt2 = presetIndex; + + mHapClientService.messageFromNative(event); + } + + @VisibleForTesting + void onGroupPresetInfoError(int groupId, int presetIndex, int resultCode) { + HapClientStackEvent event = new HapClientStackEvent(EVENT_TYPE_ON_PRESET_INFO_ERROR); + event.valueInt1 = resultCode; + event.valueInt2 = presetIndex; + event.valueInt3 = groupId; + + mHapClientService.messageFromNative(event); + } +} diff --git a/android/app/src/com/android/bluetooth/hap/HapClientNativeInterface.java b/android/app/src/com/android/bluetooth/hap/HapClientNativeInterface.java index a2e345e6fa..6160e4efa9 100644 --- a/android/app/src/com/android/bluetooth/hap/HapClientNativeInterface.java +++ b/android/app/src/com/android/bluetooth/hap/HapClientNativeInterface.java @@ -17,63 +17,32 @@ package com.android.bluetooth.hap; -import android.bluetooth.BluetoothAdapter; +import static java.util.Objects.requireNonNull; + import android.bluetooth.BluetoothDevice; -import android.bluetooth.BluetoothHapPresetInfo; -import android.util.Log; import com.android.bluetooth.Utils; -import com.android.internal.annotations.VisibleForTesting; -import java.util.ArrayList; -import java.util.Arrays; +import java.lang.annotation.Native; /** Hearing Access Profile Client Native Interface to/from JNI. */ public class HapClientNativeInterface { private static final String TAG = HapClientNativeInterface.class.getSimpleName(); - private final BluetoothAdapter mAdapter; + @Native private final HapClientNativeCallback mHapClientNativeCallback; - public HapClientNativeInterface() { - mAdapter = BluetoothAdapter.getDefaultAdapter(); - if (mAdapter == null) { - Log.wtf(TAG, "No Bluetooth Adapter Available"); - } + public HapClientNativeInterface(HapClientNativeCallback hapClientNativeCallback) { + mHapClientNativeCallback = requireNonNull(hapClientNativeCallback); } - /** - * Initiates HapClientService connection to a remote device. - * - * @param device the remote device - * @return true on success, otherwise false. - */ - @VisibleForTesting(visibility = VisibleForTesting.Visibility.PACKAGE) - public boolean connectHapClient(BluetoothDevice device) { + boolean connectHapClient(BluetoothDevice device) { return connectHapClientNative(getByteAddress(device)); } - /** - * Disconnects HapClientService from a remote device. - * - * @param device the remote device - * @return true on success, otherwise false. - */ - @VisibleForTesting(visibility = VisibleForTesting.Visibility.PACKAGE) - public boolean disconnectHapClient(BluetoothDevice device) { + boolean disconnectHapClient(BluetoothDevice device) { return disconnectHapClientNative(getByteAddress(device)); } - /** - * Gets a HapClientService device - * - * @param address the remote device address - * @return Bluetooth Device. - */ - @VisibleForTesting(visibility = VisibleForTesting.Visibility.PACKAGE) - public BluetoothDevice getDevice(byte[] address) { - return mAdapter.getRemoteDevice(address); - } - private byte[] getByteAddress(BluetoothDevice device) { if (device == null) { return Utils.getBytesFromAddress("00:00:00:00:00:00"); @@ -81,280 +50,50 @@ public class HapClientNativeInterface { return Utils.getBytesFromAddress(device.getAddress()); } - @VisibleForTesting(visibility = VisibleForTesting.Visibility.PACKAGE) - void sendMessageToService(HapClientStackEvent event) { - HapClientService service = HapClientService.getHapClientService(); - if (service != null) { - service.messageFromNative(event); - } else { - Log.e(TAG, "Event ignored, service not available: " + event); - } - } - - /** Initializes the native interface. */ - @VisibleForTesting(visibility = VisibleForTesting.Visibility.PACKAGE) - public void init() { + void init() { initNative(); } - /** Cleanup the native interface. */ - @VisibleForTesting(visibility = VisibleForTesting.Visibility.PACKAGE) - public void cleanup() { + void cleanup() { cleanupNative(); } - /** - * Selects the currently active preset for a HA device - * - * @param device is the device for which we want to set the active preset - * @param presetIndex is an index of one of the available presets - */ - @VisibleForTesting(visibility = VisibleForTesting.Visibility.PACKAGE) - public void selectActivePreset(BluetoothDevice device, int presetIndex) { + void selectActivePreset(BluetoothDevice device, int presetIndex) { selectActivePresetNative(getByteAddress(device), presetIndex); } - /** - * Selects the currently active preset for a HA device group. - * - * @param groupId is the device group identifier for which want to set the active preset - * @param presetIndex is an index of one of the available presets - */ - @VisibleForTesting(visibility = VisibleForTesting.Visibility.PACKAGE) - public void groupSelectActivePreset(int groupId, int presetIndex) { + void groupSelectActivePreset(int groupId, int presetIndex) { groupSelectActivePresetNative(groupId, presetIndex); } - /** - * Sets the next preset as a currently active preset for a HA device - * - * @param device is the device for which we want to set the active preset - */ - @VisibleForTesting(visibility = VisibleForTesting.Visibility.PACKAGE) - public void nextActivePreset(BluetoothDevice device) { + void nextActivePreset(BluetoothDevice device) { nextActivePresetNative(getByteAddress(device)); } - /** - * Sets the next preset as a currently active preset for a HA device group - * - * @param groupId is the device group identifier for which want to set the active preset - */ - @VisibleForTesting(visibility = VisibleForTesting.Visibility.PACKAGE) - public void groupNextActivePreset(int groupId) { + void groupNextActivePreset(int groupId) { groupNextActivePresetNative(groupId); } - /** - * Sets the previous preset as a currently active preset for a HA device - * - * @param device is the device for which we want to set the active preset - */ - @VisibleForTesting(visibility = VisibleForTesting.Visibility.PACKAGE) - public void previousActivePreset(BluetoothDevice device) { + void previousActivePreset(BluetoothDevice device) { previousActivePresetNative(getByteAddress(device)); } - /** - * Sets the previous preset as a currently active preset for a HA device group - * - * @param groupId is the device group identifier for which want to set the active preset - */ - @VisibleForTesting(visibility = VisibleForTesting.Visibility.PACKAGE) - public void groupPreviousActivePreset(int groupId) { + void groupPreviousActivePreset(int groupId) { groupPreviousActivePresetNative(groupId); } - /** - * Requests the preset name - * - * @param device is the device for which we want to get the preset name - * @param presetIndex is an index of one of the available presets - */ - @VisibleForTesting(visibility = VisibleForTesting.Visibility.PACKAGE) - public void getPresetInfo(BluetoothDevice device, int presetIndex) { + void getPresetInfo(BluetoothDevice device, int presetIndex) { getPresetInfoNative(getByteAddress(device), presetIndex); } - /** - * Sets the preset name - * - * @param device is the device for which we want to get the preset name - * @param presetIndex is an index of one of the available presets - * @param name is a new name for a preset - */ - @VisibleForTesting(visibility = VisibleForTesting.Visibility.PACKAGE) - public void setPresetName(BluetoothDevice device, int presetIndex, String name) { + void setPresetName(BluetoothDevice device, int presetIndex, String name) { setPresetNameNative(getByteAddress(device), presetIndex, name); } - /** - * Sets the preset name - * - * @param groupId is the device group - * @param presetIndex is an index of one of the available presets - * @param name is a new name for a preset - */ - @VisibleForTesting(visibility = VisibleForTesting.Visibility.PACKAGE) - public void groupSetPresetName(int groupId, int presetIndex, String name) { + void groupSetPresetName(int groupId, int presetIndex, String name) { groupSetPresetNameNative(groupId, presetIndex, name); } - // Callbacks from the native stack back into the Java framework. - // All callbacks are routed via the Service which will disambiguate which - // state machine the message should be routed to. - - @VisibleForTesting - void onConnectionStateChanged(int state, byte[] address) { - HapClientStackEvent event = - new HapClientStackEvent(HapClientStackEvent.EVENT_TYPE_CONNECTION_STATE_CHANGED); - event.device = getDevice(address); - event.valueInt1 = state; - - Log.d(TAG, "onConnectionStateChanged: " + event); - sendMessageToService(event); - } - - @VisibleForTesting - void onDeviceAvailable(byte[] address, int features) { - HapClientStackEvent event = - new HapClientStackEvent(HapClientStackEvent.EVENT_TYPE_DEVICE_AVAILABLE); - event.device = getDevice(address); - event.valueInt1 = features; - - Log.d(TAG, "onDeviceAvailable: " + event); - sendMessageToService(event); - } - - @VisibleForTesting - void onFeaturesUpdate(byte[] address, int features) { - HapClientStackEvent event = - new HapClientStackEvent(HapClientStackEvent.EVENT_TYPE_DEVICE_FEATURES); - event.device = getDevice(address); - event.valueInt1 = features; - - Log.d(TAG, "onFeaturesUpdate: " + event); - sendMessageToService(event); - } - - @VisibleForTesting - void onActivePresetSelected(byte[] address, int presetIndex) { - HapClientStackEvent event = - new HapClientStackEvent(HapClientStackEvent.EVENT_TYPE_ON_ACTIVE_PRESET_SELECTED); - event.device = getDevice(address); - event.valueInt1 = presetIndex; - - Log.d(TAG, "onActivePresetSelected: " + event); - sendMessageToService(event); - } - - @VisibleForTesting - void onActivePresetGroupSelected(int groupId, int presetIndex) { - HapClientStackEvent event = - new HapClientStackEvent(HapClientStackEvent.EVENT_TYPE_ON_ACTIVE_PRESET_SELECTED); - event.valueInt1 = presetIndex; - event.valueInt2 = groupId; - - Log.d(TAG, "onActivePresetGroupSelected: " + event); - sendMessageToService(event); - } - - @VisibleForTesting - void onActivePresetSelectError(byte[] address, int resultCode) { - HapClientStackEvent event = - new HapClientStackEvent( - HapClientStackEvent.EVENT_TYPE_ON_ACTIVE_PRESET_SELECT_ERROR); - event.device = getDevice(address); - event.valueInt1 = resultCode; - - Log.d(TAG, "onActivePresetSelectError: " + event); - sendMessageToService(event); - } - - @VisibleForTesting - void onActivePresetGroupSelectError(int groupId, int resultCode) { - HapClientStackEvent event = - new HapClientStackEvent( - HapClientStackEvent.EVENT_TYPE_ON_ACTIVE_PRESET_SELECT_ERROR); - event.valueInt1 = resultCode; - event.valueInt2 = groupId; - - Log.d(TAG, "onActivePresetGroupSelectError: " + event); - sendMessageToService(event); - } - - @VisibleForTesting - void onPresetInfo(byte[] address, int infoReason, BluetoothHapPresetInfo[] presets) { - HapClientStackEvent event = - new HapClientStackEvent(HapClientStackEvent.EVENT_TYPE_ON_PRESET_INFO); - event.device = getDevice(address); - event.valueInt2 = infoReason; - event.valueList = new ArrayList<>(Arrays.asList(presets)); - - Log.d(TAG, "onPresetInfo: " + event); - sendMessageToService(event); - } - - @VisibleForTesting - void onGroupPresetInfo(int groupId, int infoReason, BluetoothHapPresetInfo[] presets) { - HapClientStackEvent event = - new HapClientStackEvent(HapClientStackEvent.EVENT_TYPE_ON_PRESET_INFO); - event.valueInt2 = infoReason; - event.valueInt3 = groupId; - event.valueList = new ArrayList<>(Arrays.asList(presets)); - - Log.d(TAG, "onGroupPresetInfo: " + event); - sendMessageToService(event); - } - - @VisibleForTesting - void onPresetNameSetError(byte[] address, int presetIndex, int resultCode) { - HapClientStackEvent event = - new HapClientStackEvent(HapClientStackEvent.EVENT_TYPE_ON_PRESET_NAME_SET_ERROR); - event.device = getDevice(address); - event.valueInt1 = resultCode; - event.valueInt2 = presetIndex; - - Log.d(TAG, "onPresetNameSetError: " + event); - sendMessageToService(event); - } - - @VisibleForTesting - void onGroupPresetNameSetError(int groupId, int presetIndex, int resultCode) { - HapClientStackEvent event = - new HapClientStackEvent(HapClientStackEvent.EVENT_TYPE_ON_PRESET_NAME_SET_ERROR); - event.valueInt1 = resultCode; - event.valueInt2 = presetIndex; - event.valueInt3 = groupId; - - Log.d(TAG, "onGroupPresetNameSetError: " + event); - sendMessageToService(event); - } - - @VisibleForTesting - void onPresetInfoError(byte[] address, int presetIndex, int resultCode) { - HapClientStackEvent event = - new HapClientStackEvent(HapClientStackEvent.EVENT_TYPE_ON_PRESET_INFO_ERROR); - event.device = getDevice(address); - event.valueInt1 = resultCode; - event.valueInt2 = presetIndex; - - Log.d(TAG, "onPresetInfoError: " + event); - sendMessageToService(event); - } - - @VisibleForTesting - void onGroupPresetInfoError(int groupId, int presetIndex, int resultCode) { - HapClientStackEvent event = - new HapClientStackEvent(HapClientStackEvent.EVENT_TYPE_ON_PRESET_INFO_ERROR); - event.valueInt1 = resultCode; - event.valueInt2 = presetIndex; - event.valueInt3 = groupId; - - Log.d(TAG, "onGroupPresetInfoError: " + event); - sendMessageToService(event); - } - // Native methods that call into the JNI interface private native void initNative(); diff --git a/android/app/src/com/android/bluetooth/hap/HapClientService.java b/android/app/src/com/android/bluetooth/hap/HapClientService.java index 104cd4eb3e..5a00d70a47 100644 --- a/android/app/src/com/android/bluetooth/hap/HapClientService.java +++ b/android/app/src/com/android/bluetooth/hap/HapClientService.java @@ -21,6 +21,7 @@ import static android.Manifest.permission.BLUETOOTH_CONNECT; import static android.Manifest.permission.BLUETOOTH_PRIVILEGED; import static java.util.Objects.requireNonNull; +import static java.util.Objects.requireNonNullElse; import android.bluetooth.BluetoothCsipSetCoordinator; import android.bluetooth.BluetoothDevice; @@ -113,14 +114,18 @@ public class HapClientService extends ProfileService { } public HapClientService(AdapterService adapterService) { - this(adapterService, new HapClientNativeInterface()); + this(adapterService, null); } @VisibleForTesting HapClientService(AdapterService adapterService, HapClientNativeInterface nativeInterface) { super(adapterService); mAdapterService = requireNonNull(adapterService); - mHapClientNativeInterface = requireNonNull(nativeInterface); + mHapClientNativeInterface = + requireNonNullElse( + nativeInterface, + new HapClientNativeInterface( + new HapClientNativeCallback(adapterService, this))); mDatabaseManager = requireNonNull(mAdapterService.getDatabase()); // Start handler thread for state machines @@ -796,6 +801,10 @@ public class HapClientService extends ProfileService { } void messageFromNative(HapClientStackEvent stackEvent) { + if (!isAvailable()) { + Log.e(TAG, "Event ignored, service not available: " + stackEvent); + return; + } // Decide which event should be sent to the state machine if (stackEvent.type == HapClientStackEvent.EVENT_TYPE_CONNECTION_STATE_CHANGED) { resendToStateMachine(stackEvent); diff --git a/android/app/src/com/android/bluetooth/hfp/HeadsetNativeInterface.java b/android/app/src/com/android/bluetooth/hfp/HeadsetNativeInterface.java index 6167229c69..2a6bda80b2 100644 --- a/android/app/src/com/android/bluetooth/hfp/HeadsetNativeInterface.java +++ b/android/app/src/com/android/bluetooth/hfp/HeadsetNativeInterface.java @@ -94,7 +94,7 @@ public class HeadsetNativeInterface { // Set bt_stack's active device to default if java layer set active device to null return Utils.getBytesFromAddress("00:00:00:00:00:00"); } - if (Flags.identityAddressNullIfUnknown()) { + if (Flags.identityAddressNullIfNotKnown()) { return Utils.getByteBrEdrAddress(device); } else { return mAdapterService.getByteIdentityAddress(device); diff --git a/android/app/src/com/android/bluetooth/hfpclient/HeadsetClientService.java b/android/app/src/com/android/bluetooth/hfpclient/HeadsetClientService.java index 5cf475cd7a..55830c2861 100644 --- a/android/app/src/com/android/bluetooth/hfpclient/HeadsetClientService.java +++ b/android/app/src/com/android/bluetooth/hfpclient/HeadsetClientService.java @@ -17,6 +17,7 @@ package com.android.bluetooth.hfpclient; import static android.Manifest.permission.BLUETOOTH_CONNECT; +import static android.Manifest.permission.BLUETOOTH_PRIVILEGED; import static android.content.pm.PackageManager.FEATURE_WATCH; import android.annotation.RequiresPermission; @@ -77,7 +78,7 @@ public class HeadsetClientService extends ProfileService { private AudioManager mAudioManager = null; private BatteryManager mBatteryManager = null; private int mLastBatteryLevel = -1; - // Maxinum number of devices we can try connecting to in one session + // Maximum number of devices we can try connecting to in one session private static final int MAX_STATE_MACHINES_POSSIBLE = 100; private final Object mStartStopLock = new Object(); @@ -335,6 +336,8 @@ public class HeadsetClientService extends ProfileService { return Collections.emptyList(); } + service.enforceCallingPermission(BLUETOOTH_PRIVILEGED, null); + return service.getConnectedDevices(); } @@ -346,6 +349,8 @@ public class HeadsetClientService extends ProfileService { return Collections.emptyList(); } + service.enforceCallingPermission(BLUETOOTH_PRIVILEGED, null); + return service.getDevicesMatchingConnectionStates(states); } @@ -356,6 +361,8 @@ public class HeadsetClientService extends ProfileService { return BluetoothProfile.STATE_DISCONNECTED; } + service.enforceCallingPermission(BLUETOOTH_PRIVILEGED, null); + return service.getConnectionState(device); } @@ -367,6 +374,8 @@ public class HeadsetClientService extends ProfileService { return false; } + service.enforceCallingPermission(BLUETOOTH_PRIVILEGED, null); + return service.setConnectionPolicy(device, connectionPolicy); } @@ -377,6 +386,8 @@ public class HeadsetClientService extends ProfileService { return BluetoothProfile.CONNECTION_POLICY_UNKNOWN; } + service.enforceCallingPermission(BLUETOOTH_PRIVILEGED, null); + return service.getConnectionPolicy(device); } @@ -572,6 +583,8 @@ public class HeadsetClientService extends ProfileService { return null; } + service.enforceCallingPermission(BLUETOOTH_PRIVILEGED, null); + return service.getCurrentAgEvents(device); } diff --git a/android/app/src/com/android/bluetooth/hfpclient/HeadsetClientStateMachine.java b/android/app/src/com/android/bluetooth/hfpclient/HeadsetClientStateMachine.java index e26b91f048..8c2f9fbf25 100644 --- a/android/app/src/com/android/bluetooth/hfpclient/HeadsetClientStateMachine.java +++ b/android/app/src/com/android/bluetooth/hfpclient/HeadsetClientStateMachine.java @@ -1787,6 +1787,7 @@ public class HeadsetClientStateMachine extends StateMachine { break; case SEND_ANDROID_AT_COMMAND: debug("Connected: Received OK for AT+ANDROID"); + break; default: warn("Unhandled AT OK " + event); break; diff --git a/android/app/src/com/android/bluetooth/hfpclient/HfpClientConnection.java b/android/app/src/com/android/bluetooth/hfpclient/HfpClientConnection.java index 66d323a04c..443eb3edf6 100644 --- a/android/app/src/com/android/bluetooth/hfpclient/HfpClientConnection.java +++ b/android/app/src/com/android/bluetooth/hfpclient/HfpClientConnection.java @@ -277,11 +277,11 @@ public class HfpClientConnection extends Connection { @Override public boolean equals(Object o) { - if (!(o instanceof HfpClientConnection)) { + if (!(o instanceof HfpClientConnection h)) { return false; } - Uri otherAddr = ((HfpClientConnection) o).getAddress(); - return getAddress() == otherAddr || otherAddr != null && otherAddr.equals(getAddress()); + + return Objects.equals(h.getAddress(), getAddress()); } @Override diff --git a/android/app/src/com/android/bluetooth/hfpclient/NativeInterface.java b/android/app/src/com/android/bluetooth/hfpclient/NativeInterface.java index 3044077b7d..914416b0ec 100644 --- a/android/app/src/com/android/bluetooth/hfpclient/NativeInterface.java +++ b/android/app/src/com/android/bluetooth/hfpclient/NativeInterface.java @@ -337,7 +337,7 @@ public class NativeInterface { } private byte[] getByteAddress(BluetoothDevice device) { - if (Flags.identityAddressNullIfUnknown()) { + if (Flags.identityAddressNullIfNotKnown()) { return Utils.getByteBrEdrAddress(device); } else { return mAdapterService.getByteIdentityAddress(device); diff --git a/android/app/src/com/android/bluetooth/hid/HidDeviceNativeInterface.java b/android/app/src/com/android/bluetooth/hid/HidDeviceNativeInterface.java index 81a43d245d..634d9c0cb8 100644 --- a/android/app/src/com/android/bluetooth/hid/HidDeviceNativeInterface.java +++ b/android/app/src/com/android/bluetooth/hid/HidDeviceNativeInterface.java @@ -277,7 +277,7 @@ public class HidDeviceNativeInterface { } private byte[] getByteAddress(BluetoothDevice device) { - if (Flags.identityAddressNullIfUnknown()) { + if (Flags.identityAddressNullIfNotKnown()) { return Utils.getByteBrEdrAddress(device); } else { return mAdapterService.getByteIdentityAddress(device); diff --git a/android/app/src/com/android/bluetooth/hid/HidHostService.java b/android/app/src/com/android/bluetooth/hid/HidHostService.java index 4189cec8e7..fcf72e893a 100644 --- a/android/app/src/com/android/bluetooth/hid/HidHostService.java +++ b/android/app/src/com/android/bluetooth/hid/HidHostService.java @@ -188,7 +188,7 @@ public class HidHostService extends ProfileService { } private byte[] getIdentityAddress(BluetoothDevice device) { - if (Flags.identityAddressNullIfUnknown()) { + if (Flags.identityAddressNullIfNotKnown()) { return Utils.getByteBrEdrAddress(mAdapterService, device); } else { return mAdapterService.getByteIdentityAddress(device); diff --git a/android/app/src/com/android/bluetooth/le_audio/LeAudioService.java b/android/app/src/com/android/bluetooth/le_audio/LeAudioService.java index 17313b0946..f77ef57728 100644 --- a/android/app/src/com/android/bluetooth/le_audio/LeAudioService.java +++ b/android/app/src/com/android/bluetooth/le_audio/LeAudioService.java @@ -2273,7 +2273,7 @@ public class LeAudioService extends ProfileService { /* Make sure active group is already exposed to audio framework. * If not, lets wait for it and don't sent additional intent. */ - if (groupDescriptor.mCurrentLeadDevice == mExposedActiveDevice) { + if (Objects.equals(groupDescriptor.mCurrentLeadDevice, mExposedActiveDevice)) { Log.w( TAG, "group is already active: device=" @@ -2568,6 +2568,7 @@ public class LeAudioService extends ProfileService { groupDescriptor.mInactivatedDueToContextType = true; setActiveGroupWithDevice(null, false); } + break; default: break; } @@ -4302,8 +4303,8 @@ public class LeAudioService extends ProfileService { */ public void setCcidInformation(ParcelUuid userUuid, int ccid, int contextType) { /* for the moment we care only for GMCS and GTBS */ - if (userUuid != BluetoothUuid.GENERIC_MEDIA_CONTROL - && userUuid.getUuid() != TbsGatt.UUID_GTBS) { + if (!BluetoothUuid.GENERIC_MEDIA_CONTROL.equals(userUuid) + && !TbsGatt.UUID_GTBS.equals(userUuid.getUuid())) { return; } if (!mLeAudioNativeIsInitialized) { diff --git a/android/app/src/com/android/bluetooth/le_scan/AppScanStats.java b/android/app/src/com/android/bluetooth/le_scan/AppScanStats.java index 5e15fdaba2..773bdd5432 100644 --- a/android/app/src/com/android/bluetooth/le_scan/AppScanStats.java +++ b/android/app/src/com/android/bluetooth/le_scan/AppScanStats.java @@ -619,8 +619,8 @@ public class AppScanStats { if (Flags.bleScanAdvMetricsRedesign()) { logger.logRadioScanStopped( - sRadioScanWorkSourceUtil.getUids(), - sRadioScanWorkSourceUtil.getTags(), + getRadioScanUids(), + getRadioScanTags(), sRadioScanType, convertScanMode(sRadioScanMode), sRadioScanIntervalMs, @@ -644,6 +644,22 @@ public class AppScanStats { } } + private static int[] getRadioScanUids() { + synchronized (sLock) { + return sRadioScanWorkSourceUtil != null + ? sRadioScanWorkSourceUtil.getUids() + : new int[] {0}; + } + } + + private static String[] getRadioScanTags() { + synchronized (sLock) { + return sRadioScanWorkSourceUtil != null + ? sRadioScanWorkSourceUtil.getTags() + : new String[] {""}; + } + } + @GuardedBy("sLock") private static void recordScreenOnOffMetrics(boolean isScreenOn) { if (isScreenOn) { @@ -680,8 +696,8 @@ public class AppScanStats { if (Flags.bleScanAdvMetricsRedesign()) { BluetoothStatsLog.write( BluetoothStatsLog.LE_SCAN_RESULT_RECEIVED, - sRadioScanWorkSourceUtil.getUids(), - sRadioScanWorkSourceUtil.getTags(), + getRadioScanUids(), + getRadioScanTags(), 1 /* num_results */, BluetoothStatsLog.LE_SCAN_RESULT_RECEIVED__LE_SCAN_TYPE__SCAN_TYPE_REGULAR, sIsScreenOn); @@ -704,8 +720,8 @@ public class AppScanStats { if (Flags.bleScanAdvMetricsRedesign()) { BluetoothStatsLog.write( BluetoothStatsLog.LE_SCAN_RESULT_RECEIVED, - sRadioScanWorkSourceUtil.getUids(), - sRadioScanWorkSourceUtil.getTags(), + getRadioScanUids(), + getRadioScanTags(), numRecords, BluetoothStatsLog.LE_SCAN_RESULT_RECEIVED__LE_SCAN_TYPE__SCAN_TYPE_BATCH, sIsScreenOn); diff --git a/android/app/src/com/android/bluetooth/le_scan/ScanClient.java b/android/app/src/com/android/bluetooth/le_scan/ScanClient.java index f4055ab073..dd1589e5a0 100644 --- a/android/app/src/com/android/bluetooth/le_scan/ScanClient.java +++ b/android/app/src/com/android/bluetooth/le_scan/ScanClient.java @@ -70,10 +70,9 @@ public class ScanClient { if (this == obj) { return true; } - if (obj == null || getClass() != obj.getClass()) { + if (!(obj instanceof ScanClient other)) { return false; } - ScanClient other = (ScanClient) obj; return scannerId == other.scannerId; } diff --git a/android/app/src/com/android/bluetooth/le_scan/ScanManager.java b/android/app/src/com/android/bluetooth/le_scan/ScanManager.java index 6269e1007f..53678b2024 100644 --- a/android/app/src/com/android/bluetooth/le_scan/ScanManager.java +++ b/android/app/src/com/android/bluetooth/le_scan/ScanManager.java @@ -16,6 +16,8 @@ package com.android.bluetooth.le_scan; +import static android.bluetooth.le.ScanSettings.getScanModeString; + import android.app.ActivityManager; import android.app.AlarmManager; import android.app.PendingIntent; @@ -62,6 +64,7 @@ import java.util.Map; import java.util.Set; import java.util.UUID; import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicReference; /** Class that handles Bluetooth LE scan related operations. */ public class ScanManager { @@ -118,8 +121,6 @@ public class ScanManager { private final Context mContext; private final TransitionalScanHelper mScanHelper; private final AdapterService mAdapterService; - private BroadcastReceiver mBatchAlarmReceiver; - private boolean mBatchAlarmReceiverRegistered; private ScanNative mScanNative; private volatile ClientHandler mHandler; private BluetoothAdapterProxy mBluetoothAdapterProxy; @@ -369,6 +370,7 @@ public class ScanManager { break; case MSG_BT_PROFILE_CONN_STATE_CHANGED: handleProfileConnectionStateChanged(msg); + break; default: // Shouldn't happen. Log.e(TAG, "received an unknown message : " + msg.what); @@ -648,7 +650,7 @@ public class ScanManager { Log.d( TAG, "Scan mode update during setAutoBatchScanClient() to " - + ScanSettings.SCAN_MODE_SCREEN_OFF); + + getScanModeString(ScanSettings.SCAN_MODE_SCREEN_OFF)); if (client.stats != null) { client.stats.setAutoBatchScan(client.scannerId, true); } @@ -661,7 +663,8 @@ public class ScanManager { client.updateScanMode(client.scanModeApp); Log.d( TAG, - "Scan mode update during clearAutoBatchScanClient() to " + client.scanModeApp); + "Scan mode update during clearAutoBatchScanClient() to " + + getScanModeString(client.scanModeApp)); if (client.stats != null) { client.stats.setAutoBatchScan(client.scannerId, false); } @@ -708,9 +711,9 @@ public class ScanManager { Log.d( TAG, "Scan mode update during screen off from " - + client.scanModeApp + + getScanModeString(client.scanModeApp) + " to " - + updatedScanMode); + + getScanModeString(updatedScanMode)); return client.updateScanMode(updatedScanMode); } @@ -824,9 +827,9 @@ public class ScanManager { Log.d( TAG, "Scan mode update during screen on from " - + client.scanModeApp + + getScanModeString(client.scanModeApp) + " to " - + getMinScanMode(scanMode, maxScanMode)); + + getScanModeString(getMinScanMode(scanMode, maxScanMode))); return client.updateScanMode(getMinScanMode(scanMode, maxScanMode)); } @@ -940,10 +943,9 @@ public class ScanManager { if (this == obj) { return true; } - if (obj == null || getClass() != obj.getClass()) { + if (!(obj instanceof BatchScanParams other)) { return false; } - BatchScanParams other = (BatchScanParams) obj; return scanMode == other.scanMode && fullScanscannerId == other.fullScanscannerId && truncatedScanscannerId == other.truncatedScanscannerId; @@ -990,9 +992,12 @@ public class ScanManager { private final Set<Integer> mAllPassRegularClients = new HashSet<>(); private final Set<Integer> mAllPassBatchClients = new HashSet<>(); - private AlarmManager mAlarmManager; - private PendingIntent mBatchScanIntervalIntent; - private ScanNativeInterface mNativeInterface; + private final AtomicReference<BroadcastReceiver> mBatchAlarmReceiver = + new AtomicReference<>(); + + private final AlarmManager mAlarmManager; + private final PendingIntent mBatchScanIntervalIntent; + private final ScanNativeInterface mNativeInterface; ScanNative(TransitionalScanHelper scanHelper) { mNativeInterface = ScanObjectsFactory.getInstance().getScanNativeInterface(); @@ -1008,7 +1013,7 @@ public class ScanManager { IntentFilter filter = new IntentFilter(); filter.setPriority(IntentFilter.SYSTEM_HIGH_PRIORITY); filter.addAction(ACTION_REFRESH_BATCHED_SCAN); - mBatchAlarmReceiver = + mBatchAlarmReceiver.set( new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { @@ -1025,9 +1030,8 @@ public class ScanManager { } } } - }; - mContext.registerReceiver(mBatchAlarmReceiver, filter); - mBatchAlarmReceiverRegistered = true; + }); + mContext.registerReceiver(mBatchAlarmReceiver.get(), filter); } private void callbackDone(int scannerId, int status) { @@ -1481,10 +1485,10 @@ public class ScanManager { void cleanup() { mAlarmManager.cancel(mBatchScanIntervalIntent); // Protect against multiple calls of cleanup. - if (mBatchAlarmReceiverRegistered) { - mContext.unregisterReceiver(mBatchAlarmReceiver); + BroadcastReceiver receiver = mBatchAlarmReceiver.getAndSet(null); + if (receiver != null) { + mContext.unregisterReceiver(receiver); } - mBatchAlarmReceiverRegistered = false; mNativeInterface.cleanup(); } @@ -2101,7 +2105,7 @@ public class ScanManager { + " isForeground " + isForeground + " scanMode " - + client.settings.getScanMode()); + + getScanModeString(client.settings.getScanMode())); } if (updatedScanParams) { diff --git a/android/app/src/com/android/bluetooth/le_scan/TransitionalScanHelper.java b/android/app/src/com/android/bluetooth/le_scan/TransitionalScanHelper.java index 45d7e427aa..7268160dd3 100644 --- a/android/app/src/com/android/bluetooth/le_scan/TransitionalScanHelper.java +++ b/android/app/src/com/android/bluetooth/le_scan/TransitionalScanHelper.java @@ -16,7 +16,6 @@ package com.android.bluetooth.le_scan; -import static android.Manifest.permission.BLUETOOTH_CONNECT; import static android.Manifest.permission.BLUETOOTH_PRIVILEGED; import static android.Manifest.permission.BLUETOOTH_SCAN; import static android.Manifest.permission.UPDATE_DEVICE_STATS; @@ -1434,9 +1433,9 @@ public class TransitionalScanHelper { mPeriodicScanManager.transferSetInfo(bda, serviceData, advHandle, callback); } - @RequiresPermission(BLUETOOTH_CONNECT) + @RequiresPermission(BLUETOOTH_SCAN) public int numHwTrackFiltersAvailable(AttributionSource attributionSource) { - if (!Utils.checkConnectPermissionForDataDelivery( + if (!Utils.checkScanPermissionForDataDelivery( mContext, attributionSource, "ScanHelper numHwTrackFiltersAvailable")) { return 0; } diff --git a/android/app/src/com/android/bluetooth/map/BluetoothMapAccountItem.java b/android/app/src/com/android/bluetooth/map/BluetoothMapAccountItem.java index 771d7d4cc9..d1a77bb469 100644 --- a/android/app/src/com/android/bluetooth/map/BluetoothMapAccountItem.java +++ b/android/app/src/com/android/bluetooth/map/BluetoothMapAccountItem.java @@ -159,13 +159,9 @@ public class BluetoothMapAccountItem implements Comparable<BluetoothMapAccountIt if (this == obj) { return true; } - if (obj == null) { + if (!(obj instanceof BluetoothMapAccountItem other)) { return false; } - if (getClass() != obj.getClass()) { - return false; - } - BluetoothMapAccountItem other = (BluetoothMapAccountItem) obj; if (mId == null) { if (other.mId != null) { return false; diff --git a/android/app/src/com/android/bluetooth/map/BluetoothMapConvoContactElement.java b/android/app/src/com/android/bluetooth/map/BluetoothMapConvoContactElement.java index bc4fbd5efe..2a5f53d13f 100644 --- a/android/app/src/com/android/bluetooth/map/BluetoothMapConvoContactElement.java +++ b/android/app/src/com/android/bluetooth/map/BluetoothMapConvoContactElement.java @@ -279,13 +279,9 @@ public class BluetoothMapConvoContactElement if (this == obj) { return true; } - if (obj == null) { + if (!(obj instanceof BluetoothMapConvoContactElement other)) { return false; } - if (getClass() != obj.getClass()) { - return false; - } - BluetoothMapConvoContactElement other = (BluetoothMapConvoContactElement) obj; /* As we use equals only for test, we don't compare auto assigned values * if (mBtUid == null) { if (other.mBtUid != null) { diff --git a/android/app/src/com/android/bluetooth/map/BluetoothMapConvoListing.java b/android/app/src/com/android/bluetooth/map/BluetoothMapConvoListing.java index 20dd176174..217e072b2c 100644 --- a/android/app/src/com/android/bluetooth/map/BluetoothMapConvoListing.java +++ b/android/app/src/com/android/bluetooth/map/BluetoothMapConvoListing.java @@ -214,13 +214,9 @@ public class BluetoothMapConvoListing { if (this == obj) { return true; } - if (obj == null) { + if (!(obj instanceof BluetoothMapConvoListing other)) { return false; } - if (getClass() != obj.getClass()) { - return false; - } - BluetoothMapConvoListing other = (BluetoothMapConvoListing) obj; if (mHasUnread != other.mHasUnread) { return false; } diff --git a/android/app/src/com/android/bluetooth/map/BluetoothMapConvoListingElement.java b/android/app/src/com/android/bluetooth/map/BluetoothMapConvoListingElement.java index 79faecb171..f203aa51ba 100644 --- a/android/app/src/com/android/bluetooth/map/BluetoothMapConvoListingElement.java +++ b/android/app/src/com/android/bluetooth/map/BluetoothMapConvoListingElement.java @@ -335,13 +335,9 @@ public class BluetoothMapConvoListingElement if (this == obj) { return true; } - if (obj == null) { + if (!(obj instanceof BluetoothMapConvoListingElement other)) { return false; } - if (getClass() != obj.getClass()) { - return false; - } - BluetoothMapConvoListingElement other = (BluetoothMapConvoListingElement) obj; if (mContacts == null) { if (other.mContacts != null) { return false; diff --git a/android/app/src/com/android/bluetooth/map/BluetoothMapMasInstance.java b/android/app/src/com/android/bluetooth/map/BluetoothMapMasInstance.java index 6d0c654aa9..080173aec3 100644 --- a/android/app/src/com/android/bluetooth/map/BluetoothMapMasInstance.java +++ b/android/app/src/com/android/bluetooth/map/BluetoothMapMasInstance.java @@ -34,7 +34,6 @@ import com.android.bluetooth.content_profiles.ContentProfileErrorReportUtils; import com.android.bluetooth.map.BluetoothMapContentObserver.Msg; import com.android.bluetooth.map.BluetoothMapUtils.TYPE; import com.android.bluetooth.sdp.SdpManagerNativeInterface; -import com.android.internal.annotations.VisibleForTesting; import com.android.obex.ServerSession; import java.io.IOException; @@ -47,7 +46,7 @@ import java.util.concurrent.atomic.AtomicLong; public class BluetoothMapMasInstance implements IObexConnectionHandler { private static final String TAG = "BluetoothMapMasInstance"; - @VisibleForTesting static volatile int sInstanceCounter = 0; + private static int sInstanceCounter = 0; private final int mObjectInstanceId; diff --git a/android/app/src/com/android/bluetooth/map/BluetoothMapService.java b/android/app/src/com/android/bluetooth/map/BluetoothMapService.java index 46f2a9373a..190397de62 100644 --- a/android/app/src/com/android/bluetooth/map/BluetoothMapService.java +++ b/android/app/src/com/android/bluetooth/map/BluetoothMapService.java @@ -1253,21 +1253,7 @@ public class BluetoothMapService extends ProfileService { static class BluetoothMapBinder extends IBluetoothMap.Stub implements IProfileServiceBinder { private BluetoothMapService mService; - @RequiresPermission(BLUETOOTH_CONNECT) - private BluetoothMapService getService(AttributionSource source) { - if (Utils.isInstrumentationTestMode()) { - return mService; - } - if (!Utils.checkServiceAvailable(mService, TAG) - || !Utils.checkCallerIsSystemOrActiveOrManagedUser(mService, TAG) - || !Utils.checkConnectPermissionForDataDelivery(mService, source, TAG)) { - return null; - } - return mService; - } - BluetoothMapBinder(BluetoothMapService service) { - Log.v(TAG, "BluetoothMapBinder()"); mService = service; } @@ -1276,6 +1262,23 @@ public class BluetoothMapService extends ProfileService { mService = null; } + @RequiresPermission(BLUETOOTH_CONNECT) + private BluetoothMapService getService(AttributionSource source) { + // Cache mService because it can change while getService is called + BluetoothMapService service = mService; + + if (Utils.isInstrumentationTestMode()) { + return service; + } + + if (!Utils.checkServiceAvailable(service, TAG) + || !Utils.checkCallerIsSystemOrActiveOrManagedUser(service, TAG) + || !Utils.checkConnectPermissionForDataDelivery(service, source, TAG)) { + return null; + } + return service; + } + @Override public int getState(AttributionSource source) { Log.v(TAG, "getState()"); diff --git a/android/app/src/com/android/bluetooth/map/BluetoothMapSmsPdu.java b/android/app/src/com/android/bluetooth/map/BluetoothMapSmsPdu.java index 93d315ec41..14262d9034 100644 --- a/android/app/src/com/android/bluetooth/map/BluetoothMapSmsPdu.java +++ b/android/app/src/com/android/bluetooth/map/BluetoothMapSmsPdu.java @@ -438,7 +438,7 @@ public class BluetoothMapSmsPdu { | TP_MMS_NO_MORE | TP_RP_NO_REPLY_PATH | TP_SRI_NO_REPORT - | (mData[0] & 0xff) & TP_UDHI_MASK); + | ((mData[0] & 0xff) & TP_UDHI_MASK)); encodedAddress = PhoneNumberUtils.networkPortionToCalledPartyBCDWithLength(originator); if (encodedAddress != null) { diff --git a/android/app/src/com/android/bluetooth/mapclient/MapClientService.java b/android/app/src/com/android/bluetooth/mapclient/MapClientService.java index 3f6ef044f0..9f282cd233 100644 --- a/android/app/src/com/android/bluetooth/mapclient/MapClientService.java +++ b/android/app/src/com/android/bluetooth/mapclient/MapClientService.java @@ -429,36 +429,59 @@ public class MapClientService extends ProfileService { mService = service; } + @Override + public void cleanup() { + mService = null; + } + @RequiresPermission(BLUETOOTH_CONNECT) private MapClientService getService(AttributionSource source) { + // Cache mService because it can change while getService is called + MapClientService service = mService; + if (Utils.isInstrumentationTestMode()) { - return mService; + return service; } - if (!Utils.checkServiceAvailable(mService, TAG) + + if (!Utils.checkServiceAvailable(service, TAG) || !(getCallingUserHandle().isSystem() - || Utils.checkCallerIsSystemOrActiveOrManagedUser(mService, TAG)) - || !Utils.checkConnectPermissionForDataDelivery(mService, source, TAG)) { + || Utils.checkCallerIsSystemOrActiveOrManagedUser(service, TAG)) + || !Utils.checkConnectPermissionForDataDelivery(service, source, TAG)) { return null; } - return mService; + return service; } - @Override - public void cleanup() { - mService = null; + @RequiresPermission(allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED}) + private MapClientService getServiceAndEnforcePrivileged(AttributionSource source) { + // Cache mService because it can change while getService is called + MapClientService service = mService; + + if (Utils.isInstrumentationTestMode()) { + return service; + } + + if (!Utils.checkServiceAvailable(service, TAG) + || !(getCallingUserHandle().isSystem() + || Utils.checkCallerIsSystemOrActiveOrManagedUser(service, TAG)) + || !Utils.checkConnectPermissionForDataDelivery(service, source, TAG)) { + return null; + } + + service.enforceCallingOrSelfPermission(BLUETOOTH_PRIVILEGED, null); + + return service; } @Override public boolean connect(BluetoothDevice device, AttributionSource source) { Log.v(TAG, "connect()"); - MapClientService service = getService(source); + MapClientService service = getServiceAndEnforcePrivileged(source); if (service == null) { return false; } - service.enforceCallingOrSelfPermission(BLUETOOTH_PRIVILEGED, null); - return service.connect(device); } @@ -466,13 +489,11 @@ public class MapClientService extends ProfileService { public boolean disconnect(BluetoothDevice device, AttributionSource source) { Log.v(TAG, "disconnect()"); - MapClientService service = getService(source); + MapClientService service = getServiceAndEnforcePrivileged(source); if (service == null) { return false; } - service.enforceCallingOrSelfPermission(BLUETOOTH_PRIVILEGED, null); - return service.disconnect(device); } @@ -480,7 +501,7 @@ public class MapClientService extends ProfileService { public List<BluetoothDevice> getConnectedDevices(AttributionSource source) { Log.v(TAG, "getConnectedDevices()"); - MapClientService service = getService(source); + MapClientService service = getServiceAndEnforcePrivileged(source); if (service == null) { return Collections.emptyList(); } @@ -493,7 +514,7 @@ public class MapClientService extends ProfileService { int[] states, AttributionSource source) { Log.v(TAG, "getDevicesMatchingConnectionStates()"); - MapClientService service = getService(source); + MapClientService service = getServiceAndEnforcePrivileged(source); if (service == null) { return Collections.emptyList(); } @@ -504,7 +525,7 @@ public class MapClientService extends ProfileService { public int getConnectionState(BluetoothDevice device, AttributionSource source) { Log.v(TAG, "getConnectionState()"); - MapClientService service = getService(source); + MapClientService service = getServiceAndEnforcePrivileged(source); if (service == null) { return BluetoothProfile.STATE_DISCONNECTED; } @@ -517,13 +538,11 @@ public class MapClientService extends ProfileService { BluetoothDevice device, int connectionPolicy, AttributionSource source) { Log.v(TAG, "setConnectionPolicy()"); - MapClientService service = getService(source); + MapClientService service = getServiceAndEnforcePrivileged(source); if (service == null) { return false; } - service.enforceCallingOrSelfPermission(BLUETOOTH_PRIVILEGED, null); - return service.setConnectionPolicy(device, connectionPolicy); } @@ -531,13 +550,11 @@ public class MapClientService extends ProfileService { public int getConnectionPolicy(BluetoothDevice device, AttributionSource source) { Log.v(TAG, "getConnectionPolicy()"); - MapClientService service = getService(source); + MapClientService service = getServiceAndEnforcePrivileged(source); if (service == null) { return BluetoothProfile.CONNECTION_POLICY_UNKNOWN; } - service.enforceCallingOrSelfPermission(BLUETOOTH_PRIVILEGED, null); - return service.getConnectionPolicy(device); } diff --git a/android/app/src/com/android/bluetooth/mapclient/obex/Message.java b/android/app/src/com/android/bluetooth/mapclient/obex/Message.java index 89f40cc7d2..0cfaf74660 100644 --- a/android/app/src/com/android/bluetooth/mapclient/obex/Message.java +++ b/android/app/src/com/android/bluetooth/mapclient/obex/Message.java @@ -262,7 +262,7 @@ public class Message { } /** - * @return {@link .ReceptionStatus} object corresponding to <code>reception_status</code> + * @return {@link ReceptionStatus} object corresponding to <code>reception_status</code> * parameter in MAP specification */ public ReceptionStatus getReceptionStatus() { diff --git a/android/app/src/com/android/bluetooth/mapclient/obex/ObexTime.java b/android/app/src/com/android/bluetooth/mapclient/obex/ObexTime.java index 97d6bdccd8..8f3392be19 100644 --- a/android/app/src/com/android/bluetooth/mapclient/obex/ObexTime.java +++ b/android/app/src/com/android/bluetooth/mapclient/obex/ObexTime.java @@ -16,6 +16,8 @@ package com.android.bluetooth.mapclient; +import android.annotation.SuppressLint; + import com.android.bluetooth.Utils; import java.time.Instant; @@ -82,7 +84,7 @@ public final class ObexTime { int ohh = Integer.parseInt(m.group(9)); int omm = Integer.parseInt(m.group(10)); - /* time zone offset is specified in miliseconds */ + /* time zone offset is specified in milliseconds */ int offset = (ohh * 60 + omm) * 60 * 1000; if (m.group(8).equals("-")) { @@ -123,6 +125,7 @@ public final class ObexTime { } @Override + @SuppressLint("ToStringReturnsNull") public String toString() { if (mInstant == null) { return null; diff --git a/android/app/src/com/android/bluetooth/mcp/MediaControlGattService.java b/android/app/src/com/android/bluetooth/mcp/MediaControlGattService.java index abb87a3ea4..c229f184ae 100644 --- a/android/app/src/com/android/bluetooth/mcp/MediaControlGattService.java +++ b/android/app/src/com/android/bluetooth/mcp/MediaControlGattService.java @@ -1300,7 +1300,7 @@ public class MediaControlGattService implements MediaControlGattServiceInterface } private void handlePlaybackSpeedRequest(int speed) { - float floatingSpeed = (float) Math.pow(2, speed / 64); + float floatingSpeed = (float) Math.pow(2, speed / 64.0); mEventLogger.add("handlePlaybackSpeedRequest: floatingSpeed= " + floatingSpeed); mCallbacks.onPlaybackSpeedSetRequest(floatingSpeed); } diff --git a/android/app/src/com/android/bluetooth/opp/BluetoothOppHandoverReceiver.java b/android/app/src/com/android/bluetooth/opp/BluetoothOppHandoverReceiver.java index 9867b67a85..ffaad12849 100644 --- a/android/app/src/com/android/bluetooth/opp/BluetoothOppHandoverReceiver.java +++ b/android/app/src/com/android/bluetooth/opp/BluetoothOppHandoverReceiver.java @@ -87,7 +87,7 @@ public class BluetoothOppHandoverReceiver extends BroadcastReceiver { return; } String brEdrAddress = - Flags.identityAddressNullIfUnknown() + Flags.identityAddressNullIfNotKnown() ? Utils.getBrEdrAddress(device) : device.getIdentityAddress(); Log.d(TAG, "Adding " + brEdrAddress + " to acceptlist"); diff --git a/android/app/src/com/android/bluetooth/opp/BluetoothOppManager.java b/android/app/src/com/android/bluetooth/opp/BluetoothOppManager.java index ad5cad3206..bc276ec6e9 100644 --- a/android/app/src/com/android/bluetooth/opp/BluetoothOppManager.java +++ b/android/app/src/com/android/bluetooth/opp/BluetoothOppManager.java @@ -482,7 +482,7 @@ public class BluetoothOppManager { values.put(BluetoothShare.MIMETYPE, contentType); values.put( BluetoothShare.DESTINATION, - Flags.identityAddressNullIfUnknown() + Flags.identityAddressNullIfNotKnown() ? Utils.getBrEdrAddress(mRemoteDevice) : mRemoteDevice.getIdentityAddress()); values.put(BluetoothShare.TIMESTAMP, ts); @@ -514,7 +514,7 @@ public class BluetoothOppManager { values.put(BluetoothShare.MIMETYPE, mTypeOfSingleFile); values.put( BluetoothShare.DESTINATION, - Flags.identityAddressNullIfUnknown() + Flags.identityAddressNullIfNotKnown() ? Utils.getBrEdrAddress(mRemoteDevice) : mRemoteDevice.getIdentityAddress()); if (mIsHandoverInitiated) { diff --git a/android/app/src/com/android/bluetooth/opp/BluetoothOppPreference.java b/android/app/src/com/android/bluetooth/opp/BluetoothOppPreference.java index 6fec4370e3..1dd3703339 100644 --- a/android/app/src/com/android/bluetooth/opp/BluetoothOppPreference.java +++ b/android/app/src/com/android/bluetooth/opp/BluetoothOppPreference.java @@ -194,7 +194,7 @@ public class BluetoothOppPreference { @SuppressLint("AndroidFrameworkRequiresPermission") private String getBrEdrAddress(BluetoothDevice device) { - if (Flags.identityAddressNullIfUnknown()) { + if (Flags.identityAddressNullIfNotKnown()) { return Utils.getBrEdrAddress(device); } return device.getIdentityAddress(); diff --git a/android/app/src/com/android/bluetooth/opp/BluetoothOppReceiver.java b/android/app/src/com/android/bluetooth/opp/BluetoothOppReceiver.java index 5a1e7bdcc8..9b7a7329a8 100644 --- a/android/app/src/com/android/bluetooth/opp/BluetoothOppReceiver.java +++ b/android/app/src/com/android/bluetooth/opp/BluetoothOppReceiver.java @@ -81,7 +81,7 @@ public class BluetoothOppReceiver extends BroadcastReceiver { TAG, "Received BT device selected intent, bt device: " + BluetoothUtils.toAnonymizedAddress( - Flags.identityAddressNullIfUnknown() + Flags.identityAddressNullIfNotKnown() ? Utils.getBrEdrAddress(remoteDevice) : remoteDevice.getIdentityAddress())); diff --git a/android/app/src/com/android/bluetooth/opp/BluetoothOppService.java b/android/app/src/com/android/bluetooth/opp/BluetoothOppService.java index ae726f2295..9d86d822b9 100644 --- a/android/app/src/com/android/bluetooth/opp/BluetoothOppService.java +++ b/android/app/src/com/android/bluetooth/opp/BluetoothOppService.java @@ -774,7 +774,7 @@ public class BluetoothOppService extends ProfileService implements IObexConnecti * contains an entry that's not in the array, insert a new entry * in the array, move to next cursor row and next array entry. */ - while (!isAfterLast || arrayPos < mShares.size() && mListenStarted) { + while (!isAfterLast || (arrayPos < mShares.size() && mListenStarted)) { if (isAfterLast) { // We're beyond the end of the cursor but there's still some // stuff in the local array, which can only be junk @@ -1378,7 +1378,7 @@ public class BluetoothOppService extends ProfileService implements IObexConnecti + socket + " \n :device :" + BluetoothUtils.toAnonymizedAddress( - Flags.identityAddressNullIfUnknown() + Flags.identityAddressNullIfNotKnown() ? Utils.getBrEdrAddress(device, mAdapterService) : mAdapterService.getIdentityAddress(device.getAddress()))); if (!mAcceptNewConnections) { diff --git a/android/app/src/com/android/bluetooth/opp/BluetoothOppTransfer.java b/android/app/src/com/android/bluetooth/opp/BluetoothOppTransfer.java index b6b742e19c..209b4444bf 100644 --- a/android/app/src/com/android/bluetooth/opp/BluetoothOppTransfer.java +++ b/android/app/src/com/android/bluetooth/opp/BluetoothOppTransfer.java @@ -1021,7 +1021,7 @@ public class BluetoothOppTransfer implements BluetoothOppBatch.BluetoothOppBatch } private String getBrEdrAddress(BluetoothDevice device) { - if (Flags.identityAddressNullIfUnknown()) { + if (Flags.identityAddressNullIfNotKnown()) { return Utils.getBrEdrAddress(device); } return device.getIdentityAddress(); diff --git a/android/app/src/com/android/bluetooth/opp/BluetoothOppTransferActivity.java b/android/app/src/com/android/bluetooth/opp/BluetoothOppTransferActivity.java index 86ac40b481..77a2191528 100644 --- a/android/app/src/com/android/bluetooth/opp/BluetoothOppTransferActivity.java +++ b/android/app/src/com/android/bluetooth/opp/BluetoothOppTransferActivity.java @@ -187,10 +187,10 @@ public class BluetoothOppTransferActivity extends AlertActivity if (isSuccess) { // should not go here mWhichDialog = DIALOG_RECEIVE_COMPLETE_SUCCESS; - } else if (!isSuccess) { + } else { mWhichDialog = DIALOG_RECEIVE_COMPLETE_FAIL; } - } else if (!isComplete) { + } else { mWhichDialog = DIALOG_RECEIVE_ONGOING; } } else if (direction == BluetoothShare.DIRECTION_OUTBOUND) { @@ -198,10 +198,10 @@ public class BluetoothOppTransferActivity extends AlertActivity if (isSuccess) { mWhichDialog = DIALOG_SEND_COMPLETE_SUCCESS; - } else if (!isSuccess) { + } else { mWhichDialog = DIALOG_SEND_COMPLETE_FAIL; } - } else if (!isComplete) { + } else { mWhichDialog = DIALOG_SEND_ONGOING; } } diff --git a/android/app/src/com/android/bluetooth/pan/PanService.java b/android/app/src/com/android/bluetooth/pan/PanService.java index 241a4a7128..ee57196ac4 100644 --- a/android/app/src/com/android/bluetooth/pan/PanService.java +++ b/android/app/src/com/android/bluetooth/pan/PanService.java @@ -229,7 +229,7 @@ public class PanService extends ProfileService { case MESSAGE_CONNECT: BluetoothDevice connectDevice = (BluetoothDevice) msg.obj; if (!mNativeInterface.connect( - Flags.identityAddressNullIfUnknown() + Flags.identityAddressNullIfNotKnown() ? Utils.getByteBrEdrAddress(connectDevice) : mAdapterService.getByteIdentityAddress( connectDevice))) { @@ -250,7 +250,7 @@ public class PanService extends ProfileService { case MESSAGE_DISCONNECT: BluetoothDevice disconnectDevice = (BluetoothDevice) msg.obj; if (!mNativeInterface.disconnect( - Flags.identityAddressNullIfUnknown() + Flags.identityAddressNullIfNotKnown() ? Utils.getByteBrEdrAddress(disconnectDevice) : mAdapterService.getByteIdentityAddress( disconnectDevice))) { diff --git a/android/app/src/com/android/bluetooth/pbap/BluetoothPbapService.java b/android/app/src/com/android/bluetooth/pbap/BluetoothPbapService.java index cdfaff83b9..0292c6f684 100644 --- a/android/app/src/com/android/bluetooth/pbap/BluetoothPbapService.java +++ b/android/app/src/com/android/bluetooth/pbap/BluetoothPbapService.java @@ -155,7 +155,7 @@ public class BluetoothPbapService extends ProfileService implements IObexConnect @VisibleForTesting final HashMap<BluetoothDevice, PbapStateMachine> mPbapStateMachineMap = new HashMap<>(); - private volatile int mNextNotificationId = PBAP_NOTIFICATION_ID_START; + private int mNextNotificationId = PBAP_NOTIFICATION_ID_START; // package and class name to which we send intent to check phone book access permission private static final String ACCESS_AUTHORITY_PACKAGE = "com.android.settings"; diff --git a/android/app/src/com/android/bluetooth/pbapclient/PbapClientConnectionHandler.java b/android/app/src/com/android/bluetooth/pbapclient/PbapClientConnectionHandler.java index 71bd567cd3..470d906ac9 100644 --- a/android/app/src/com/android/bluetooth/pbapclient/PbapClientConnectionHandler.java +++ b/android/app/src/com/android/bluetooth/pbapclient/PbapClientConnectionHandler.java @@ -410,7 +410,7 @@ class PbapClientConnectionHandler extends Handler { startOffset); request.execute(mObexSession); List<VCardEntry> vcards = request.getList(); - if (path == FAV_PATH) { + if (FAV_PATH.equals(path)) { // mark each vcard as a favorite for (VCardEntry v : vcards) { v.setStarred(true); diff --git a/android/app/src/com/android/bluetooth/pbapclient/PbapClientService.java b/android/app/src/com/android/bluetooth/pbapclient/PbapClientService.java index 9e6e12a217..961337ccb3 100644 --- a/android/app/src/com/android/bluetooth/pbapclient/PbapClientService.java +++ b/android/app/src/com/android/bluetooth/pbapclient/PbapClientService.java @@ -382,7 +382,7 @@ public class PbapClientService extends ProfileService { mService = null; } - @RequiresPermission(BLUETOOTH_CONNECT) + @RequiresPermission(allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED}) private PbapClientService getService(AttributionSource source) { // Cache mService because it can change while getService is called PbapClientService service = mService; @@ -397,6 +397,8 @@ public class PbapClientService extends ProfileService { return null; } + service.enforceCallingOrSelfPermission(BLUETOOTH_PRIVILEGED, null); + return service; } @@ -410,8 +412,6 @@ public class PbapClientService extends ProfileService { return false; } - service.enforceCallingOrSelfPermission(BLUETOOTH_PRIVILEGED, null); - return service.connect(device); } @@ -422,8 +422,6 @@ public class PbapClientService extends ProfileService { return false; } - service.enforceCallingOrSelfPermission(BLUETOOTH_PRIVILEGED, null); - return service.disconnect(device); } @@ -466,8 +464,6 @@ public class PbapClientService extends ProfileService { return false; } - service.enforceCallingOrSelfPermission(BLUETOOTH_PRIVILEGED, null); - return service.setConnectionPolicy(device, connectionPolicy); } @@ -478,8 +474,6 @@ public class PbapClientService extends ProfileService { return BluetoothProfile.CONNECTION_POLICY_UNKNOWN; } - service.enforceCallingOrSelfPermission(BLUETOOTH_PRIVILEGED, null); - return service.getConnectionPolicy(device); } } diff --git a/android/app/src/com/android/bluetooth/sdp/SdpManager.java b/android/app/src/com/android/bluetooth/sdp/SdpManager.java index 69b5f54f4b..3a316f8457 100644 --- a/android/app/src/com/android/bluetooth/sdp/SdpManager.java +++ b/android/app/src/com/android/bluetooth/sdp/SdpManager.java @@ -144,13 +144,13 @@ public class SdpManager { SdpSearchInstance getSearchInstance(byte[] address, byte[] uuidBytes) { String addressString = Utils.getAddressStringFromByte(address); addressString = - Flags.identityAddressNullIfUnknown() + Flags.identityAddressNullIfNotKnown() ? Utils.getBrEdrAddress(addressString, mAdapterService) : mAdapterService.getIdentityAddress(addressString); ParcelUuid uuid = Utils.byteArrayToUuid(uuidBytes)[0]; for (SdpSearchInstance inst : mList) { String instAddressString = - Flags.identityAddressNullIfUnknown() + Flags.identityAddressNullIfNotKnown() ? Utils.getBrEdrAddress(inst.getDevice(), mAdapterService) : mAdapterService.getIdentityAddress(inst.getDevice().getAddress()); if (instAddressString.equals(addressString) && inst.getUuid().equals(uuid)) { @@ -162,12 +162,12 @@ public class SdpManager { boolean isSearching(BluetoothDevice device, ParcelUuid uuid) { String addressString = - Flags.identityAddressNullIfUnknown() + Flags.identityAddressNullIfNotKnown() ? Utils.getBrEdrAddress(device, mAdapterService) : mAdapterService.getIdentityAddress(device.getAddress()); for (SdpSearchInstance inst : mList) { String instAddressString = - Flags.identityAddressNullIfUnknown() + Flags.identityAddressNullIfNotKnown() ? Utils.getBrEdrAddress(inst.getDevice(), mAdapterService) : mAdapterService.getIdentityAddress(inst.getDevice().getAddress()); if (instAddressString != null @@ -473,7 +473,7 @@ public class SdpManager { inst.startSearch(); // Trigger timeout message mNativeInterface.sdpSearch( - Flags.identityAddressNullIfUnknown() + Flags.identityAddressNullIfNotKnown() ? Utils.getByteBrEdrAddress(inst.getDevice()) : mAdapterService.getByteIdentityAddress(inst.getDevice()), Utils.uuidToByteArray(inst.getUuid())); diff --git a/android/app/src/com/android/bluetooth/tbs/TbsCall.java b/android/app/src/com/android/bluetooth/tbs/TbsCall.java index bc08172f12..867fe183cd 100644 --- a/android/app/src/com/android/bluetooth/tbs/TbsCall.java +++ b/android/app/src/com/android/bluetooth/tbs/TbsCall.java @@ -99,9 +99,12 @@ public class TbsCall { @Override public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - TbsCall that = (TbsCall) o; + if (this == o) { + return true; + } + if (!(o instanceof TbsCall that)) { + return false; + } // check the state only return mState == that.mState; } diff --git a/android/app/src/com/android/bluetooth/tbs/TbsGatt.java b/android/app/src/com/android/bluetooth/tbs/TbsGatt.java index 47b0139250..55dd3e2f4e 100644 --- a/android/app/src/com/android/bluetooth/tbs/TbsGatt.java +++ b/android/app/src/com/android/bluetooth/tbs/TbsGatt.java @@ -28,6 +28,7 @@ import android.bluetooth.BluetoothGattServerCallback; import android.bluetooth.BluetoothGattService; import android.bluetooth.BluetoothProfile; import android.content.Context; +import android.net.Uri; import android.os.Handler; import android.os.Looper; import android.os.ParcelUuid; @@ -910,7 +911,10 @@ public class TbsGatt { } public boolean setIncomingCall(int callIndex, String uri) { - Log.d(TAG, "setIncomingCall: callIndex=" + callIndex + " uri=" + uri); + Log.d( + TAG, + ("setIncomingCall: callIndex=" + callIndex) + + (" uri=" + (uri == null ? "null" : Uri.parse(uri).toSafeString()))); int uri_len = 0; if (uri != null) { uri_len = uri.length(); diff --git a/android/app/src/com/android/bluetooth/tbs/TbsGeneric.java b/android/app/src/com/android/bluetooth/tbs/TbsGeneric.java index 8a88a718d2..0fce1138db 100644 --- a/android/app/src/com/android/bluetooth/tbs/TbsGeneric.java +++ b/android/app/src/com/android/bluetooth/tbs/TbsGeneric.java @@ -694,9 +694,8 @@ public class TbsGeneric { mCurrentCallsList.put(callIndex, TbsCall.create(call)); cclc |= true; } else { - TbsCall tbsCall = mCurrentCallsList.get(callIndex); TbsCall tbsCallNew = TbsCall.create(call); - if (tbsCall != tbsCallNew) { + if (!tbsCallNew.equals(mCurrentCallsList.get(callIndex))) { mCurrentCallsList.replace(callIndex, tbsCallNew); cclc |= true; } diff --git a/android/app/src/com/android/bluetooth/telephony/BluetoothInCallService.java b/android/app/src/com/android/bluetooth/telephony/BluetoothInCallService.java index f8fbe2b79b..b72453aab8 100644 --- a/android/app/src/com/android/bluetooth/telephony/BluetoothInCallService.java +++ b/android/app/src/com/android/bluetooth/telephony/BluetoothInCallService.java @@ -943,7 +943,7 @@ public class BluetoothInCallService extends InCallService { /** Sends a single clcc (C* List Current Calls) event for the specified call. */ @RequiresPermission(allOf = {BLUETOOTH_CONNECT, MODIFY_PHONE_STATE}) private void sendClccForCall(BluetoothCall call, boolean shouldLog) { - boolean isForeground = mCallInfo.getForegroundCall() == call; + boolean isForeground = call.equals(mCallInfo.getForegroundCall()); int state = getBtCallState(call, isForeground); boolean isPartOfConference = false; boolean isConferenceWithNoChildren = isConferenceWithNoChildren(call); @@ -979,7 +979,7 @@ public class BluetoothInCallService extends InCallService { if (shouldReevaluateState) { isPartOfConference = false; - if (call == activeChild) { + if (call.equals(activeChild)) { state = CALL_STATE_ACTIVE; } else { // At this point we know there is an "active" child and we know that it @@ -1267,7 +1267,8 @@ public class BluetoothInCallService extends InCallService { || bluetoothCallState != mBluetoothCallState || !TextUtils.equals(ringingAddress, mRingingAddress) || ringingAddressType != mRingingAddressType - || (heldCall != mOldHeldCall && !ignoreHeldCallChange))))) { + || (!Objects.equals(heldCall, mOldHeldCall) + && !ignoreHeldCallChange))))) { // If the BluetoothCall is transitioning into the alerting state, send DIALING first. // Some devices expect to see a DIALING state prior to seeing an ALERTING state @@ -1665,7 +1666,7 @@ public class BluetoothInCallService extends InCallService { && !conferenceCall.wasConferencePreviouslyMerged()); if (shouldReevaluateState) { - if (call == activeChild) { + if (call.equals(activeChild)) { state = BluetoothLeCall.STATE_ACTIVE; } else { // At this point we know there is an "active" child and we know that it is diff --git a/android/app/src/com/android/bluetooth/vc/VolumeControlNativeInterface.java b/android/app/src/com/android/bluetooth/vc/VolumeControlNativeInterface.java index 7293f7f086..4d7e721021 100644 --- a/android/app/src/com/android/bluetooth/vc/VolumeControlNativeInterface.java +++ b/android/app/src/com/android/bluetooth/vc/VolumeControlNativeInterface.java @@ -251,13 +251,15 @@ public class VolumeControlNativeInterface { } @VisibleForTesting - void onVolumeStateChanged(int volume, boolean mute, byte[] address, boolean isAutonomous) { + void onVolumeStateChanged( + int volume, boolean mute, int flags, byte[] address, boolean isAutonomous) { VolumeControlStackEvent event = new VolumeControlStackEvent( VolumeControlStackEvent.EVENT_TYPE_VOLUME_STATE_CHANGED); event.device = getDevice(address); event.valueInt1 = -1; event.valueInt2 = volume; + event.valueInt3 = flags; event.valueBool1 = mute; event.valueBool2 = isAutonomous; diff --git a/android/app/src/com/android/bluetooth/vc/VolumeControlService.java b/android/app/src/com/android/bluetooth/vc/VolumeControlService.java index 29d0a95982..889b9bce53 100644 --- a/android/app/src/com/android/bluetooth/vc/VolumeControlService.java +++ b/android/app/src/com/android/bluetooth/vc/VolumeControlService.java @@ -200,6 +200,11 @@ public class VolumeControlService extends ProfileService { private final Map<Integer, Boolean> mGroupMuteCache = new HashMap<>(); private final Map<BluetoothDevice, Integer> mDeviceVolumeCache = new HashMap<>(); + /* As defined by Volume Control Service 1.0.1, 3.3.1. Volume Flags behavior. + * User Set Volume Setting means that remote keeps volume in its cache. + */ + @VisibleForTesting static final int VOLUME_FLAGS_PERSISTED_USER_SET_VOLUME_MASK = 0x01; + @VisibleForTesting ServiceFactory mFactory = new ServiceFactory(); public VolumeControlService(Context ctx) { @@ -862,14 +867,22 @@ public class VolumeControlService extends ProfileService { } } - void handleVolumeControlChanged( - BluetoothDevice device, int groupId, int volume, boolean mute, boolean isAutonomous) { + int getBleVolumeFromCurrentStream() { + int streamType = getBluetoothContextualVolumeStream(); + int streamVolume = mAudioManager.getStreamVolume(streamType); + int streamMaxVolume = mAudioManager.getStreamMaxVolume(streamType); - if (isAutonomous && device != null) { - Log.e(TAG, "We expect only group notification for autonomous updates"); - return; - } + /* leaudio expect volume value in range 0 to 255 */ + return (int) Math.round((double) streamVolume * LE_AUDIO_MAX_VOL / streamMaxVolume); + } + void handleVolumeControlChanged( + BluetoothDevice device, + int groupId, + int volume, + int flags, + boolean mute, + boolean isAutonomous) { if (groupId == IBluetoothLeAudio.LE_AUDIO_GROUP_ID_INVALID) { LeAudioService leAudioService = mFactory.getLeAudioService(); if (leAudioService == null) { @@ -887,6 +900,34 @@ public class VolumeControlService extends ProfileService { int groupVolume = getGroupVolume(groupId); Boolean groupMute = getGroupMute(groupId); + if (isAutonomous && device != null) { + Log.i( + TAG, + ("Initial volume set after connect, volume: " + volume) + + (", mute: " + mute) + + (", flags: " + flags)); + /* We are here, because system has just started and LeAudio device is connected. If + * remote device has User Persistent flag set or the volume != 0, Android sets the + * volume to local cache and to the audio system. If Reset Flag is set and remote has + * volume set to 0, then Android sets to remote devices either cached volume volume + * taken from audio manager. Note, to match BR/EDR behavior, don't show volume change in + * UI here + */ + if ((flags & VOLUME_FLAGS_PERSISTED_USER_SET_VOLUME_MASK) == 0x01 || (volume != 0)) { + updateGroupCacheAndAudioSystem(groupId, volume, mute, false); + } else { + if (groupVolume != IBluetoothVolumeControl.VOLUME_CONTROL_UNKNOWN_VOLUME) { + Log.i(TAG, "Setting volume: " + groupVolume + " to the group: " + groupId); + setGroupVolume(groupId, groupVolume); + } else { + int vol = getBleVolumeFromCurrentStream(); + Log.i(TAG, "Setting system volume: " + vol + " to the group: " + groupId); + setGroupVolume(groupId, getBleVolumeFromCurrentStream()); + } + } + return; + } + if (Flags.leaudioBroadcastVolumeControlForConnectedDevices()) { Log.i(TAG, "handleVolumeControlChanged: " + device + "; volume: " + volume); if (device == null) { @@ -906,16 +947,6 @@ public class VolumeControlService extends ProfileService { } } - if (groupVolume == IBluetoothVolumeControl.VOLUME_CONTROL_UNKNOWN_VOLUME) { - /* We are here, because system was just started and LeAudio device just connected. - * In such case, we take Volume stored on remote device and apply it to our cache and - * audio system. - * Note, to match BR/EDR behavior, don't show volume change in UI here - */ - updateGroupCacheAndAudioSystem(groupId, volume, mute, false); - return; - } - if (!isAutonomous) { /* If the change is triggered by Android device, the stream is already changed. * However it might be called with isAutonomous, one the first read of after @@ -1119,6 +1150,7 @@ public class VolumeControlService extends ProfileService { stackEvent.device, stackEvent.valueInt1, stackEvent.valueInt2, + stackEvent.valueInt3, stackEvent.valueBool1, stackEvent.valueBool2); return; diff --git a/android/app/src/com/android/bluetooth/vc/VolumeControlStackEvent.java b/android/app/src/com/android/bluetooth/vc/VolumeControlStackEvent.java index 502519678e..aba8aedaf0 100644 --- a/android/app/src/com/android/bluetooth/vc/VolumeControlStackEvent.java +++ b/android/app/src/com/android/bluetooth/vc/VolumeControlStackEvent.java @@ -40,6 +40,7 @@ public class VolumeControlStackEvent { public BluetoothDevice device; public int valueInt1; public int valueInt2; + public int valueInt3; public boolean valueBool1; public boolean valueBool2; public String valueString1; @@ -58,6 +59,7 @@ public class VolumeControlStackEvent { result.append(", device:").append(device); result.append(", valueInt1:").append(eventTypeValue1ToString(type, valueInt1)); result.append(", valueInt2:").append(eventTypeValue2ToString(type, valueInt2)); + result.append(", valueInt3:").append(eventTypeValue3ToString(type, valueInt3)); result.append(", valueBool1:").append(eventTypeValueBool1ToString(type, valueBool1)); result.append(", valueBool2:").append(eventTypeValueBool2ToString(type, valueBool2)); result.append(", valueString1:").append(eventTypeString1ToString(type, valueString1)); @@ -138,6 +140,16 @@ public class VolumeControlStackEvent { return Integer.toString(value); } + private static String eventTypeValue3ToString(int type, int value) { + switch (type) { + case EVENT_TYPE_VOLUME_STATE_CHANGED: + return "{flags:" + value + "}"; + default: + break; + } + return Integer.toString(value); + } + private static String eventTypeValueBool1ToString(int type, boolean value) { switch (type) { case EVENT_TYPE_VOLUME_STATE_CHANGED: diff --git a/android/app/tests/unit/Android.bp b/android/app/tests/unit/Android.bp index a737efb565..f124ba8f43 100644 --- a/android/app/tests/unit/Android.bp +++ b/android/app/tests/unit/Android.bp @@ -59,22 +59,29 @@ java_defaults { javacflags: [ "-Xep:AlmostJavadoc:ERROR", "-Xep:BadImport:ERROR", + "-Xep:CatchAndPrintStackTrace:ERROR", "-Xep:CatchFail:ERROR", "-Xep:ClassCanBeStatic:ERROR", "-Xep:EmptyBlockTag:ERROR", "-Xep:EmptyCatch:ERROR", + "-Xep:EqualsIncompatibleType:ERROR", "-Xep:FutureReturnValueIgnored:ERROR", "-Xep:InlineMeInliner:ERROR", "-Xep:InvalidBlockTag:ERROR", "-Xep:InvalidInlineTag:ERROR", "-Xep:InvalidParam:ERROR", "-Xep:MockNotUsedInProduction:ERROR", + "-Xep:ModifiedButNotUsed:ERROR", + "-Xep:NarrowCalculation:ERROR", "-Xep:NonApiType:ERROR", "-Xep:NonCanonicalType:ERROR", "-Xep:NotJavadoc:ERROR", "-Xep:ReturnAtTheEndOfVoidFunction:ERROR", "-Xep:StringCaseLocaleUsage:ERROR", "-Xep:StringCharset:ERROR", + "-Xep:TruthConstantAsserts:ERROR", + "-Xep:TruthIncompatibleType:ERROR", + "-Xep:UndefinedEquals:ERROR", "-Xep:UnnecessaryAssignment:ERROR", "-Xep:UnnecessaryAsync:ERROR", "-Xep:UnusedMethod:ERROR", diff --git a/android/app/tests/unit/src/com/android/bluetooth/a2dp/A2dpStateMachineTest.java b/android/app/tests/unit/src/com/android/bluetooth/a2dp/A2dpStateMachineTest.java index c8d27ceb20..a21f86c07e 100644 --- a/android/app/tests/unit/src/com/android/bluetooth/a2dp/A2dpStateMachineTest.java +++ b/android/app/tests/unit/src/com/android/bluetooth/a2dp/A2dpStateMachineTest.java @@ -26,12 +26,10 @@ import android.bluetooth.BluetoothCodecConfig; import android.bluetooth.BluetoothCodecStatus; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothProfile; -import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.os.HandlerThread; -import androidx.test.InstrumentationRegistry; import androidx.test.filters.MediumTest; import androidx.test.runner.AndroidJUnit4; @@ -252,7 +250,7 @@ public class A2dpStateMachineTest { // Verify that one connection state broadcast is executed ArgumentCaptor<Intent> intentArgument2 = ArgumentCaptor.forClass(Intent.class); - verify(mA2dpService, timeout(A2dpStateMachine.sConnectTimeoutMs * 2).times(2)) + verify(mA2dpService, timeout(A2dpStateMachine.sConnectTimeoutMs * 2L).times(2)) .sendBroadcast(intentArgument2.capture(), anyString(), any(Bundle.class)); assertThat(intentArgument2.getValue().getIntExtra(BluetoothProfile.EXTRA_STATE, -1)) .isEqualTo(BluetoothProfile.STATE_DISCONNECTED); @@ -289,7 +287,7 @@ public class A2dpStateMachineTest { // Verify that one connection state broadcast is executed ArgumentCaptor<Intent> intentArgument2 = ArgumentCaptor.forClass(Intent.class); - verify(mA2dpService, timeout(A2dpStateMachine.sConnectTimeoutMs * 2).times(2)) + verify(mA2dpService, timeout(A2dpStateMachine.sConnectTimeoutMs * 2L).times(2)) .sendBroadcast(intentArgument2.capture(), anyString(), any(Bundle.class)); assertThat(intentArgument2.getValue().getIntExtra(BluetoothProfile.EXTRA_STATE, -1)) .isEqualTo(BluetoothProfile.STATE_DISCONNECTED); diff --git a/android/app/tests/unit/src/com/android/bluetooth/audio_util/BrowserPlayerWrapperTest.java b/android/app/tests/unit/src/com/android/bluetooth/audio_util/BrowserPlayerWrapperTest.java index a0810ee3f5..4e21e9e215 100644 --- a/android/app/tests/unit/src/com/android/bluetooth/audio_util/BrowserPlayerWrapperTest.java +++ b/android/app/tests/unit/src/com/android/bluetooth/audio_util/BrowserPlayerWrapperTest.java @@ -396,14 +396,16 @@ public class BrowserPlayerWrapperTest { Assert.assertNotNull(folder); Assert.assertFalse(folder.isPlayable); Assert.assertEquals(expected.getDescription().getMediaId(), folder.mediaId); - Assert.assertEquals(expected.getDescription().getTitle(), folder.title); + Assert.assertEquals(expected.getDescription().getTitle().toString(), folder.title); } else { Metadata song = item.song; Assert.assertNotNull(song); Assert.assertEquals(expected.getDescription().getMediaId(), song.mediaId); - Assert.assertEquals(expected.getDescription().getTitle(), song.title); - Assert.assertEquals(expected.getDescription().getSubtitle(), song.artist); - Assert.assertEquals(expected.getDescription().getDescription(), song.album); + Assert.assertEquals(expected.getDescription().getTitle().toString(), song.title); + Assert.assertEquals( + expected.getDescription().getSubtitle().toString(), song.artist); + Assert.assertEquals( + expected.getDescription().getDescription().toString(), song.album); if (expected.getDescription().getIconBitmap() != null) { Assert.assertNotNull(song.image); Bitmap expectedBitmap = expected.getDescription().getIconBitmap(); diff --git a/android/app/tests/unit/src/com/android/bluetooth/avrcpcontroller/AvrcpItemTest.java b/android/app/tests/unit/src/com/android/bluetooth/avrcpcontroller/AvrcpItemTest.java index 4bc8e45f78..8df38adcde 100644 --- a/android/app/tests/unit/src/com/android/bluetooth/avrcpcontroller/AvrcpItemTest.java +++ b/android/app/tests/unit/src/com/android/bluetooth/avrcpcontroller/AvrcpItemTest.java @@ -18,13 +18,11 @@ package com.android.bluetooth.avrcpcontroller; import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothDevice; -import android.content.Context; import android.net.Uri; import android.support.v4.media.MediaBrowserCompat.MediaItem; import android.support.v4.media.MediaDescriptionCompat; import android.support.v4.media.MediaMetadataCompat; -import androidx.test.InstrumentationRegistry; import androidx.test.runner.AndroidJUnit4; import org.junit.After; @@ -554,7 +552,7 @@ public final class AvrcpItemTest { Assert.assertEquals(UUID, desc.getMediaId()); Assert.assertEquals(null, desc.getMediaUri()); Assert.assertEquals(title, desc.getTitle().toString()); - Assert.assertEquals(desc.getSubtitle(), null); + Assert.assertNull(desc.getSubtitle()); Assert.assertEquals(uri, desc.getIconUri()); Assert.assertEquals(null, desc.getIconBitmap()); } @@ -583,7 +581,7 @@ public final class AvrcpItemTest { Assert.assertEquals(UUID, desc.getMediaId()); Assert.assertEquals(null, desc.getMediaUri()); Assert.assertEquals(displayName, desc.getTitle().toString()); - Assert.assertEquals(desc.getSubtitle(), null); + Assert.assertNull(desc.getSubtitle()); Assert.assertEquals(uri, desc.getIconUri()); Assert.assertEquals(null, desc.getIconBitmap()); } @@ -610,7 +608,7 @@ public final class AvrcpItemTest { Assert.assertEquals(UUID, desc.getMediaId()); Assert.assertEquals(null, desc.getMediaUri()); Assert.assertEquals(title, desc.getTitle().toString()); - Assert.assertEquals(desc.getSubtitle(), null); + Assert.assertNull(desc.getSubtitle()); Assert.assertEquals(uri, desc.getIconUri()); Assert.assertEquals(null, desc.getIconBitmap()); } diff --git a/android/app/tests/unit/src/com/android/bluetooth/avrcpcontroller/BrowseNodeTest.java b/android/app/tests/unit/src/com/android/bluetooth/avrcpcontroller/BrowseNodeTest.java index c384dab35a..321c2d32c0 100644 --- a/android/app/tests/unit/src/com/android/bluetooth/avrcpcontroller/BrowseNodeTest.java +++ b/android/app/tests/unit/src/com/android/bluetooth/avrcpcontroller/BrowseNodeTest.java @@ -18,6 +18,7 @@ package com.android.bluetooth.avrcpcontroller; import static com.google.common.truth.Truth.assertThat; +import android.annotation.SuppressLint; import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothDevice; @@ -162,6 +163,7 @@ public class BrowseNodeTest { } @Test + @SuppressLint("TruthIncompatibleType") // That the point of this test public void equals_withDifferentClass() { AvrcpItem avrcpItem = new AvrcpItem.Builder().setUuid(TEST_UUID).build(); diff --git a/android/app/tests/unit/src/com/android/bluetooth/avrcpcontroller/bip/BipAttachmentFormatTest.java b/android/app/tests/unit/src/com/android/bluetooth/avrcpcontroller/bip/BipAttachmentFormatTest.java index 70930988b3..00b56abfa4 100644 --- a/android/app/tests/unit/src/com/android/bluetooth/avrcpcontroller/bip/BipAttachmentFormatTest.java +++ b/android/app/tests/unit/src/com/android/bluetooth/avrcpcontroller/bip/BipAttachmentFormatTest.java @@ -16,6 +16,8 @@ package com.android.bluetooth.avrcpcontroller; +import android.annotation.SuppressLint; + import androidx.test.runner.AndroidJUnit4; import org.junit.Assert; @@ -44,6 +46,7 @@ public class BipAttachmentFormatTest { return makeDate(month, day, year, hours, min, sec, null); } + @SuppressLint("UndefinedEquals") private void testParse( String contentType, String charset, @@ -78,6 +81,7 @@ public class BipAttachmentFormatTest { } } + @SuppressLint("UndefinedEquals") private void testCreate( String contentType, String charset, diff --git a/android/app/tests/unit/src/com/android/bluetooth/avrcpcontroller/bip/BipDatetimeTest.java b/android/app/tests/unit/src/com/android/bluetooth/avrcpcontroller/bip/BipDatetimeTest.java index 91c6b59498..913f77fe36 100644 --- a/android/app/tests/unit/src/com/android/bluetooth/avrcpcontroller/bip/BipDatetimeTest.java +++ b/android/app/tests/unit/src/com/android/bluetooth/avrcpcontroller/bip/BipDatetimeTest.java @@ -16,6 +16,8 @@ package com.android.bluetooth.avrcpcontroller; +import android.annotation.SuppressLint; + import androidx.test.runner.AndroidJUnit4; import org.junit.Assert; @@ -60,6 +62,7 @@ public class BipDatetimeTest { cal.get(Calendar.SECOND)); } + @SuppressLint("UndefinedEquals") private void testParse(String date, Date expectedDate, boolean isUtc, String expectedStr) { BipDateTime bipDateTime = new BipDateTime(date); Assert.assertEquals(expectedDate, bipDateTime.getTime()); @@ -67,6 +70,7 @@ public class BipDatetimeTest { Assert.assertEquals(expectedStr, bipDateTime.toString()); } + @SuppressLint("UndefinedEquals") private void testCreate(Date date, String dateStr) { BipDateTime bipDate = new BipDateTime(date); Assert.assertEquals(date, bipDate.getTime()); diff --git a/android/app/tests/unit/src/com/android/bluetooth/bass_client/BassClientServiceTest.java b/android/app/tests/unit/src/com/android/bluetooth/bass_client/BassClientServiceTest.java index de62f5bc6c..147848adf4 100644 --- a/android/app/tests/unit/src/com/android/bluetooth/bass_client/BassClientServiceTest.java +++ b/android/app/tests/unit/src/com/android/bluetooth/bass_client/BassClientServiceTest.java @@ -1279,9 +1279,8 @@ public class BassClientServiceTest { private void verifyConnectionStateIntent( int timeoutMs, BluetoothDevice device, int newState, int prevState) { Intent intent = TestUtils.waitForIntent(timeoutMs, mIntentQueue.get(device)); - assertThat(intent).isNotNull(); - assertThat(BluetoothLeBroadcastAssistant.ACTION_CONNECTION_STATE_CHANGED) - .isEqualTo(intent.getAction()); + assertThat(intent.getAction()) + .isEqualTo(BluetoothLeBroadcastAssistant.ACTION_CONNECTION_STATE_CHANGED); assertThat(device).isEqualTo(intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE)); assertThat(newState).isEqualTo(intent.getIntExtra(BluetoothProfile.EXTRA_STATE, -1)); assertThat(prevState) diff --git a/android/app/tests/unit/src/com/android/bluetooth/btservice/ActiveDeviceManagerTest.java b/android/app/tests/unit/src/com/android/bluetooth/btservice/ActiveDeviceManagerTest.java index 765475657a..b6db6fc1f9 100644 --- a/android/app/tests/unit/src/com/android/bluetooth/btservice/ActiveDeviceManagerTest.java +++ b/android/app/tests/unit/src/com/android/bluetooth/btservice/ActiveDeviceManagerTest.java @@ -525,7 +525,7 @@ public class ActiveDeviceManagerTest { } @Test - @EnableFlags(Flags.FLAG_ALWAYS_FALLBACK_TO_AVAILABLE_DEVICE) + @EnableFlags(Flags.FLAG_ADM_ALWAYS_FALLBACK_TO_AVAILABLE_DEVICE) public void a2dpHeadsetActivated_checkFallbackMeachanismOneA2dpOneHeadset() { // Active call when(mAudioManager.getMode()).thenReturn(AudioManager.MODE_IN_CALL); @@ -676,9 +676,6 @@ public class ActiveDeviceManagerTest { Assume.assumeTrue( "Ignore test when HearingAidService is not enabled", HearingAidService.isEnabled()); - List<BluetoothDevice> connectedHearingAidDevices = new ArrayList<>(); - connectedHearingAidDevices.add(mHearingAidDevice); - connectedHearingAidDevices.add(mSecondaryAudioDevice); when(mHearingAidService.getHiSyncId(mSecondaryAudioDevice)).thenReturn(mHearingAidHiSyncId); hearingAidConnected(mHearingAidDevice); @@ -1324,7 +1321,7 @@ public class ActiveDeviceManagerTest { /** A wired audio device is disconnected. Check if falls back to connected A2DP. */ @Test - @EnableFlags(Flags.FLAG_FALLBACK_WHEN_WIRED_AUDIO_DISCONNECTED) + @EnableFlags(Flags.FLAG_ADM_FALLBACK_WHEN_WIRED_AUDIO_DISCONNECTED) public void wiredAudioDeviceDisconnected_setFallbackDevice() throws Exception { AudioDeviceInfo[] testDevices = createAudioDeviceInfoTestDevices(); diff --git a/android/app/tests/unit/src/com/android/bluetooth/btservice/AdapterServiceTest.java b/android/app/tests/unit/src/com/android/bluetooth/btservice/AdapterServiceTest.java index b7de31ff6b..9e76b9daea 100644 --- a/android/app/tests/unit/src/com/android/bluetooth/btservice/AdapterServiceTest.java +++ b/android/app/tests/unit/src/com/android/bluetooth/btservice/AdapterServiceTest.java @@ -950,7 +950,7 @@ public class AdapterServiceTest { RemoteDevices remoteDevices = mAdapterService.getRemoteDevices(); remoteDevices.addDeviceProperties(Utils.getBytesFromAddress((TEST_BT_ADDR_1))); String identityAddress = mAdapterService.getIdentityAddress(TEST_BT_ADDR_1); - if (!Flags.identityAddressNullIfUnknown()) { + if (!Flags.identityAddressNullIfNotKnown()) { assertThat(identityAddress).isEqualTo(TEST_BT_ADDR_1); } @@ -965,7 +965,7 @@ public class AdapterServiceTest { } @Test - @EnableFlags(Flags.FLAG_IDENTITY_ADDRESS_NULL_IF_UNKNOWN) + @EnableFlags(Flags.FLAG_IDENTITY_ADDRESS_NULL_IF_NOT_KNOWN) public void testIdentityAddressNullIfUnknown() { BluetoothDevice device = TestUtils.getTestDevice(BluetoothAdapter.getDefaultAdapter(), 0); diff --git a/android/app/tests/unit/src/com/android/bluetooth/csip/CsipSetCoordinatorStateMachineTest.java b/android/app/tests/unit/src/com/android/bluetooth/csip/CsipSetCoordinatorStateMachineTest.java index 85871a331a..3890c8d15b 100644 --- a/android/app/tests/unit/src/com/android/bluetooth/csip/CsipSetCoordinatorStateMachineTest.java +++ b/android/app/tests/unit/src/com/android/bluetooth/csip/CsipSetCoordinatorStateMachineTest.java @@ -214,7 +214,7 @@ public class CsipSetCoordinatorStateMachineTest { // Verify that one connection state broadcast is executed ArgumentCaptor<Intent> intentArgument2 = ArgumentCaptor.forClass(Intent.class); - verify(mService, timeout(CsipSetCoordinatorStateMachine.sConnectTimeoutMs * 2).times(2)) + verify(mService, timeout(CsipSetCoordinatorStateMachine.sConnectTimeoutMs * 2L).times(2)) .sendBroadcast(intentArgument2.capture(), anyString()); Assert.assertEquals( STATE_DISCONNECTED, @@ -257,7 +257,7 @@ public class CsipSetCoordinatorStateMachineTest { // Verify that one connection state broadcast is executed ArgumentCaptor<Intent> intentArgument2 = ArgumentCaptor.forClass(Intent.class); - verify(mService, timeout(CsipSetCoordinatorStateMachine.sConnectTimeoutMs * 2).times(2)) + verify(mService, timeout(CsipSetCoordinatorStateMachine.sConnectTimeoutMs * 2L).times(2)) .sendBroadcast(intentArgument2.capture(), anyString()); Assert.assertEquals( STATE_DISCONNECTED, diff --git a/android/app/tests/unit/src/com/android/bluetooth/hap/HapClientNativeCallbackTest.java b/android/app/tests/unit/src/com/android/bluetooth/hap/HapClientNativeCallbackTest.java new file mode 100644 index 0000000000..af1c3930da --- /dev/null +++ b/android/app/tests/unit/src/com/android/bluetooth/hap/HapClientNativeCallbackTest.java @@ -0,0 +1,228 @@ +/* + * Copyright 2024 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.bluetooth.hap; + +import static org.mockito.Mockito.verify; + +import android.bluetooth.BluetoothHapPresetInfo; +import android.bluetooth.BluetoothProfile; + +import com.android.bluetooth.btservice.AdapterService; + +import com.google.common.truth.Expect; + +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Captor; +import org.mockito.Mock; +import org.mockito.junit.MockitoJUnit; +import org.mockito.junit.MockitoRule; + +public class HapClientNativeCallbackTest { + @Rule public MockitoRule mockitoRule = MockitoJUnit.rule(); + @Rule public Expect expect = Expect.create(); + + @Mock private AdapterService mAdapterService; + @Mock private HapClientService mHapClientService; + @Captor private ArgumentCaptor<HapClientStackEvent> mEvent; + + private HapClientNativeCallback mNativeCallback; + + @Before + public void setUp() throws Exception { + mNativeCallback = new HapClientNativeCallback(mAdapterService, mHapClientService); + } + + @Test + public void onConnectionStateChanged() { + int state = BluetoothProfile.STATE_CONNECTED; + mNativeCallback.onConnectionStateChanged(state, null); + + verify(mHapClientService).messageFromNative(mEvent.capture()); + HapClientStackEvent event = mEvent.getValue(); + expect.that(event.type).isEqualTo(HapClientStackEvent.EVENT_TYPE_CONNECTION_STATE_CHANGED); + expect.that(event.valueInt1).isEqualTo(state); + } + + @Test + public void onDeviceAvailable() { + int features = 1; + mNativeCallback.onDeviceAvailable(null, features); + + verify(mHapClientService).messageFromNative(mEvent.capture()); + HapClientStackEvent event = mEvent.getValue(); + expect.that(event.type).isEqualTo(HapClientStackEvent.EVENT_TYPE_DEVICE_AVAILABLE); + expect.that(event.valueInt1).isEqualTo(features); + } + + @Test + public void onFeaturesUpdate() { + int features = 1; + mNativeCallback.onFeaturesUpdate(null, features); + + verify(mHapClientService).messageFromNative(mEvent.capture()); + HapClientStackEvent event = mEvent.getValue(); + expect.that(event.type).isEqualTo(HapClientStackEvent.EVENT_TYPE_DEVICE_FEATURES); + expect.that(event.valueInt1).isEqualTo(features); + } + + @Test + public void onActivePresetSelected() { + int presetIndex = 0; + mNativeCallback.onActivePresetSelected(null, presetIndex); + + verify(mHapClientService).messageFromNative(mEvent.capture()); + HapClientStackEvent event = mEvent.getValue(); + expect.that(event.type).isEqualTo(HapClientStackEvent.EVENT_TYPE_ON_ACTIVE_PRESET_SELECTED); + expect.that(event.valueInt1).isEqualTo(presetIndex); + } + + @Test + public void onActivePresetGroupSelected() { + int groupId = 1; + int presetIndex = 0; + mNativeCallback.onActivePresetGroupSelected(groupId, presetIndex); + + verify(mHapClientService).messageFromNative(mEvent.capture()); + HapClientStackEvent event = mEvent.getValue(); + expect.that(event.type).isEqualTo(HapClientStackEvent.EVENT_TYPE_ON_ACTIVE_PRESET_SELECTED); + expect.that(event.valueInt1).isEqualTo(presetIndex); + expect.that(event.valueInt2).isEqualTo(groupId); + } + + @Test + public void onActivePresetSelectError() { + int resultCode = -1; + mNativeCallback.onActivePresetSelectError(null, resultCode); + + verify(mHapClientService).messageFromNative(mEvent.capture()); + HapClientStackEvent event = mEvent.getValue(); + expect.that(event.type) + .isEqualTo(HapClientStackEvent.EVENT_TYPE_ON_ACTIVE_PRESET_SELECT_ERROR); + expect.that(event.valueInt1).isEqualTo(resultCode); + } + + @Test + public void onActivePresetGroupSelectError() { + int groupId = 1; + int resultCode = -2; + mNativeCallback.onActivePresetGroupSelectError(groupId, resultCode); + + verify(mHapClientService).messageFromNative(mEvent.capture()); + HapClientStackEvent event = mEvent.getValue(); + expect.that(event.type) + .isEqualTo(HapClientStackEvent.EVENT_TYPE_ON_ACTIVE_PRESET_SELECT_ERROR); + expect.that(event.valueInt1).isEqualTo(resultCode); + expect.that(event.valueInt2).isEqualTo(groupId); + } + + @Test + public void onPresetInfo() { + int infoReason = HapClientStackEvent.PRESET_INFO_REASON_ALL_PRESET_INFO; + BluetoothHapPresetInfo[] presets = { + new BluetoothHapPresetInfo.Builder(0x01, "onPresetInfo") + .setWritable(true) + .setAvailable(false) + .build() + }; + mNativeCallback.onPresetInfo(null, infoReason, presets); + + verify(mHapClientService).messageFromNative(mEvent.capture()); + HapClientStackEvent event = mEvent.getValue(); + expect.that(event.type).isEqualTo(HapClientStackEvent.EVENT_TYPE_ON_PRESET_INFO); + expect.that(event.valueInt2).isEqualTo(infoReason); + expect.that(event.valueList.toArray()).isEqualTo(presets); + } + + @Test + public void onGroupPresetInfo() { + int groupId = 100; + int infoReason = HapClientStackEvent.PRESET_INFO_REASON_ALL_PRESET_INFO; + BluetoothHapPresetInfo[] presets = { + new BluetoothHapPresetInfo.Builder(0x01, "onPresetInfo") + .setWritable(true) + .setAvailable(false) + .build() + }; + mNativeCallback.onGroupPresetInfo(groupId, infoReason, presets); + + verify(mHapClientService).messageFromNative(mEvent.capture()); + HapClientStackEvent event = mEvent.getValue(); + expect.that(event.type).isEqualTo(HapClientStackEvent.EVENT_TYPE_ON_PRESET_INFO); + expect.that(event.valueInt2).isEqualTo(infoReason); + expect.that(event.valueInt3).isEqualTo(groupId); + expect.that(event.valueList.toArray()).isEqualTo(presets); + } + + @Test + public void onPresetNameSetError() { + int presetIndex = 2; + int resultCode = HapClientStackEvent.STATUS_SET_NAME_NOT_ALLOWED; + mNativeCallback.onPresetNameSetError(null, presetIndex, resultCode); + + verify(mHapClientService).messageFromNative(mEvent.capture()); + HapClientStackEvent event = mEvent.getValue(); + expect.that(event.type).isEqualTo(HapClientStackEvent.EVENT_TYPE_ON_PRESET_NAME_SET_ERROR); + expect.that(event.valueInt1).isEqualTo(resultCode); + expect.that(event.valueInt2).isEqualTo(presetIndex); + } + + @Test + public void onGroupPresetNameSetError() { + int groupId = 5; + int presetIndex = 2; + int resultCode = HapClientStackEvent.STATUS_SET_NAME_NOT_ALLOWED; + mNativeCallback.onGroupPresetNameSetError(groupId, presetIndex, resultCode); + + verify(mHapClientService).messageFromNative(mEvent.capture()); + HapClientStackEvent event = mEvent.getValue(); + expect.that(event.type).isEqualTo(HapClientStackEvent.EVENT_TYPE_ON_PRESET_NAME_SET_ERROR); + expect.that(event.valueInt1).isEqualTo(resultCode); + expect.that(event.valueInt2).isEqualTo(presetIndex); + expect.that(event.valueInt3).isEqualTo(groupId); + } + + @Test + public void onPresetInfoError() { + int presetIndex = 2; + int resultCode = HapClientStackEvent.STATUS_SET_NAME_NOT_ALLOWED; + mNativeCallback.onPresetInfoError(null, presetIndex, resultCode); + + verify(mHapClientService).messageFromNative(mEvent.capture()); + HapClientStackEvent event = mEvent.getValue(); + expect.that(event.type).isEqualTo(HapClientStackEvent.EVENT_TYPE_ON_PRESET_INFO_ERROR); + expect.that(event.valueInt1).isEqualTo(resultCode); + expect.that(event.valueInt2).isEqualTo(presetIndex); + } + + @Test + public void onGroupPresetInfoError() { + int groupId = 5; + int presetIndex = 2; + int resultCode = HapClientStackEvent.STATUS_SET_NAME_NOT_ALLOWED; + mNativeCallback.onGroupPresetInfoError(groupId, presetIndex, resultCode); + + verify(mHapClientService).messageFromNative(mEvent.capture()); + HapClientStackEvent event = mEvent.getValue(); + expect.that(event.type).isEqualTo(HapClientStackEvent.EVENT_TYPE_ON_PRESET_INFO_ERROR); + expect.that(event.valueInt1).isEqualTo(resultCode); + expect.that(event.valueInt2).isEqualTo(presetIndex); + expect.that(event.valueInt3).isEqualTo(groupId); + } +} diff --git a/android/app/tests/unit/src/com/android/bluetooth/hap/HapClientNativeInterfaceTest.java b/android/app/tests/unit/src/com/android/bluetooth/hap/HapClientNativeInterfaceTest.java deleted file mode 100644 index 7b219591ce..0000000000 --- a/android/app/tests/unit/src/com/android/bluetooth/hap/HapClientNativeInterfaceTest.java +++ /dev/null @@ -1,254 +0,0 @@ -/* - * Copyright 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.bluetooth.hap; - -import static com.google.common.truth.Truth.assertThat; - -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -import android.bluetooth.BluetoothHapPresetInfo; -import android.bluetooth.BluetoothProfile; - -import org.junit.After; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mock; -import org.mockito.junit.MockitoJUnit; -import org.mockito.junit.MockitoRule; - -public class HapClientNativeInterfaceTest { - private static final byte[] TEST_DEVICE_ADDRESS = - new byte[] {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; - @Rule public MockitoRule mockitoRule = MockitoJUnit.rule(); - - @Mock HapClientService mService; - - private HapClientNativeInterface mNativeInterface; - - @Before - public void setUp() throws Exception { - when(mService.isAvailable()).thenReturn(true); - HapClientService.setHapClient(mService); - mNativeInterface = new HapClientNativeInterface(); - } - - @After - public void tearDown() { - HapClientService.setHapClient(null); - } - - @Test - public void onConnectionStateChanged() { - int state = BluetoothProfile.STATE_CONNECTED; - mNativeInterface.onConnectionStateChanged(state, TEST_DEVICE_ADDRESS); - - ArgumentCaptor<HapClientStackEvent> event = - ArgumentCaptor.forClass(HapClientStackEvent.class); - verify(mService).messageFromNative(event.capture()); - assertThat(event.getValue().type) - .isEqualTo(HapClientStackEvent.EVENT_TYPE_CONNECTION_STATE_CHANGED); - assertThat(event.getValue().valueInt1).isEqualTo(state); - } - - @Test - public void onDeviceAvailable() { - int features = 1; - mNativeInterface.onDeviceAvailable(TEST_DEVICE_ADDRESS, features); - - ArgumentCaptor<HapClientStackEvent> event = - ArgumentCaptor.forClass(HapClientStackEvent.class); - verify(mService).messageFromNative(event.capture()); - assertThat(event.getValue().type) - .isEqualTo(HapClientStackEvent.EVENT_TYPE_DEVICE_AVAILABLE); - assertThat(event.getValue().valueInt1).isEqualTo(features); - } - - @Test - public void onFeaturesUpdate() { - int features = 1; - mNativeInterface.onFeaturesUpdate(TEST_DEVICE_ADDRESS, features); - - ArgumentCaptor<HapClientStackEvent> event = - ArgumentCaptor.forClass(HapClientStackEvent.class); - verify(mService).messageFromNative(event.capture()); - assertThat(event.getValue().type).isEqualTo(HapClientStackEvent.EVENT_TYPE_DEVICE_FEATURES); - assertThat(event.getValue().valueInt1).isEqualTo(features); - } - - @Test - public void onActivePresetSelected() { - int presetIndex = 0; - mNativeInterface.onActivePresetSelected(TEST_DEVICE_ADDRESS, presetIndex); - - ArgumentCaptor<HapClientStackEvent> event = - ArgumentCaptor.forClass(HapClientStackEvent.class); - verify(mService).messageFromNative(event.capture()); - assertThat(event.getValue().type) - .isEqualTo(HapClientStackEvent.EVENT_TYPE_ON_ACTIVE_PRESET_SELECTED); - assertThat(event.getValue().valueInt1).isEqualTo(presetIndex); - } - - @Test - public void onActivePresetGroupSelected() { - int groupId = 1; - int presetIndex = 0; - mNativeInterface.onActivePresetGroupSelected(groupId, presetIndex); - - ArgumentCaptor<HapClientStackEvent> event = - ArgumentCaptor.forClass(HapClientStackEvent.class); - verify(mService).messageFromNative(event.capture()); - assertThat(event.getValue().type) - .isEqualTo(HapClientStackEvent.EVENT_TYPE_ON_ACTIVE_PRESET_SELECTED); - assertThat(event.getValue().valueInt1).isEqualTo(presetIndex); - assertThat(event.getValue().valueInt2).isEqualTo(groupId); - } - - @Test - public void onActivePresetSelectError() { - int resultCode = -1; - mNativeInterface.onActivePresetSelectError(TEST_DEVICE_ADDRESS, resultCode); - - ArgumentCaptor<HapClientStackEvent> event = - ArgumentCaptor.forClass(HapClientStackEvent.class); - verify(mService).messageFromNative(event.capture()); - assertThat(event.getValue().type) - .isEqualTo(HapClientStackEvent.EVENT_TYPE_ON_ACTIVE_PRESET_SELECT_ERROR); - assertThat(event.getValue().valueInt1).isEqualTo(resultCode); - } - - @Test - public void onActivePresetGroupSelectError() { - int groupId = 1; - int resultCode = -2; - mNativeInterface.onActivePresetGroupSelectError(groupId, resultCode); - - ArgumentCaptor<HapClientStackEvent> event = - ArgumentCaptor.forClass(HapClientStackEvent.class); - verify(mService).messageFromNative(event.capture()); - assertThat(event.getValue().type) - .isEqualTo(HapClientStackEvent.EVENT_TYPE_ON_ACTIVE_PRESET_SELECT_ERROR); - assertThat(event.getValue().valueInt1).isEqualTo(resultCode); - assertThat(event.getValue().valueInt2).isEqualTo(groupId); - } - - @Test - public void onPresetInfo() { - int infoReason = HapClientStackEvent.PRESET_INFO_REASON_ALL_PRESET_INFO; - BluetoothHapPresetInfo[] presets = { - new BluetoothHapPresetInfo.Builder(0x01, "onPresetInfo") - .setWritable(true) - .setAvailable(false) - .build() - }; - mNativeInterface.onPresetInfo(TEST_DEVICE_ADDRESS, infoReason, presets); - - ArgumentCaptor<HapClientStackEvent> event = - ArgumentCaptor.forClass(HapClientStackEvent.class); - verify(mService).messageFromNative(event.capture()); - assertThat(event.getValue().type).isEqualTo(HapClientStackEvent.EVENT_TYPE_ON_PRESET_INFO); - assertThat(event.getValue().valueInt2).isEqualTo(infoReason); - assertThat(event.getValue().valueList.toArray()).isEqualTo(presets); - } - - @Test - public void onGroupPresetInfo() { - int groupId = 100; - int infoReason = HapClientStackEvent.PRESET_INFO_REASON_ALL_PRESET_INFO; - BluetoothHapPresetInfo[] presets = { - new BluetoothHapPresetInfo.Builder(0x01, "onPresetInfo") - .setWritable(true) - .setAvailable(false) - .build() - }; - mNativeInterface.onGroupPresetInfo(groupId, infoReason, presets); - - ArgumentCaptor<HapClientStackEvent> event = - ArgumentCaptor.forClass(HapClientStackEvent.class); - verify(mService).messageFromNative(event.capture()); - assertThat(event.getValue().type).isEqualTo(HapClientStackEvent.EVENT_TYPE_ON_PRESET_INFO); - assertThat(event.getValue().valueInt2).isEqualTo(infoReason); - assertThat(event.getValue().valueInt3).isEqualTo(groupId); - assertThat(event.getValue().valueList.toArray()).isEqualTo(presets); - } - - @Test - public void onPresetNameSetError() { - int presetIndex = 2; - int resultCode = HapClientStackEvent.STATUS_SET_NAME_NOT_ALLOWED; - mNativeInterface.onPresetNameSetError(TEST_DEVICE_ADDRESS, presetIndex, resultCode); - - ArgumentCaptor<HapClientStackEvent> event = - ArgumentCaptor.forClass(HapClientStackEvent.class); - verify(mService).messageFromNative(event.capture()); - assertThat(event.getValue().type) - .isEqualTo(HapClientStackEvent.EVENT_TYPE_ON_PRESET_NAME_SET_ERROR); - assertThat(event.getValue().valueInt1).isEqualTo(resultCode); - assertThat(event.getValue().valueInt2).isEqualTo(presetIndex); - } - - @Test - public void onGroupPresetNameSetError() { - int groupId = 5; - int presetIndex = 2; - int resultCode = HapClientStackEvent.STATUS_SET_NAME_NOT_ALLOWED; - mNativeInterface.onGroupPresetNameSetError(groupId, presetIndex, resultCode); - - ArgumentCaptor<HapClientStackEvent> event = - ArgumentCaptor.forClass(HapClientStackEvent.class); - verify(mService).messageFromNative(event.capture()); - assertThat(event.getValue().type) - .isEqualTo(HapClientStackEvent.EVENT_TYPE_ON_PRESET_NAME_SET_ERROR); - assertThat(event.getValue().valueInt1).isEqualTo(resultCode); - assertThat(event.getValue().valueInt2).isEqualTo(presetIndex); - assertThat(event.getValue().valueInt3).isEqualTo(groupId); - } - - @Test - public void onPresetInfoError() { - int presetIndex = 2; - int resultCode = HapClientStackEvent.STATUS_SET_NAME_NOT_ALLOWED; - mNativeInterface.onPresetInfoError(TEST_DEVICE_ADDRESS, presetIndex, resultCode); - - ArgumentCaptor<HapClientStackEvent> event = - ArgumentCaptor.forClass(HapClientStackEvent.class); - verify(mService).messageFromNative(event.capture()); - assertThat(event.getValue().type) - .isEqualTo(HapClientStackEvent.EVENT_TYPE_ON_PRESET_INFO_ERROR); - assertThat(event.getValue().valueInt1).isEqualTo(resultCode); - assertThat(event.getValue().valueInt2).isEqualTo(presetIndex); - } - - @Test - public void onGroupPresetInfoError() { - int groupId = 5; - int presetIndex = 2; - int resultCode = HapClientStackEvent.STATUS_SET_NAME_NOT_ALLOWED; - mNativeInterface.onGroupPresetInfoError(groupId, presetIndex, resultCode); - - ArgumentCaptor<HapClientStackEvent> event = - ArgumentCaptor.forClass(HapClientStackEvent.class); - verify(mService).messageFromNative(event.capture()); - assertThat(event.getValue().type) - .isEqualTo(HapClientStackEvent.EVENT_TYPE_ON_PRESET_INFO_ERROR); - assertThat(event.getValue().valueInt1).isEqualTo(resultCode); - assertThat(event.getValue().valueInt2).isEqualTo(presetIndex); - assertThat(event.getValue().valueInt3).isEqualTo(groupId); - } -} diff --git a/android/app/tests/unit/src/com/android/bluetooth/hap/HapClientServiceTest.java b/android/app/tests/unit/src/com/android/bluetooth/hap/HapClientServiceTest.java index 7a8bd0a55c..48a8ce3c14 100644 --- a/android/app/tests/unit/src/com/android/bluetooth/hap/HapClientServiceTest.java +++ b/android/app/tests/unit/src/com/android/bluetooth/hap/HapClientServiceTest.java @@ -28,14 +28,15 @@ import static android.bluetooth.BluetoothProfile.STATE_DISCONNECTED; import static androidx.test.espresso.intent.matcher.IntentMatchers.hasAction; import static androidx.test.espresso.intent.matcher.IntentMatchers.hasExtra; +import static com.google.common.truth.Truth.assertThat; + import static org.hamcrest.core.AllOf.allOf; import static org.mockito.Mockito.after; import static org.mockito.Mockito.any; -import static org.mockito.Mockito.anyInt; -import static org.mockito.Mockito.doCallRealMethod; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.eq; import static org.mockito.Mockito.inOrder; +import static org.mockito.Mockito.never; import static org.mockito.Mockito.timeout; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; @@ -52,7 +53,6 @@ import android.bluetooth.BluetoothUuid; import android.bluetooth.IBluetoothHapClientCallback; import android.os.Binder; import android.os.ParcelUuid; -import android.os.RemoteException; import androidx.test.filters.MediumTest; import androidx.test.runner.AndroidJUnit4; @@ -79,7 +79,6 @@ import org.mockito.junit.MockitoRule; import java.util.ArrayList; import java.util.Arrays; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Optional; @@ -90,10 +89,9 @@ import java.util.concurrent.TimeoutException; public class HapClientServiceTest { private static final int TIMEOUT_MS = 1000; private final BluetoothAdapter mAdapter = BluetoothAdapter.getDefaultAdapter(); - private BluetoothDevice mDevice; - private BluetoothDevice mDevice2; - private BluetoothDevice mDevice3; - private HapClientService mService; + private final BluetoothDevice mDevice = TestUtils.getTestDevice(mAdapter, 0); + private final BluetoothDevice mDevice2 = TestUtils.getTestDevice(mAdapter, 1); + private final BluetoothDevice mDevice3 = TestUtils.getTestDevice(mAdapter, 2); @Rule public MockitoRule mockitoRule = MockitoJUnit.rule(); @@ -102,60 +100,35 @@ public class HapClientServiceTest { @Mock private HapClientNativeInterface mNativeInterface; @Mock private ServiceFactory mServiceFactory; @Mock private CsipSetCoordinatorService mCsipService; - @Mock private IBluetoothHapClientCallback mCallback; + @Mock private IBluetoothHapClientCallback mFrameworkCallback; @Mock private Binder mBinder; + private HapClientService mService; + private HapClientNativeCallback mNativeCallback; + @Before public void setUp() throws Exception { HapClientStateMachine.sConnectTimeoutMs = TIMEOUT_MS; doReturn(mDatabaseManager).when(mAdapterService).getDatabase(); + doReturn(mDevice).when(mAdapterService).getDeviceFromByte(eq(getByteAddress(mDevice))); + doReturn(mDevice2).when(mAdapterService).getDeviceFromByte(eq(getByteAddress(mDevice2))); + doReturn(mDevice3).when(mAdapterService).getDeviceFromByte(eq(getByteAddress(mDevice3))); - startService(); - mService.mFactory = mServiceFactory; doReturn(mCsipService).when(mServiceFactory).getCsipSetCoordinatorService(); - when(mCallback.asBinder()).thenReturn(mBinder); - mService.mCallbacks.register(mCallback); - - mDevice = TestUtils.getTestDevice(mAdapter, 0); - when(mNativeInterface.getDevice(getByteAddress(mDevice))).thenReturn(mDevice); - mDevice2 = TestUtils.getTestDevice(mAdapter, 1); - when(mNativeInterface.getDevice(getByteAddress(mDevice2))).thenReturn(mDevice2); - mDevice3 = TestUtils.getTestDevice(mAdapter, 2); - when(mNativeInterface.getDevice(getByteAddress(mDevice3))).thenReturn(mDevice3); - - doCallRealMethod() - .when(mNativeInterface) - .sendMessageToService(any(HapClientStackEvent.class)); - doCallRealMethod().when(mNativeInterface).onFeaturesUpdate(any(byte[].class), anyInt()); - doCallRealMethod().when(mNativeInterface).onDeviceAvailable(any(byte[].class), anyInt()); - doCallRealMethod() - .when(mNativeInterface) - .onActivePresetSelected(any(byte[].class), anyInt()); - doCallRealMethod() - .when(mNativeInterface) - .onActivePresetSelectError(any(byte[].class), anyInt()); - doCallRealMethod() - .when(mNativeInterface) - .onPresetNameSetError(any(byte[].class), anyInt(), anyInt()); - doCallRealMethod() - .when(mNativeInterface) - .onPresetInfo(any(byte[].class), anyInt(), any(BluetoothHapPresetInfo[].class)); - doCallRealMethod() - .when(mNativeInterface) - .onGroupPresetNameSetError(anyInt(), anyInt(), anyInt()); + doReturn(mBinder).when(mFrameworkCallback).asBinder(); /* Prepare CAS groups */ doReturn(Arrays.asList(0x02, 0x03)).when(mCsipService).getAllGroupIds(BluetoothUuid.CAP); int groupId2 = 0x02; - Map groups2 = new HashMap<Integer, ParcelUuid>(); - groups2.put(groupId2, ParcelUuid.fromString("00001853-0000-1000-8000-00805F9B34FB")); + Map groups2 = + Map.of(groupId2, ParcelUuid.fromString("00001853-0000-1000-8000-00805F9B34FB")); int groupId3 = 0x03; - Map groups3 = new HashMap<Integer, ParcelUuid>(); - groups3.put(groupId3, ParcelUuid.fromString("00001853-0000-1000-8000-00805F9B34FB")); + Map groups3 = + Map.of(groupId3, ParcelUuid.fromString("00001853-0000-1000-8000-00805F9B34FB")); doReturn(Arrays.asList(mDevice, mDevice2)) .when(mCsipService) @@ -175,6 +148,11 @@ public class HapClientServiceTest { .when(mAdapterService) .getRemoteUuids(any(BluetoothDevice.class)); doReturn(mDatabaseManager).when(mAdapterService).getDatabase(); + + startService(); + mNativeCallback = new HapClientNativeCallback(mAdapterService, mService); + mService.mFactory = mServiceFactory; + mService.mCallbacks.register(mFrameworkCallback); } @After @@ -183,7 +161,7 @@ public class HapClientServiceTest { return; } - mService.mCallbacks.unregister(mCallback); + mService.mCallbacks.unregister(mFrameworkCallback); stopService(); } @@ -200,13 +178,11 @@ public class HapClientServiceTest { Assert.assertNull(mService); } - /** Test getting HA Service Client */ @Test public void testGetHapService() { Assert.assertEquals(mService, HapClientService.getHapClientService()); } - /** Test get/set policy for BluetoothDevice */ @Test public void testGetSetPolicy() throws Exception { when(mDatabaseManager.getProfileConnectionPolicy(mDevice, BluetoothProfile.HAP_CLIENT)) @@ -232,7 +208,6 @@ public class HapClientServiceTest { policy); } - /** Test if getProfileConnectionPolicy works after the service is stopped. */ @Test public void testGetPolicyAfterStopped() { mService.stop(); @@ -244,7 +219,6 @@ public class HapClientServiceTest { mService.getConnectionPolicy(mDevice)); } - /** Test okToConnect method using various test cases */ @Test public void testOkToConnect() { int badPolicyValue = 1024; @@ -306,7 +280,6 @@ public class HapClientServiceTest { testOkToConnectCase(mDevice, badBondState, badPolicyValue, false); } - /** Test that an outgoing connection to device that does not have HAS UUID is rejected */ @Test public void testOutgoingConnectMissingHasUuid() { // Update the device policy so okToConnect() returns true @@ -324,7 +297,6 @@ public class HapClientServiceTest { Assert.assertFalse("Connect expected to fail", mService.connect(mDevice)); } - /** Test that an outgoing connection to device that have HAS UUID is successful */ @Test public void testOutgoingConnectExistingHasUuid() { // Update the device policy so okToConnect() returns true @@ -343,7 +315,6 @@ public class HapClientServiceTest { verify(mAdapterService, timeout(TIMEOUT_MS)).sendBroadcastMultiplePermissions(any(), any()); } - /** Test that an outgoing connection to device with POLICY_FORBIDDEN is rejected */ @Test public void testOutgoingConnectPolicyForbidden() { doReturn(true).when(mNativeInterface).connectHapClient(any(BluetoothDevice.class)); @@ -357,7 +328,6 @@ public class HapClientServiceTest { Assert.assertFalse("Connect expected to fail", mService.connect(mDevice)); } - /** Test that an outgoing connection times out */ @Test public void testOutgoingConnectTimeout() throws Exception { InOrder order = inOrder(mAdapterService); @@ -385,7 +355,7 @@ public class HapClientServiceTest { BluetoothProfile.STATE_CONNECTING, mService.getConnectionState(mDevice)); // Verify the connection state broadcast, and that we are in Disconnected state via binder - order.verify(mAdapterService, timeout(HapClientStateMachine.sConnectTimeoutMs * 2)) + order.verify(mAdapterService, timeout(HapClientStateMachine.sConnectTimeoutMs * 2L)) .sendBroadcastMultiplePermissions( argThat( allOf( @@ -399,7 +369,6 @@ public class HapClientServiceTest { Assert.assertEquals(BluetoothProfile.STATE_DISCONNECTED, state); } - /** Test that an outgoing connection to two device that have HAS UUID is successful */ @Test public void testConnectTwo() throws Exception { InOrder order = inOrder(mAdapterService); @@ -420,9 +389,6 @@ public class HapClientServiceTest { Assert.assertNotEquals(mDevice, Device2); } - /** - * Test that for the unknown device the API calls are not forwarded down the stack to native. - */ @Test public void testCallsForNotConnectedDevice() { Assert.assertEquals( @@ -430,7 +396,6 @@ public class HapClientServiceTest { mService.getActivePresetIndex(mDevice)); } - /** Test getting HAS coordinated sets. */ @Test public void testGetHapGroupCoordinatedOps() throws Exception { InOrder order = inOrder(mAdapterService); @@ -441,14 +406,14 @@ public class HapClientServiceTest { testConnectingDevice(order, mDevice2); testConnectingDevice(order, mDevice3); - mNativeInterface.onFeaturesUpdate(getByteAddress(mDevice), 0x04); - mNativeInterface.onFeaturesUpdate(getByteAddress(mDevice3), 0x04); + mNativeCallback.onFeaturesUpdate(getByteAddress(mDevice), 0x04); + mNativeCallback.onFeaturesUpdate(getByteAddress(mDevice3), 0x04); /* This one has no coordinated operation support but is part of a coordinated set with * mDevice, which supports it, thus mDevice will forward the operation to mDevice2. * This device should also be rocognised as grouped one. */ - mNativeInterface.onFeaturesUpdate(getByteAddress(mDevice2), 0); + mNativeCallback.onFeaturesUpdate(getByteAddress(mDevice2), 0); /* Two devices support coordinated operations thus shall report valid group ID */ Assert.assertEquals(2, mService.getHapGroup(mDevice)); @@ -459,9 +424,8 @@ public class HapClientServiceTest { Assert.assertEquals(2, hapGroup); } - /** Test that selectPreset properly calls the native method. */ @Test - public void testSelectPresetNative() { + public void testSelectPresetNative() throws Exception { InOrder order = inOrder(mAdapterService); doReturn(new ParcelUuid[] {BluetoothUuid.HAS}) .when(mAdapterService) @@ -470,22 +434,17 @@ public class HapClientServiceTest { // Verify Native Interface call mService.selectPreset(mDevice, 0x00); - verify(mNativeInterface, times(0)).selectActivePreset(eq(mDevice), eq(0x00)); - try { - verify(mCallback, after(TIMEOUT_MS).times(1)) - .onPresetSelectionFailed( - eq(mDevice), eq(BluetoothStatusCodes.ERROR_HAP_INVALID_PRESET_INDEX)); - } catch (RemoteException e) { - throw e.rethrowFromSystemServer(); - } + verify(mNativeInterface, never()).selectActivePreset(eq(mDevice), eq(0x00)); + verify(mFrameworkCallback, after(TIMEOUT_MS)) + .onPresetSelectionFailed( + eq(mDevice), eq(BluetoothStatusCodes.ERROR_HAP_INVALID_PRESET_INDEX)); mService.selectPreset(mDevice, 0x01); - verify(mNativeInterface, times(1)).selectActivePreset(eq(mDevice), eq(0x01)); + verify(mNativeInterface).selectActivePreset(eq(mDevice), eq(0x01)); } - /** Test that groupSelectActivePreset properly calls the native method. */ @Test - public void testGroupSelectActivePresetNative() { + public void testGroupSelectActivePresetNative() throws Exception { InOrder order = inOrder(mAdapterService); doReturn(new ParcelUuid[] {BluetoothUuid.HAS}) .when(mAdapterService) @@ -493,23 +452,18 @@ public class HapClientServiceTest { testConnectingDevice(order, mDevice3); int flags = 0x01; - mNativeInterface.onFeaturesUpdate(getByteAddress(mDevice3), flags); + mNativeCallback.onFeaturesUpdate(getByteAddress(mDevice3), flags); // Verify Native Interface call mService.selectPresetForGroup(0x03, 0x00); - try { - verify(mCallback, after(TIMEOUT_MS).times(1)) - .onPresetSelectionForGroupFailed( - eq(0x03), eq(BluetoothStatusCodes.ERROR_HAP_INVALID_PRESET_INDEX)); - } catch (RemoteException e) { - throw e.rethrowFromSystemServer(); - } + verify(mFrameworkCallback, after(TIMEOUT_MS)) + .onPresetSelectionForGroupFailed( + eq(0x03), eq(BluetoothStatusCodes.ERROR_HAP_INVALID_PRESET_INDEX)); mService.selectPresetForGroup(0x03, 0x01); - verify(mNativeInterface, times(1)).groupSelectActivePreset(eq(0x03), eq(0x01)); + verify(mNativeInterface).groupSelectActivePreset(eq(0x03), eq(0x01)); } - /** Test that nextActivePreset properly calls the native method. */ @Test public void testSwitchToNextPreset() { InOrder order = inOrder(mAdapterService); @@ -520,10 +474,9 @@ public class HapClientServiceTest { // Verify Native Interface call mService.switchToNextPreset(mDevice); - verify(mNativeInterface, times(1)).nextActivePreset(eq(mDevice)); + verify(mNativeInterface).nextActivePreset(eq(mDevice)); } - /** Test that groupNextActivePreset properly calls the native method. */ @Test public void testSwitchToNextPresetForGroup() { InOrder order = inOrder(mAdapterService); @@ -532,14 +485,13 @@ public class HapClientServiceTest { .getRemoteUuids(any(BluetoothDevice.class)); testConnectingDevice(order, mDevice3); int flags = 0x01; - mNativeInterface.onFeaturesUpdate(getByteAddress(mDevice3), flags); + mNativeCallback.onFeaturesUpdate(getByteAddress(mDevice3), flags); // Verify Native Interface call mService.switchToNextPresetForGroup(0x03); - verify(mNativeInterface, times(1)).groupNextActivePreset(eq(0x03)); + verify(mNativeInterface).groupNextActivePreset(eq(0x03)); } - /** Test that previousActivePreset properly calls the native method. */ @Test public void testSwitchToPreviousPreset() { InOrder order = inOrder(mAdapterService); @@ -550,10 +502,9 @@ public class HapClientServiceTest { // Verify Native Interface call mService.switchToPreviousPreset(mDevice); - verify(mNativeInterface, times(1)).previousActivePreset(eq(mDevice)); + verify(mNativeInterface).previousActivePreset(eq(mDevice)); } - /** Test that groupPreviousActivePreset properly calls the native method. */ @Test public void testSwitchToPreviousPresetForGroup() { InOrder order = inOrder(mAdapterService); @@ -564,14 +515,13 @@ public class HapClientServiceTest { testConnectingDevice(order, mDevice2); int flags = 0x01; - mNativeInterface.onFeaturesUpdate(getByteAddress(mDevice), flags); + mNativeCallback.onFeaturesUpdate(getByteAddress(mDevice), flags); // Verify Native Interface call mService.switchToPreviousPresetForGroup(0x02); - verify(mNativeInterface, times(1)).groupPreviousActivePreset(eq(0x02)); + verify(mNativeInterface).groupPreviousActivePreset(eq(0x02)); } - /** Test that getActivePresetIndex returns cached value. */ @Test public void testGetActivePresetIndex() throws Exception { InOrder order = inOrder(mAdapterService); @@ -586,7 +536,6 @@ public class HapClientServiceTest { Assert.assertEquals(0x01, presetIndex); } - /** Test that getActivePresetInfo returns cached value for valid parameters. */ @Test public void testGetPresetInfoAndActivePresetInfo() throws Exception { InOrder order = inOrder(mAdapterService); @@ -617,9 +566,8 @@ public class HapClientServiceTest { Assert.assertEquals("One", info.getName()); } - /** Test that setPresetName properly calls the native method for the valid parameters. */ @Test - public void testSetPresetNameNative() { + public void testSetPresetNameNative() throws Exception { InOrder order = inOrder(mAdapterService); doReturn(new ParcelUuid[] {BluetoothUuid.HAS}) .when(mAdapterService) @@ -627,27 +575,19 @@ public class HapClientServiceTest { testConnectingDevice(order, mDevice); mService.setPresetName(mDevice, 0x00, "ExamplePresetName"); - verify(mNativeInterface, times(0)) + verify(mNativeInterface, never()) .setPresetName(eq(mDevice), eq(0x00), eq("ExamplePresetName")); - try { - verify(mCallback, after(TIMEOUT_MS).times(1)) - .onSetPresetNameFailed( - eq(mDevice), eq(BluetoothStatusCodes.ERROR_HAP_INVALID_PRESET_INDEX)); - } catch (RemoteException e) { - throw e.rethrowFromSystemServer(); - } + verify(mFrameworkCallback) + .onSetPresetNameFailed( + eq(mDevice), eq(BluetoothStatusCodes.ERROR_HAP_INVALID_PRESET_INDEX)); // Verify Native Interface call mService.setPresetName(mDevice, 0x01, "ExamplePresetName"); - verify(mNativeInterface, times(1)) - .setPresetName(eq(mDevice), eq(0x01), eq("ExamplePresetName")); + verify(mNativeInterface).setPresetName(eq(mDevice), eq(0x01), eq("ExamplePresetName")); } - /** - * Test that setPresetNameForGroup properly calls the native method for the valid parameters. - */ @Test - public void testSetPresetNameForGroup() { + public void testSetPresetNameForGroup() throws Exception { InOrder order = inOrder(mAdapterService); doReturn(new ParcelUuid[] {BluetoothUuid.HAS}) .when(mAdapterService) @@ -658,104 +598,65 @@ public class HapClientServiceTest { } int flags = 0x21; - mNativeInterface.onFeaturesUpdate(getByteAddress(mDevice), flags); + mNativeCallback.onFeaturesUpdate(getByteAddress(mDevice), flags); mService.setPresetNameForGroup(test_group, 0x00, "ExamplePresetName"); - try { - verify(mCallback, after(TIMEOUT_MS).times(1)) - .onSetPresetNameForGroupFailed( - eq(test_group), - eq(BluetoothStatusCodes.ERROR_HAP_INVALID_PRESET_INDEX)); - } catch (RemoteException e) { - throw e.rethrowFromSystemServer(); - } + verify(mFrameworkCallback, after(TIMEOUT_MS)) + .onSetPresetNameForGroupFailed( + eq(test_group), eq(BluetoothStatusCodes.ERROR_HAP_INVALID_PRESET_INDEX)); mService.setPresetNameForGroup(-1, 0x01, "ExamplePresetName"); - try { - verify(mCallback, after(TIMEOUT_MS).times(1)) - .onSetPresetNameForGroupFailed( - eq(-1), eq(BluetoothStatusCodes.ERROR_CSIP_INVALID_GROUP_ID)); - } catch (RemoteException e) { - throw e.rethrowFromSystemServer(); - } + verify(mFrameworkCallback, after(TIMEOUT_MS)) + .onSetPresetNameForGroupFailed( + eq(-1), eq(BluetoothStatusCodes.ERROR_CSIP_INVALID_GROUP_ID)); // Verify Native Interface call mService.setPresetNameForGroup(test_group, 0x01, "ExamplePresetName"); - verify(mNativeInterface, times(1)) + verify(mNativeInterface) .groupSetPresetName(eq(test_group), eq(0x01), eq("ExamplePresetName")); } - /** Test that native callback generates proper intent. */ @Test public void testStackEventDeviceAvailable() { - doReturn(new ParcelUuid[] {BluetoothUuid.HAS}) - .when(mAdapterService) - .getRemoteUuids(any(BluetoothDevice.class)); + int features = 0x03; - doCallRealMethod().when(mNativeInterface).onDeviceAvailable(any(byte[].class), anyInt()); - mNativeInterface.onDeviceAvailable(getByteAddress(mDevice), 0x03); + mNativeCallback.onDeviceAvailable(getByteAddress(mDevice), features); - verify(mAdapterService, timeout(TIMEOUT_MS)) + verify(mAdapterService) .sendBroadcastMultiplePermissions( argThat( allOf( hasAction(ACTION_HAP_DEVICE_AVAILABLE), hasExtra(BluetoothDevice.EXTRA_DEVICE, mDevice), - hasExtra(BluetoothHapClient.EXTRA_HAP_FEATURES, 0x03))), + hasExtra(BluetoothHapClient.EXTRA_HAP_FEATURES, features))), any()); } - /** Test that native callback generates proper callback call. */ @Test - public void testStackEventOnPresetSelected() { - doReturn(new ParcelUuid[] {BluetoothUuid.HAS}) - .when(mAdapterService) - .getRemoteUuids(any(BluetoothDevice.class)); + public void testStackEventOnPresetSelected() throws Exception { + int presetIndex = 0x01; - doCallRealMethod() - .when(mNativeInterface) - .onActivePresetSelected(any(byte[].class), anyInt()); - mNativeInterface.onActivePresetSelected(getByteAddress(mDevice), 0x01); - - try { - verify(mCallback, after(TIMEOUT_MS).times(1)) - .onPresetSelected( - eq(mDevice), - eq(0x01), - eq(BluetoothStatusCodes.REASON_LOCAL_STACK_REQUEST)); - } catch (RemoteException e) { - throw e.rethrowFromSystemServer(); - } + mNativeCallback.onActivePresetSelected(getByteAddress(mDevice), presetIndex); - // Verify that getting current preset returns a proper value now - Assert.assertEquals(0x01, mService.getActivePresetIndex(mDevice)); + verify(mFrameworkCallback) + .onPresetSelected( + eq(mDevice), + eq(presetIndex), + eq(BluetoothStatusCodes.REASON_LOCAL_STACK_REQUEST)); + assertThat(mService.getActivePresetIndex(mDevice)).isEqualTo(presetIndex); } - /** Test that native callback generates proper callback call. */ @Test - public void testStackEventOnActivePresetSelectError() { - doReturn(new ParcelUuid[] {BluetoothUuid.HAS}) - .when(mAdapterService) - .getRemoteUuids(any(BluetoothDevice.class)); + public void testStackEventOnActivePresetSelectError() throws Exception { + mNativeCallback.onActivePresetSelectError(getByteAddress(mDevice), 0x05); - doCallRealMethod() - .when(mNativeInterface) - .onActivePresetSelectError(any(byte[].class), anyInt()); - /* Send INVALID_PRESET_INDEX error */ - mNativeInterface.onActivePresetSelectError(getByteAddress(mDevice), 0x05); - - try { - verify(mCallback, after(TIMEOUT_MS).times(1)) - .onPresetSelectionFailed( - eq(mDevice), eq(BluetoothStatusCodes.ERROR_HAP_INVALID_PRESET_INDEX)); - } catch (RemoteException e) { - throw e.rethrowFromSystemServer(); - } + verify(mFrameworkCallback) + .onPresetSelectionFailed( + eq(mDevice), eq(BluetoothStatusCodes.ERROR_HAP_INVALID_PRESET_INDEX)); } - /** Test that native callback generates proper callback call. */ @Test - public void testStackEventOnPresetInfo() { + public void testStackEventOnPresetInfo() throws Exception { InOrder order = inOrder(mAdapterService); doReturn(new ParcelUuid[] {BluetoothUuid.HAS}) .when(mAdapterService) @@ -764,7 +665,7 @@ public class HapClientServiceTest { // Connect and inject initial presets testConnectingDevice(order, mDevice); - int info_reason = HapClientStackEvent.PRESET_INFO_REASON_PRESET_INFO_UPDATE; + int infoReason = HapClientStackEvent.PRESET_INFO_REASON_PRESET_INFO_UPDATE; BluetoothHapPresetInfo[] info = { new BluetoothHapPresetInfo.Builder(0x01, "OneChangedToUnavailable") .setWritable(true) @@ -772,20 +673,15 @@ public class HapClientServiceTest { .build() }; - doCallRealMethod().when(mNativeInterface).onPresetInfo(any(byte[].class), anyInt(), any()); - mNativeInterface.onPresetInfo(getByteAddress(mDevice), info_reason, info); + mNativeCallback.onPresetInfo(getByteAddress(mDevice), infoReason, info); ArgumentCaptor<List<BluetoothHapPresetInfo>> presetsCaptor = ArgumentCaptor.forClass(List.class); - try { - verify(mCallback, after(TIMEOUT_MS).times(1)) - .onPresetInfoChanged( - eq(mDevice), - presetsCaptor.capture(), - eq(BluetoothStatusCodes.REASON_REMOTE_REQUEST)); - } catch (RemoteException e) { - throw e.rethrowFromSystemServer(); - } + verify(mFrameworkCallback) + .onPresetInfoChanged( + eq(mDevice), + presetsCaptor.capture(), + eq(BluetoothStatusCodes.REASON_REMOTE_REQUEST)); List<BluetoothHapPresetInfo> presets = presetsCaptor.getValue(); Assert.assertEquals(3, presets.size()); @@ -797,140 +693,84 @@ public class HapClientServiceTest { Assert.assertTrue(preset.get().isWritable()); } - /** Test that native callback generates proper callback call. */ @Test - public void testStackEventOnPresetNameSetError() { - doReturn(new ParcelUuid[] {BluetoothUuid.HAS}) - .when(mAdapterService) - .getRemoteUuids(any(BluetoothDevice.class)); - - doCallRealMethod() - .when(mNativeInterface) - .onPresetNameSetError(any(byte[].class), anyInt(), anyInt()); + public void testStackEventOnPresetNameSetError() throws Exception { /* Not a valid name length */ - mNativeInterface.onPresetNameSetError( + mNativeCallback.onPresetNameSetError( getByteAddress(mDevice), 0x01, HapClientStackEvent.STATUS_INVALID_PRESET_NAME_LENGTH); - try { - verify(mCallback, after(TIMEOUT_MS).times(1)) - .onSetPresetNameFailed( - eq(mDevice), eq(BluetoothStatusCodes.ERROR_HAP_PRESET_NAME_TOO_LONG)); - } catch (RemoteException e) { - throw e.rethrowFromSystemServer(); - } + verify(mFrameworkCallback) + .onSetPresetNameFailed( + eq(mDevice), eq(BluetoothStatusCodes.ERROR_HAP_PRESET_NAME_TOO_LONG)); /* Invalid preset index provided */ - mNativeInterface.onPresetNameSetError( + mNativeCallback.onPresetNameSetError( getByteAddress(mDevice), 0x01, HapClientStackEvent.STATUS_INVALID_PRESET_INDEX); - try { - verify(mCallback, after(TIMEOUT_MS).times(1)) - .onSetPresetNameFailed( - eq(mDevice), eq(BluetoothStatusCodes.ERROR_HAP_INVALID_PRESET_INDEX)); - } catch (RemoteException e) { - throw e.rethrowFromSystemServer(); - } + verify(mFrameworkCallback) + .onSetPresetNameFailed( + eq(mDevice), eq(BluetoothStatusCodes.ERROR_HAP_INVALID_PRESET_INDEX)); /* Not allowed on this particular preset */ - mNativeInterface.onPresetNameSetError( + mNativeCallback.onPresetNameSetError( getByteAddress(mDevice), 0x01, HapClientStackEvent.STATUS_SET_NAME_NOT_ALLOWED); - try { - verify(mCallback, after(TIMEOUT_MS).times(1)) - .onSetPresetNameFailed( - eq(mDevice), eq(BluetoothStatusCodes.ERROR_REMOTE_OPERATION_REJECTED)); - } catch (RemoteException e) { - throw e.rethrowFromSystemServer(); - } + verify(mFrameworkCallback) + .onSetPresetNameFailed( + eq(mDevice), eq(BluetoothStatusCodes.ERROR_REMOTE_OPERATION_REJECTED)); /* Not allowed on this particular preset at this time, might be possible later on */ - mNativeInterface.onPresetNameSetError( + mNativeCallback.onPresetNameSetError( getByteAddress(mDevice), 0x01, HapClientStackEvent.STATUS_OPERATION_NOT_POSSIBLE); - try { - verify(mCallback, after(TIMEOUT_MS).times(2)) - .onSetPresetNameFailed( - eq(mDevice), eq(BluetoothStatusCodes.ERROR_REMOTE_OPERATION_REJECTED)); - } catch (RemoteException e) { - throw e.rethrowFromSystemServer(); - } + verify(mFrameworkCallback, times(2)) + .onSetPresetNameFailed( + eq(mDevice), eq(BluetoothStatusCodes.ERROR_REMOTE_OPERATION_REJECTED)); /* Not allowed on all presets - for example missing characteristic */ - mNativeInterface.onPresetNameSetError( + mNativeCallback.onPresetNameSetError( getByteAddress(mDevice), 0x01, HapClientStackEvent.STATUS_OPERATION_NOT_SUPPORTED); - try { - verify(mCallback, after(TIMEOUT_MS).times(1)) - .onSetPresetNameFailed( - eq(mDevice), - eq(BluetoothStatusCodes.ERROR_REMOTE_OPERATION_NOT_SUPPORTED)); - } catch (RemoteException e) { - throw e.rethrowFromSystemServer(); - } + verify(mFrameworkCallback) + .onSetPresetNameFailed( + eq(mDevice), eq(BluetoothStatusCodes.ERROR_REMOTE_OPERATION_NOT_SUPPORTED)); } - /** Test that native callback generates proper callback call. */ @Test - public void testStackEventOnGroupPresetNameSetError() { - doReturn(new ParcelUuid[] {BluetoothUuid.HAS}) - .when(mAdapterService) - .getRemoteUuids(any(BluetoothDevice.class)); - - doCallRealMethod() - .when(mNativeInterface) - .onGroupPresetNameSetError(anyInt(), anyInt(), anyInt()); - + public void testStackEventOnGroupPresetNameSetError() throws Exception { + int groupId = 0x01; + int presetIndex = 0x04; /* Not a valid name length */ - mNativeInterface.onGroupPresetNameSetError( - 0x01, 0x01, HapClientStackEvent.STATUS_INVALID_PRESET_NAME_LENGTH); - try { - verify(mCallback, after(TIMEOUT_MS).times(1)) - .onSetPresetNameForGroupFailed( - 0x01, BluetoothStatusCodes.ERROR_HAP_PRESET_NAME_TOO_LONG); - } catch (RemoteException e) { - throw e.rethrowFromSystemServer(); - } + mNativeCallback.onGroupPresetNameSetError( + groupId, presetIndex, HapClientStackEvent.STATUS_INVALID_PRESET_NAME_LENGTH); + verify(mFrameworkCallback) + .onSetPresetNameForGroupFailed( + eq(groupId), eq(BluetoothStatusCodes.ERROR_HAP_PRESET_NAME_TOO_LONG)); /* Invalid preset index provided */ - mNativeInterface.onGroupPresetNameSetError( - 0x01, 0x01, HapClientStackEvent.STATUS_INVALID_PRESET_INDEX); - try { - verify(mCallback, after(TIMEOUT_MS).times(1)) - .onSetPresetNameForGroupFailed( - 0x01, BluetoothStatusCodes.ERROR_HAP_INVALID_PRESET_INDEX); - } catch (RemoteException e) { - throw e.rethrowFromSystemServer(); - } + mNativeCallback.onGroupPresetNameSetError( + groupId, presetIndex, HapClientStackEvent.STATUS_INVALID_PRESET_INDEX); + verify(mFrameworkCallback) + .onSetPresetNameForGroupFailed( + eq(groupId), eq(BluetoothStatusCodes.ERROR_HAP_INVALID_PRESET_INDEX)); /* Not allowed on this particular preset */ - mNativeInterface.onGroupPresetNameSetError( - 0x01, 0x01, HapClientStackEvent.STATUS_SET_NAME_NOT_ALLOWED); - try { - verify(mCallback, after(TIMEOUT_MS).times(1)) - .onSetPresetNameForGroupFailed( - 0x01, BluetoothStatusCodes.ERROR_REMOTE_OPERATION_REJECTED); - } catch (RemoteException e) { - throw e.rethrowFromSystemServer(); - } + mNativeCallback.onGroupPresetNameSetError( + groupId, presetIndex, HapClientStackEvent.STATUS_SET_NAME_NOT_ALLOWED); + verify(mFrameworkCallback) + .onSetPresetNameForGroupFailed( + eq(groupId), eq(BluetoothStatusCodes.ERROR_REMOTE_OPERATION_REJECTED)); /* Not allowed on this particular preset at this time, might be possible later on */ - mNativeInterface.onGroupPresetNameSetError( - 0x01, 0x01, HapClientStackEvent.STATUS_OPERATION_NOT_POSSIBLE); - try { - verify(mCallback, after(TIMEOUT_MS).times(2)) - .onSetPresetNameForGroupFailed( - 0x01, BluetoothStatusCodes.ERROR_REMOTE_OPERATION_REJECTED); - } catch (RemoteException e) { - throw e.rethrowFromSystemServer(); - } + mNativeCallback.onGroupPresetNameSetError( + groupId, presetIndex, HapClientStackEvent.STATUS_OPERATION_NOT_POSSIBLE); + verify(mFrameworkCallback, times(2)) + .onSetPresetNameForGroupFailed( + eq(groupId), eq(BluetoothStatusCodes.ERROR_REMOTE_OPERATION_REJECTED)); /* Not allowed on all presets - for example if peer is missing optional CP characteristic */ - mNativeInterface.onGroupPresetNameSetError( - 0x01, 0x01, HapClientStackEvent.STATUS_OPERATION_NOT_SUPPORTED); - try { - verify(mCallback, after(TIMEOUT_MS).times(1)) - .onSetPresetNameForGroupFailed( - 0x01, BluetoothStatusCodes.ERROR_REMOTE_OPERATION_NOT_SUPPORTED); - } catch (RemoteException e) { - throw e.rethrowFromSystemServer(); - } + mNativeCallback.onGroupPresetNameSetError( + groupId, presetIndex, HapClientStackEvent.STATUS_OPERATION_NOT_SUPPORTED); + verify(mFrameworkCallback) + .onSetPresetNameForGroupFailed( + eq(groupId), eq(BluetoothStatusCodes.ERROR_REMOTE_OPERATION_NOT_SUPPORTED)); } @Test @@ -993,7 +833,6 @@ public class HapClientServiceTest { /** Helper function to test device connecting */ private void prepareConnectingDevice(BluetoothDevice device) { // Prepare intent queue and all the mocks - when(mNativeInterface.getDevice(getByteAddress(device))).thenReturn(device); when(mDatabaseManager.getProfileConnectionPolicy(device, BluetoothProfile.HAP_CLIENT)) .thenReturn(BluetoothProfile.CONNECTION_POLICY_ALLOWED); doReturn(true).when(mNativeInterface).connectHapClient(any(BluetoothDevice.class)); @@ -1080,22 +919,18 @@ public class HapClientServiceTest { device, HapClientStackEvent.PRESET_INFO_REASON_ALL_PRESET_INFO, presets); } - private void testOnPresetSelected(BluetoothDevice device, int index) { + private void testOnPresetSelected(BluetoothDevice device, int index) throws Exception { HapClientStackEvent evt = new HapClientStackEvent(HapClientStackEvent.EVENT_TYPE_ON_ACTIVE_PRESET_SELECTED); evt.device = device; evt.valueInt1 = index; mService.messageFromNative(evt); - try { - verify(mCallback, after(TIMEOUT_MS).times(1)) - .onPresetSelected( - eq(device), - eq(evt.valueInt1), - eq(BluetoothStatusCodes.REASON_LOCAL_STACK_REQUEST)); - } catch (RemoteException e) { - throw e.rethrowFromSystemServer(); - } + verify(mFrameworkCallback, after(TIMEOUT_MS)) + .onPresetSelected( + eq(device), + eq(evt.valueInt1), + eq(BluetoothStatusCodes.REASON_LOCAL_STACK_REQUEST)); } /** Helper function to test okToConnect() method */ diff --git a/android/app/tests/unit/src/com/android/bluetooth/hap/HapClientStateMachineTest.java b/android/app/tests/unit/src/com/android/bluetooth/hap/HapClientStateMachineTest.java index 3e0e920cd2..a61e4ea503 100644 --- a/android/app/tests/unit/src/com/android/bluetooth/hap/HapClientStateMachineTest.java +++ b/android/app/tests/unit/src/com/android/bluetooth/hap/HapClientStateMachineTest.java @@ -215,7 +215,7 @@ public class HapClientStateMachineTest { // Verify that one connection state broadcast is executed ArgumentCaptor<Intent> intentArgument2 = ArgumentCaptor.forClass(Intent.class); - verify(mHapClientService, timeout(HapClientStateMachine.sConnectTimeoutMs * 2).times(2)) + verify(mHapClientService, timeout(HapClientStateMachine.sConnectTimeoutMs * 2L).times(2)) .sendBroadcastWithMultiplePermissions( intentArgument2.capture(), any(String[].class)); Assert.assertEquals( @@ -263,7 +263,7 @@ public class HapClientStateMachineTest { // Verify that one connection state broadcast is executed ArgumentCaptor<Intent> intentArgument2 = ArgumentCaptor.forClass(Intent.class); - verify(mHapClientService, timeout(HapClientStateMachine.sConnectTimeoutMs * 2).times(2)) + verify(mHapClientService, timeout(HapClientStateMachine.sConnectTimeoutMs * 2L).times(2)) .sendBroadcastWithMultiplePermissions( intentArgument2.capture(), any(String[].class)); Assert.assertEquals( diff --git a/android/app/tests/unit/src/com/android/bluetooth/hearingaid/HearingAidStateMachineTest.java b/android/app/tests/unit/src/com/android/bluetooth/hearingaid/HearingAidStateMachineTest.java index e5a0aa9d1d..64b7573555 100644 --- a/android/app/tests/unit/src/com/android/bluetooth/hearingaid/HearingAidStateMachineTest.java +++ b/android/app/tests/unit/src/com/android/bluetooth/hearingaid/HearingAidStateMachineTest.java @@ -21,12 +21,10 @@ import static org.mockito.Mockito.*; import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothProfile; -import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.os.HandlerThread; -import androidx.test.InstrumentationRegistry; import androidx.test.filters.MediumTest; import androidx.test.runner.AndroidJUnit4; @@ -200,7 +198,7 @@ public class HearingAidStateMachineTest { // Verify that one connection state broadcast is executed ArgumentCaptor<Intent> intentArgument2 = ArgumentCaptor.forClass(Intent.class); - verify(mHearingAidService, timeout(HearingAidStateMachine.sConnectTimeoutMs * 2).times(2)) + verify(mHearingAidService, timeout(HearingAidStateMachine.sConnectTimeoutMs * 2L).times(2)) .sendBroadcast(intentArgument2.capture(), anyString(), any(Bundle.class)); Assert.assertEquals( BluetoothProfile.STATE_DISCONNECTED, @@ -247,7 +245,7 @@ public class HearingAidStateMachineTest { // Verify that one connection state broadcast is executed ArgumentCaptor<Intent> intentArgument2 = ArgumentCaptor.forClass(Intent.class); - verify(mHearingAidService, timeout(HearingAidStateMachine.sConnectTimeoutMs * 2).times(2)) + verify(mHearingAidService, timeout(HearingAidStateMachine.sConnectTimeoutMs * 2L).times(2)) .sendBroadcast(intentArgument2.capture(), anyString(), any(Bundle.class)); Assert.assertEquals( BluetoothProfile.STATE_DISCONNECTED, diff --git a/android/app/tests/unit/src/com/android/bluetooth/le_audio/LeAudioServiceTest.java b/android/app/tests/unit/src/com/android/bluetooth/le_audio/LeAudioServiceTest.java index 28ddfbd7cc..66373dd2b0 100644 --- a/android/app/tests/unit/src/com/android/bluetooth/le_audio/LeAudioServiceTest.java +++ b/android/app/tests/unit/src/com/android/bluetooth/le_audio/LeAudioServiceTest.java @@ -680,15 +680,15 @@ public class LeAudioServiceTest { mLeftDevice, BluetoothProfile.STATE_DISCONNECTING, BluetoothProfile.STATE_CONNECTED); - assertThat(BluetoothProfile.STATE_DISCONNECTING) - .isEqualTo(mService.getConnectionState(mLeftDevice)); + assertThat(mService.getConnectionState(mLeftDevice)) + .isEqualTo(BluetoothProfile.STATE_DISCONNECTING); verifyConnectionStateIntent( TIMEOUT_MS, mRightDevice, BluetoothProfile.STATE_DISCONNECTING, BluetoothProfile.STATE_CONNECTED); - assertThat(BluetoothProfile.STATE_DISCONNECTING) - .isEqualTo(mService.getConnectionState(mRightDevice)); + assertThat(mService.getConnectionState(mRightDevice)) + .isEqualTo(BluetoothProfile.STATE_DISCONNECTING); // Send a message to trigger disconnection completed connCompletedEvent = @@ -703,8 +703,8 @@ public class LeAudioServiceTest { mLeftDevice, BluetoothProfile.STATE_DISCONNECTED, BluetoothProfile.STATE_DISCONNECTING); - assertThat(BluetoothProfile.STATE_DISCONNECTED) - .isEqualTo(mService.getConnectionState(mLeftDevice)); + assertThat(mService.getConnectionState(mLeftDevice)) + .isEqualTo(BluetoothProfile.STATE_DISCONNECTED); // Send a message to trigger disconnection completed to the right device connCompletedEvent = @@ -719,8 +719,8 @@ public class LeAudioServiceTest { mRightDevice, BluetoothProfile.STATE_DISCONNECTED, BluetoothProfile.STATE_DISCONNECTING); - assertThat(BluetoothProfile.STATE_DISCONNECTED) - .isEqualTo(mService.getConnectionState(mRightDevice)); + assertThat(mService.getConnectionState(mRightDevice)) + .isEqualTo(BluetoothProfile.STATE_DISCONNECTED); // Verify the list of connected devices assertThat(mService.getConnectedDevices().contains(mLeftDevice)).isFalse(); @@ -751,8 +751,8 @@ public class LeAudioServiceTest { mLeftDevice, BluetoothProfile.STATE_CONNECTING, BluetoothProfile.STATE_DISCONNECTED); - assertThat(BluetoothProfile.STATE_CONNECTING) - .isEqualTo(mService.getConnectionState(mLeftDevice)); + assertThat(mService.getConnectionState(mLeftDevice)) + .isEqualTo(BluetoothProfile.STATE_CONNECTING); assertThat(mService.getDevices().contains(mLeftDevice)).isTrue(); // LeAudio stack event: CONNECTION_STATE_DISCONNECTED - state machine should be removed @@ -760,8 +760,8 @@ public class LeAudioServiceTest { mLeftDevice, BluetoothProfile.STATE_DISCONNECTED, BluetoothProfile.STATE_CONNECTING); - assertThat(BluetoothProfile.STATE_DISCONNECTED) - .isEqualTo(mService.getConnectionState(mLeftDevice)); + assertThat(mService.getConnectionState(mLeftDevice)) + .isEqualTo(BluetoothProfile.STATE_DISCONNECTED); assertThat(mService.getDevices().contains(mLeftDevice)).isTrue(); mService.bondStateChanged(mLeftDevice, BluetoothDevice.BOND_NONE); assertThat(mService.getDevices().contains(mLeftDevice)).isFalse(); @@ -777,15 +777,15 @@ public class LeAudioServiceTest { // stack event: CONNECTION_STATE_CONNECTED - state machine should be created generateConnectionMessageFromNative( mLeftDevice, BluetoothProfile.STATE_CONNECTED, BluetoothProfile.STATE_CONNECTING); - assertThat(BluetoothProfile.STATE_CONNECTED) - .isEqualTo(mService.getConnectionState(mLeftDevice)); + assertThat(mService.getConnectionState(mLeftDevice)) + .isEqualTo(BluetoothProfile.STATE_CONNECTED); assertThat(mService.getDevices().contains(mLeftDevice)).isTrue(); // stack event: CONNECTION_STATE_DISCONNECTED - state machine should be removed generateConnectionMessageFromNative( mLeftDevice, BluetoothProfile.STATE_DISCONNECTED, BluetoothProfile.STATE_CONNECTED); - assertThat(BluetoothProfile.STATE_DISCONNECTED) - .isEqualTo(mService.getConnectionState(mLeftDevice)); + assertThat(mService.getConnectionState(mLeftDevice)) + .isEqualTo(BluetoothProfile.STATE_DISCONNECTED); assertThat(mService.getDevices().contains(mLeftDevice)).isTrue(); mService.bondStateChanged(mLeftDevice, BluetoothDevice.BOND_NONE); assertThat(mService.getDevices().contains(mLeftDevice)).isFalse(); @@ -793,16 +793,16 @@ public class LeAudioServiceTest { // stack event: CONNECTION_STATE_DISCONNECTING - state machine should not be created generateUnexpectedConnectionMessageFromNative( mLeftDevice, BluetoothProfile.STATE_DISCONNECTING); - assertThat(BluetoothProfile.STATE_DISCONNECTED) - .isEqualTo(mService.getConnectionState(mLeftDevice)); + assertThat(mService.getConnectionState(mLeftDevice)) + .isEqualTo(BluetoothProfile.STATE_DISCONNECTED); assertThat(mService.getDevices().contains(mLeftDevice)).isFalse(); // stack event: CONNECTION_STATE_DISCONNECTED - state machine should not be created generateUnexpectedConnectionMessageFromNative( mLeftDevice, BluetoothProfile.STATE_DISCONNECTED); - assertThat(BluetoothProfile.STATE_DISCONNECTED) - .isEqualTo(mService.getConnectionState(mLeftDevice)); + assertThat(mService.getConnectionState(mLeftDevice)) + .isEqualTo(BluetoothProfile.STATE_DISCONNECTED); assertThat(mService.getDevices().contains(mLeftDevice)).isFalse(); } @@ -1037,8 +1037,8 @@ public class LeAudioServiceTest { mLeftDevice, BluetoothProfile.STATE_CONNECTING, BluetoothProfile.STATE_DISCONNECTED); - assertThat(BluetoothProfile.STATE_CONNECTING) - .isEqualTo(mService.getConnectionState(mLeftDevice)); + assertThat(mService.getConnectionState(mLeftDevice)) + .isEqualTo(BluetoothProfile.STATE_CONNECTING); assertThat(mService.getDevices().contains(mLeftDevice)).isTrue(); // LeAudio stack event: CONNECTION_STATE_DISCONNECTED - state machine is not removed @@ -1046,8 +1046,8 @@ public class LeAudioServiceTest { mLeftDevice, BluetoothProfile.STATE_DISCONNECTED, BluetoothProfile.STATE_CONNECTING); - assertThat(BluetoothProfile.STATE_DISCONNECTED) - .isEqualTo(mService.getConnectionState(mLeftDevice)); + assertThat(mService.getConnectionState(mLeftDevice)) + .isEqualTo(BluetoothProfile.STATE_DISCONNECTED); assertThat(mService.getDevices().contains(mLeftDevice)).isTrue(); // LeAudio stack event: CONNECTION_STATE_CONNECTING - state machine remains @@ -1055,8 +1055,8 @@ public class LeAudioServiceTest { mLeftDevice, BluetoothProfile.STATE_CONNECTING, BluetoothProfile.STATE_DISCONNECTED); - assertThat(BluetoothProfile.STATE_CONNECTING) - .isEqualTo(mService.getConnectionState(mLeftDevice)); + assertThat(mService.getConnectionState(mLeftDevice)) + .isEqualTo(BluetoothProfile.STATE_CONNECTING); assertThat(mService.getDevices().contains(mLeftDevice)).isTrue(); // Device bond state marked as unbond - state machine is not removed @@ -1070,8 +1070,8 @@ public class LeAudioServiceTest { mLeftDevice, BluetoothProfile.STATE_DISCONNECTED, BluetoothProfile.STATE_CONNECTING); - assertThat(BluetoothProfile.STATE_DISCONNECTED) - .isEqualTo(mService.getConnectionState(mLeftDevice)); + assertThat(mService.getConnectionState(mLeftDevice)) + .isEqualTo(BluetoothProfile.STATE_DISCONNECTED); assertThat(mService.getDevices().contains(mLeftDevice)).isFalse(); } @@ -1094,8 +1094,8 @@ public class LeAudioServiceTest { device, BluetoothProfile.STATE_CONNECTING, BluetoothProfile.STATE_DISCONNECTED); - assertThat(BluetoothProfile.STATE_CONNECTING) - .isEqualTo(mService.getConnectionState(device)); + assertThat(mService.getConnectionState(device)) + .isEqualTo(BluetoothProfile.STATE_CONNECTING); // Send a message to trigger connection completed connCompletedEvent = @@ -1110,7 +1110,7 @@ public class LeAudioServiceTest { device, BluetoothProfile.STATE_CONNECTED, BluetoothProfile.STATE_CONNECTING); - assertThat(BluetoothProfile.STATE_CONNECTED).isEqualTo(mService.getConnectionState(device)); + assertThat(mService.getConnectionState(device)).isEqualTo(BluetoothProfile.STATE_CONNECTED); // Verify that the device is in the list of connected devices assertThat(mService.getConnectedDevices().contains(device)).isTrue(); @@ -1203,8 +1203,8 @@ public class LeAudioServiceTest { mSingleDevice, BluetoothProfile.STATE_CONNECTING, BluetoothProfile.STATE_DISCONNECTED); - assertThat(BluetoothProfile.STATE_CONNECTING) - .isEqualTo(mService.getConnectionState(mSingleDevice)); + assertThat(mService.getConnectionState(mSingleDevice)) + .isEqualTo(BluetoothProfile.STATE_CONNECTING); LeAudioStackEvent connCompletedEvent; // Send a message to trigger connection completed @@ -1220,8 +1220,8 @@ public class LeAudioServiceTest { mSingleDevice, BluetoothProfile.STATE_CONNECTED, BluetoothProfile.STATE_CONNECTING); - assertThat(BluetoothProfile.STATE_CONNECTED) - .isEqualTo(mService.getConnectionState(mSingleDevice)); + assertThat(mService.getConnectionState(mSingleDevice)) + .isEqualTo(BluetoothProfile.STATE_CONNECTED); // Set connection policy to forbidden assertThat( @@ -1247,8 +1247,8 @@ public class LeAudioServiceTest { mSingleDevice, BluetoothProfile.STATE_DISCONNECTING, BluetoothProfile.STATE_CONNECTED); - assertThat(BluetoothProfile.STATE_DISCONNECTING) - .isEqualTo(mService.getConnectionState(mSingleDevice)); + assertThat(mService.getConnectionState(mSingleDevice)) + .isEqualTo(BluetoothProfile.STATE_DISCONNECTING); // Send a message to trigger disconnection completed connCompletedEvent = @@ -1263,8 +1263,8 @@ public class LeAudioServiceTest { mSingleDevice, BluetoothProfile.STATE_DISCONNECTED, BluetoothProfile.STATE_DISCONNECTING); - assertThat(BluetoothProfile.STATE_DISCONNECTED) - .isEqualTo(mService.getConnectionState(mSingleDevice)); + assertThat(mService.getConnectionState(mSingleDevice)) + .isEqualTo(BluetoothProfile.STATE_DISCONNECTED); } /** @@ -1292,8 +1292,8 @@ public class LeAudioServiceTest { device, BluetoothProfile.STATE_CONNECTING, BluetoothProfile.STATE_DISCONNECTED); - assertThat(BluetoothProfile.STATE_CONNECTING) - .isEqualTo(mService.getConnectionState(device)); + assertThat(mService.getConnectionState(device)) + .isEqualTo(BluetoothProfile.STATE_CONNECTING); // Use connected event to indicate that device is connected LeAudioStackEvent connCompletedEvent = @@ -1308,7 +1308,7 @@ public class LeAudioServiceTest { BluetoothProfile.STATE_CONNECTED, BluetoothProfile.STATE_CONNECTING); - assertThat(BluetoothProfile.STATE_CONNECTED).isEqualTo(mService.getConnectionState(device)); + assertThat(mService.getConnectionState(device)).isEqualTo(BluetoothProfile.STATE_CONNECTED); LeAudioStackEvent nodeGroupAdded = new LeAudioStackEvent(LeAudioStackEvent.EVENT_TYPE_GROUP_NODE_STATUS_CHANGED); diff --git a/android/app/tests/unit/src/com/android/bluetooth/le_audio/LeAudioStateMachineTest.java b/android/app/tests/unit/src/com/android/bluetooth/le_audio/LeAudioStateMachineTest.java index 205dab9b9d..103b5b80f9 100644 --- a/android/app/tests/unit/src/com/android/bluetooth/le_audio/LeAudioStateMachineTest.java +++ b/android/app/tests/unit/src/com/android/bluetooth/le_audio/LeAudioStateMachineTest.java @@ -31,12 +31,10 @@ import static org.mockito.Mockito.verify; import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothProfile; -import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.os.HandlerThread; -import androidx.test.InstrumentationRegistry; import androidx.test.filters.MediumTest; import androidx.test.runner.AndroidJUnit4; @@ -99,8 +97,8 @@ public class LeAudioStateMachineTest { /** Test that default state is disconnected */ @Test public void testDefaultDisconnectedState() { - assertThat(BluetoothProfile.STATE_DISCONNECTED) - .isEqualTo(mLeAudioStateMachine.getConnectionState()); + assertThat(mLeAudioStateMachine.getConnectionState()) + .isEqualTo(BluetoothProfile.STATE_DISCONNECTED); } /** @@ -193,7 +191,7 @@ public class LeAudioStateMachineTest { .isInstanceOf(LeAudioStateMachine.Connecting.class); // Verify that one connection state change is notified - verify(mLeAudioService, timeout(LeAudioStateMachine.sConnectTimeoutMs * 2)) + verify(mLeAudioService, timeout(LeAudioStateMachine.sConnectTimeoutMs * 2L)) .notifyConnectionStateChanged( any(), eq(BluetoothProfile.STATE_DISCONNECTED), anyInt()); @@ -226,7 +224,7 @@ public class LeAudioStateMachineTest { .isInstanceOf(LeAudioStateMachine.Connecting.class); // Verify that one connection state change is notified - verify(mLeAudioService, timeout(LeAudioStateMachine.sConnectTimeoutMs * 2)) + verify(mLeAudioService, timeout(LeAudioStateMachine.sConnectTimeoutMs * 2L)) .notifyConnectionStateChanged( any(), eq(BluetoothProfile.STATE_DISCONNECTED), anyInt()); diff --git a/android/app/tests/unit/src/com/android/bluetooth/map/BluetoothMapConvoListingTest.java b/android/app/tests/unit/src/com/android/bluetooth/map/BluetoothMapConvoListingTest.java index f2ae388baf..4f8629f577 100644 --- a/android/app/tests/unit/src/com/android/bluetooth/map/BluetoothMapConvoListingTest.java +++ b/android/app/tests/unit/src/com/android/bluetooth/map/BluetoothMapConvoListingTest.java @@ -18,6 +18,8 @@ package com.android.bluetooth.map; import static com.google.common.truth.Truth.assertThat; +import android.annotation.SuppressLint; + import androidx.test.runner.AndroidJUnit4; import com.android.bluetooth.SignedLongLong; @@ -106,6 +108,7 @@ public class BluetoothMapConvoListingTest { } @Test + @SuppressLint("EqualsIncompatibleType") // That the point of this test public void equals_withDifferentClass_returnsFalse() { assertThat(mListing.equals(mListingElementEarliestWithReadFalse)).isEqualTo(false); } diff --git a/android/app/tests/unit/src/com/android/bluetooth/map/MsgTest.java b/android/app/tests/unit/src/com/android/bluetooth/map/MsgTest.java index b47d0c465b..041a7ff86d 100644 --- a/android/app/tests/unit/src/com/android/bluetooth/map/MsgTest.java +++ b/android/app/tests/unit/src/com/android/bluetooth/map/MsgTest.java @@ -18,6 +18,8 @@ package com.android.bluetooth.map; import static com.google.common.truth.Truth.assertThat; +import android.annotation.SuppressLint; + import androidx.test.filters.SmallTest; import androidx.test.runner.AndroidJUnit4; @@ -67,6 +69,7 @@ public class MsgTest { } @Test + @SuppressLint("TruthIncompatibleType") // That the point of this test public void equals_withDifferentClass() { BluetoothMapContentObserver.Msg msg = new BluetoothMapContentObserver.Msg(TEST_ID, TEST_FOLDER_ID, TEST_READ_FLAG); diff --git a/android/app/tests/unit/src/com/android/bluetooth/mapclient/ObexTimeTest.java b/android/app/tests/unit/src/com/android/bluetooth/mapclient/ObexTimeTest.java index 0d6760716f..5eca9f5333 100644 --- a/android/app/tests/unit/src/com/android/bluetooth/mapclient/ObexTimeTest.java +++ b/android/app/tests/unit/src/com/android/bluetooth/mapclient/ObexTimeTest.java @@ -16,6 +16,8 @@ package com.android.bluetooth.mapclient; +import android.annotation.SuppressLint; + import androidx.test.runner.AndroidJUnit4; import org.junit.Assert; @@ -27,6 +29,7 @@ import java.util.Date; import java.util.TimeZone; @RunWith(AndroidJUnit4.class) +@SuppressLint("UndefinedEquals") public class ObexTimeTest { private static final String TAG = ObexTimeTest.class.getSimpleName(); diff --git a/android/app/tests/unit/src/com/android/bluetooth/mcp/MediaControlGattServiceTest.java b/android/app/tests/unit/src/com/android/bluetooth/mcp/MediaControlGattServiceTest.java index 8b7d34bcdf..1eaef4440c 100644 --- a/android/app/tests/unit/src/com/android/bluetooth/mcp/MediaControlGattServiceTest.java +++ b/android/app/tests/unit/src/com/android/bluetooth/mcp/MediaControlGattServiceTest.java @@ -623,7 +623,7 @@ public class MediaControlGattServiceTest { mCurrentDevice, 1, characteristic, false, true, 0, bb.array()); verify(mMockMcsCallbacks) - .onPlaybackSpeedSetRequest(eq((float) Math.pow(2, playback_speed / 64))); + .onPlaybackSpeedSetRequest(eq((float) Math.pow(2, playback_speed / 64.0))); verify(mMockGattServer) .sendResponse( @@ -1095,7 +1095,7 @@ public class MediaControlGattServiceTest { mCurrentDevice, 1, characteristic, false, true, 0, bb.array()); verify(mMockMcsCallbacks) - .onPlaybackSpeedSetRequest(eq((float) Math.pow(2, playback_speed / 64))); + .onPlaybackSpeedSetRequest(eq((float) Math.pow(2, playback_speed / 64.0))); // Fake characteristic write - this is done by player status update characteristic.setValue(playback_speed, BluetoothGattCharacteristic.FORMAT_SINT8, 0); diff --git a/android/app/tests/unit/src/com/android/bluetooth/opp/BluetoothOppTransferTest.java b/android/app/tests/unit/src/com/android/bluetooth/opp/BluetoothOppTransferTest.java index fbf67c4a73..3e0779ed16 100644 --- a/android/app/tests/unit/src/com/android/bluetooth/opp/BluetoothOppTransferTest.java +++ b/android/app/tests/unit/src/com/android/bluetooth/opp/BluetoothOppTransferTest.java @@ -419,7 +419,7 @@ public class BluetoothOppTransferTest { @Test public void oppConnectionReceiver_onReceiveWithActionSdpRecord_withoutSdpRecord() { - mSetFlagRule.enableFlags(Flags.FLAG_IDENTITY_ADDRESS_NULL_IF_UNKNOWN); + mSetFlagRule.enableFlags(Flags.FLAG_IDENTITY_ADDRESS_NULL_IF_NOT_KNOWN); BluetoothDevice device = (mContext.getSystemService(BluetoothManager.class)) .getAdapter() diff --git a/android/app/tests/unit/src/com/android/bluetooth/opp/TestActivity.java b/android/app/tests/unit/src/com/android/bluetooth/opp/TestActivity.java index 4fa885f183..3d3321838b 100644 --- a/android/app/tests/unit/src/com/android/bluetooth/opp/TestActivity.java +++ b/android/app/tests/unit/src/com/android/bluetooth/opp/TestActivity.java @@ -358,10 +358,8 @@ public class TestActivity extends Activity { new Thread() { @Override public void run() { - synchronized (mServer) { - mServer.a = true; - mServer.notify(); - } + mServer.a = true; + mServer.notify(); } }; notifyThread.start(); @@ -430,7 +428,7 @@ class TestTcpListener { Socket clientSocket = mServerSocket.accept(); if (clientSocket == null) { if (V) { - Log.v(TAG, "incomming connection time out"); + Log.v(TAG, "incoming connection time out"); } } else { if (D) { @@ -520,7 +518,7 @@ class TestTcpServer extends ServerRequestHandler implements Runnable { } TestTcpServer() { - updateStatus("enter construtor of TcpServer"); + updateStatus("enter constructor of TcpServer"); } @Override @@ -539,7 +537,7 @@ class TestTcpServer extends ServerRequestHandler implements Runnable { } } } - updateStatus("[server:] we accpet the seesion"); + updateStatus("[server:] we accept the session"); return ResponseCodes.OBEX_HTTP_OK; } @@ -572,10 +570,10 @@ class TestTcpServer extends ServerRequestHandler implements Runnable { try { fos.close(); } catch (IOException e1) { - e1.printStackTrace(); + Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable())); } } - e.printStackTrace(); + Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable())); } return ResponseCodes.OBEX_HTTP_OK; } diff --git a/android/app/tests/unit/src/com/android/bluetooth/vc/VolumeControlNativeInterfaceTest.java b/android/app/tests/unit/src/com/android/bluetooth/vc/VolumeControlNativeInterfaceTest.java index 1ed290c8b9..5fbea684ba 100644 --- a/android/app/tests/unit/src/com/android/bluetooth/vc/VolumeControlNativeInterfaceTest.java +++ b/android/app/tests/unit/src/com/android/bluetooth/vc/VolumeControlNativeInterfaceTest.java @@ -71,10 +71,11 @@ public class VolumeControlNativeInterfaceTest { public void onVolumeStateChanged() { int volume = 3; boolean mute = false; + int flags = 1; byte[] address = new byte[] {0x00, 0x01, 0x02, 0x03, 0x04, 0x05}; boolean isAutonomous = false; - mNativeInterface.onVolumeStateChanged(volume, mute, address, isAutonomous); + mNativeInterface.onVolumeStateChanged(volume, mute, flags, address, isAutonomous); ArgumentCaptor<VolumeControlStackEvent> event = ArgumentCaptor.forClass(VolumeControlStackEvent.class); diff --git a/android/app/tests/unit/src/com/android/bluetooth/vc/VolumeControlServiceTest.java b/android/app/tests/unit/src/com/android/bluetooth/vc/VolumeControlServiceTest.java index e082b4ad1b..0d216d3cb5 100644 --- a/android/app/tests/unit/src/com/android/bluetooth/vc/VolumeControlServiceTest.java +++ b/android/app/tests/unit/src/com/android/bluetooth/vc/VolumeControlServiceTest.java @@ -539,22 +539,18 @@ public class VolumeControlServiceTest { Assert.assertFalse(mService.getDevices().contains(mDevice)); } + /** Test that various Volume Control stack events will broadcast related states. */ @Test public void testVolumeControlStackEvents() { int group_id = -1; int volume = 6; + int flags = 0; boolean mute = false; + boolean isAutonomous = false; // Send a message to trigger volume state changed broadcast - VolumeControlStackEvent stackEvent = - new VolumeControlStackEvent( - VolumeControlStackEvent.EVENT_TYPE_VOLUME_STATE_CHANGED); - stackEvent.device = mDevice; - stackEvent.valueInt1 = group_id; - stackEvent.valueInt2 = volume; - stackEvent.valueBool1 = mute; - mService.messageFromNative(stackEvent); + generateVolumeStateChanged(mDevice, group_id, volume, flags, mute, isAutonomous); } int getLeAudioVolume(int index, int minIndex, int maxIndex, int streamType) { @@ -614,29 +610,18 @@ public class VolumeControlServiceTest { int streamType = AudioManager.STREAM_MUSIC; int streamVol = getLeAudioVolume(19, MEDIA_MIN_VOL, MEDIA_MAX_VOL, streamType); - // Send a message to trigger volume state changed broadcast - final VolumeControlStackEvent stackEvent = - new VolumeControlStackEvent( - VolumeControlStackEvent.EVENT_TYPE_VOLUME_STATE_CHANGED); - stackEvent.device = null; - stackEvent.valueInt1 = 1; // groupId - stackEvent.valueInt2 = streamVol; - stackEvent.valueBool1 = false; // isMuted - stackEvent.valueBool2 = true; // isAutonomous - doReturn(false).when(mAudioManager).isStreamMute(eq(AudioManager.STREAM_MUSIC)); // Verify that muting LeAudio device, sets the mute state on the audio device - stackEvent.valueBool1 = true; - mService.messageFromNative(stackEvent); + + generateVolumeStateChanged(null, 1, streamVol, 0, true, true); verify(mAudioManager, times(1)) .adjustStreamVolume(eq(streamType), eq(AudioManager.ADJUST_MUTE), anyInt()); doReturn(true).when(mAudioManager).isStreamMute(eq(AudioManager.STREAM_MUSIC)); // Verify that unmuting LeAudio device, unsets the mute state on the audio device - stackEvent.valueBool1 = false; - mService.messageFromNative(stackEvent); + generateVolumeStateChanged(null, 1, streamVol, 0, false, true); verify(mAudioManager, times(1)) .adjustStreamVolume(eq(streamType), eq(AudioManager.ADJUST_UNMUTE), anyInt()); } @@ -655,15 +640,7 @@ public class VolumeControlServiceTest { volume = 10; // Send autonomous volume change. - VolumeControlStackEvent stackEvent = - new VolumeControlStackEvent( - VolumeControlStackEvent.EVENT_TYPE_VOLUME_STATE_CHANGED); - stackEvent.device = null; - stackEvent.valueInt1 = groupId; - stackEvent.valueInt2 = volume; - stackEvent.valueBool1 = false; - stackEvent.valueBool2 = true; /* autonomous */ - mService.messageFromNative(stackEvent); + generateVolumeStateChanged(null, groupId, volume, 0, false, true); Assert.assertEquals(volume, mService.getGroupVolume(groupId)); } @@ -710,15 +687,7 @@ public class VolumeControlServiceTest { Assert.assertEquals(false, mService.getGroupMute(groupId)); // Send autonomous volume change - VolumeControlStackEvent stackEvent = - new VolumeControlStackEvent( - VolumeControlStackEvent.EVENT_TYPE_VOLUME_STATE_CHANGED); - stackEvent.device = null; - stackEvent.valueInt1 = groupId; - stackEvent.valueInt2 = volume; - stackEvent.valueBool1 = false; /* unmuted */ - stackEvent.valueBool2 = true; /* autonomous */ - mService.messageFromNative(stackEvent); + generateVolumeStateChanged(null, groupId, volume, 0, false, true); // Mute mServiceBinder.muteGroup(groupId, mAttributionSource); @@ -728,8 +697,7 @@ public class VolumeControlServiceTest { Assert.assertEquals(volume, mService.getGroupVolume(groupId)); // Send autonomous unmute - stackEvent.valueBool1 = false; /* unmuted */ - mService.messageFromNative(stackEvent); + generateVolumeStateChanged(null, groupId, volume, 0, false, true); Assert.assertEquals(false, mService.getGroupMute(groupId)); } @@ -742,16 +710,7 @@ public class VolumeControlServiceTest { Assert.assertEquals(false, mService.getGroupMute(groupId)); - // Set the initial volume state - VolumeControlStackEvent stackEvent = - new VolumeControlStackEvent( - VolumeControlStackEvent.EVENT_TYPE_VOLUME_STATE_CHANGED); - stackEvent.device = null; - stackEvent.valueInt1 = groupId; - stackEvent.valueInt2 = volume; - stackEvent.valueBool1 = false; /* unmuted */ - stackEvent.valueBool2 = true; /* autonomous */ - mService.messageFromNative(stackEvent); + generateVolumeStateChanged(null, groupId, volume, 0, false, true); // Mute mService.muteGroup(groupId); @@ -788,6 +747,199 @@ public class VolumeControlServiceTest { verify(mNativeInterface, times(1)).unmuteGroup(eq(groupId)); } + /** Test if phone will set volume which is read from the buds */ + @Test + public void testConnectedDeviceWithUserPersistFlagSet() throws Exception { + int groupId = 1; + int volumeDevice = 56; + int volumeDeviceTwo = 100; + int flags = VolumeControlService.VOLUME_FLAGS_PERSISTED_USER_SET_VOLUME_MASK; + boolean initialMuteState = false; + boolean initialAutonomousFlag = true; + + // Both devices are in the same group + when(mCsipService.getGroupId(mDevice, BluetoothUuid.CAP)).thenReturn(groupId); + when(mCsipService.getGroupId(mDeviceTwo, BluetoothUuid.CAP)).thenReturn(groupId); + + // Update the device policy so okToConnect() returns true + when(mAdapterService.getDatabase()).thenReturn(mDatabaseManager); + when(mDatabaseManager.getProfileConnectionPolicy( + any(BluetoothDevice.class), eq(BluetoothProfile.VOLUME_CONTROL))) + .thenReturn(BluetoothProfile.CONNECTION_POLICY_ALLOWED); + doReturn(true).when(mNativeInterface).connectVolumeControl(any(BluetoothDevice.class)); + doReturn(true).when(mNativeInterface).disconnectVolumeControl(any(BluetoothDevice.class)); + + generateDeviceAvailableMessageFromNative(mDevice, 1); + generateConnectionMessageFromNative( + mDevice, BluetoothProfile.STATE_CONNECTED, BluetoothProfile.STATE_DISCONNECTED); + Assert.assertEquals(BluetoothProfile.STATE_CONNECTED, mService.getConnectionState(mDevice)); + Assert.assertTrue(mService.getDevices().contains(mDevice)); + + // Group is not active, AF will not be notified + generateVolumeStateChanged( + mDevice, groupId, volumeDevice, flags, initialMuteState, initialAutonomousFlag); + verify(mAudioManager, times(0)).setStreamVolume(anyInt(), anyInt(), anyInt()); + + // Make device Active now. This will trigger setting volume to AF + when(mLeAudioService.getActiveGroupId()).thenReturn(groupId); + mServiceBinder.setGroupActive(groupId, true, mAttributionSource); + int expectedAfVol = + (int) Math.round((double) (volumeDevice * MEDIA_MAX_VOL) / BT_LE_AUDIO_MAX_VOL); + verify(mAudioManager, times(1)).setStreamVolume(anyInt(), eq(expectedAfVol), anyInt()); + + // Connect second device and read different volume. Expect it will be set to AF and to + // another set member + generateDeviceAvailableMessageFromNative(mDeviceTwo, 1); + generateConnectionMessageFromNative( + mDeviceTwo, BluetoothProfile.STATE_CONNECTED, BluetoothProfile.STATE_DISCONNECTED); + Assert.assertEquals( + BluetoothProfile.STATE_CONNECTED, mService.getConnectionState(mDeviceTwo)); + Assert.assertTrue(mService.getDevices().contains(mDeviceTwo)); + + // Group is now active, AF will be notified. Native will take care to sync the volume + generateVolumeStateChanged( + mDeviceTwo, + groupId, + volumeDeviceTwo, + flags, + initialMuteState, + initialAutonomousFlag); + expectedAfVol = + (int) Math.round((double) (volumeDeviceTwo * MEDIA_MAX_VOL) / BT_LE_AUDIO_MAX_VOL); + verify(mAudioManager, times(1)).setStreamVolume(anyInt(), eq(expectedAfVol), anyInt()); + } + + /** Test if phone will set volume which is read from the buds */ + @Test + public void testConnectedDeviceWithResetFlagSetWithNonZeroVolume() throws Exception { + int groupId = 1; + int volumeDevice = 56; + int volumeDeviceTwo = 100; + int flags = 0; + boolean initialMuteState = false; + boolean initialAutonomousFlag = true; + + // Both devices are in the same group + when(mCsipService.getGroupId(mDevice, BluetoothUuid.CAP)).thenReturn(groupId); + when(mCsipService.getGroupId(mDeviceTwo, BluetoothUuid.CAP)).thenReturn(groupId); + + // Update the device policy so okToConnect() returns true + when(mAdapterService.getDatabase()).thenReturn(mDatabaseManager); + when(mDatabaseManager.getProfileConnectionPolicy( + any(BluetoothDevice.class), eq(BluetoothProfile.VOLUME_CONTROL))) + .thenReturn(BluetoothProfile.CONNECTION_POLICY_ALLOWED); + doReturn(true).when(mNativeInterface).connectVolumeControl(any(BluetoothDevice.class)); + doReturn(true).when(mNativeInterface).disconnectVolumeControl(any(BluetoothDevice.class)); + + generateDeviceAvailableMessageFromNative(mDevice, 1); + generateConnectionMessageFromNative( + mDevice, BluetoothProfile.STATE_CONNECTED, BluetoothProfile.STATE_DISCONNECTED); + Assert.assertEquals(BluetoothProfile.STATE_CONNECTED, mService.getConnectionState(mDevice)); + Assert.assertTrue(mService.getDevices().contains(mDevice)); + + // Group is not active, AF will not be notified + generateVolumeStateChanged( + mDevice, groupId, volumeDevice, flags, initialMuteState, initialAutonomousFlag); + verify(mAudioManager, times(0)).setStreamVolume(anyInt(), anyInt(), anyInt()); + + // Make device Active now. This will trigger setting volume to AF + when(mLeAudioService.getActiveGroupId()).thenReturn(groupId); + mServiceBinder.setGroupActive(groupId, true, mAttributionSource); + int expectedAfVol = + (int) Math.round((double) (volumeDevice * MEDIA_MAX_VOL) / BT_LE_AUDIO_MAX_VOL); + verify(mAudioManager, times(1)).setStreamVolume(anyInt(), eq(expectedAfVol), anyInt()); + + // Connect second device and read different volume. Expect it will be set to AF and to + // another set member + generateDeviceAvailableMessageFromNative(mDeviceTwo, 1); + generateConnectionMessageFromNative( + mDeviceTwo, BluetoothProfile.STATE_CONNECTED, BluetoothProfile.STATE_DISCONNECTED); + Assert.assertEquals( + BluetoothProfile.STATE_CONNECTED, mService.getConnectionState(mDeviceTwo)); + Assert.assertTrue(mService.getDevices().contains(mDeviceTwo)); + + // Group is now active, AF will be notified. Native will take care to sync the volume + generateVolumeStateChanged( + mDeviceTwo, + groupId, + volumeDeviceTwo, + flags, + initialMuteState, + initialAutonomousFlag); + expectedAfVol = + (int) Math.round((double) (volumeDeviceTwo * MEDIA_MAX_VOL) / BT_LE_AUDIO_MAX_VOL); + verify(mAudioManager, times(1)).setStreamVolume(anyInt(), eq(expectedAfVol), anyInt()); + } + + /** Test if phone will set volume to buds which has no volume */ + @Test + public void testConnectedDeviceWithResetFlagSetWithZeroVolume() throws Exception { + int groupId = 1; + int volumeDevice = 0; + int volumeDeviceTwo = 0; + int flags = 0; + boolean initialMuteState = false; + boolean initialAutonomousFlag = true; + int streamVolume = 50; + int streamMaxVolume = 100; + + // Both devices are in the same group + when(mCsipService.getGroupId(mDevice, BluetoothUuid.CAP)).thenReturn(groupId); + when(mCsipService.getGroupId(mDeviceTwo, BluetoothUuid.CAP)).thenReturn(groupId); + + when(mAudioManager.getStreamVolume(anyInt())).thenReturn(streamVolume); + when(mAudioManager.getStreamMaxVolume(anyInt())).thenReturn(streamMaxVolume); + + // Update the device policy so okToConnect() returns true + when(mAdapterService.getDatabase()).thenReturn(mDatabaseManager); + when(mDatabaseManager.getProfileConnectionPolicy( + any(BluetoothDevice.class), eq(BluetoothProfile.VOLUME_CONTROL))) + .thenReturn(BluetoothProfile.CONNECTION_POLICY_ALLOWED); + doReturn(true).when(mNativeInterface).connectVolumeControl(any(BluetoothDevice.class)); + doReturn(true).when(mNativeInterface).disconnectVolumeControl(any(BluetoothDevice.class)); + + generateDeviceAvailableMessageFromNative(mDevice, 1); + generateConnectionMessageFromNative( + mDevice, BluetoothProfile.STATE_CONNECTED, BluetoothProfile.STATE_DISCONNECTED); + Assert.assertEquals(BluetoothProfile.STATE_CONNECTED, mService.getConnectionState(mDevice)); + Assert.assertTrue(mService.getDevices().contains(mDevice)); + + // Group is not active, AF will not be notified but device will get phone volume + int expectedDeviceVol = + (int) Math.round((double) streamVolume * BT_LE_AUDIO_MAX_VOL / streamMaxVolume); + generateVolumeStateChanged( + mDevice, groupId, volumeDevice, flags, initialMuteState, initialAutonomousFlag); + verify(mAudioManager, times(0)).setStreamVolume(anyInt(), anyInt(), anyInt()); + verify(mNativeInterface, times(1)).setGroupVolume(eq(groupId), eq(expectedDeviceVol)); + + // Make device Active now. This will trigger setting volume to AF + when(mLeAudioService.getActiveGroupId()).thenReturn(groupId); + mServiceBinder.setGroupActive(groupId, true, mAttributionSource); + + verify(mAudioManager, times(1)).setStreamVolume(anyInt(), eq(streamVolume), anyInt()); + + // Connect second device and read different volume. Expect it will be set to AF and to + // another set member + generateDeviceAvailableMessageFromNative(mDeviceTwo, 1); + generateConnectionMessageFromNative( + mDeviceTwo, BluetoothProfile.STATE_CONNECTED, BluetoothProfile.STATE_DISCONNECTED); + Assert.assertEquals( + BluetoothProfile.STATE_CONNECTED, mService.getConnectionState(mDeviceTwo)); + Assert.assertTrue(mService.getDevices().contains(mDeviceTwo)); + + // Group is now active, AF will be notified. Native will take care to sync the volume + generateVolumeStateChanged( + mDeviceTwo, + groupId, + volumeDeviceTwo, + flags, + initialMuteState, + initialAutonomousFlag); + + verify(mAudioManager, times(1)).setStreamVolume(anyInt(), anyInt(), anyInt()); + verify(mNativeInterface, times(2)).setGroupVolume(eq(groupId), eq(expectedDeviceVol)); + } + /** * Test setting volume for a group member who connects after the volume level for a group was * already changed and cached. @@ -1368,30 +1520,15 @@ public class VolumeControlServiceTest { when(mLeAudioService.getGroupDevices(groupId)) .thenReturn(Arrays.asList(mDevice, mDeviceTwo)); + // Send group volume change. - VolumeControlStackEvent stackEvent = - new VolumeControlStackEvent( - VolumeControlStackEvent.EVENT_TYPE_VOLUME_STATE_CHANGED); - stackEvent.device = null; - stackEvent.valueInt1 = groupId; - stackEvent.valueInt2 = groupVolume; - stackEvent.valueBool1 = false; - stackEvent.valueBool2 = true; - mService.messageFromNative(stackEvent); + generateVolumeStateChanged(null, groupId, groupVolume, 0, false, true); verify(callback).onDeviceVolumeChanged(eq(mDeviceTwo), eq(groupVolume)); verify(callback).onDeviceVolumeChanged(eq(mDevice), eq(groupVolume)); // Send device volume change only for one device - VolumeControlStackEvent stackEvent2 = - new VolumeControlStackEvent( - VolumeControlStackEvent.EVENT_TYPE_VOLUME_STATE_CHANGED); - stackEvent2.device = mDevice; - stackEvent2.valueInt1 = -1; - stackEvent2.valueInt2 = deviceOneVolume; - stackEvent2.valueBool1 = false; - stackEvent2.valueBool2 = false; - mService.messageFromNative(stackEvent2); + generateVolumeStateChanged(mDevice, -1, deviceOneVolume, 0, false, false); verify(callback).onDeviceVolumeChanged(eq(mDevice), eq(deviceOneVolume)); verify(callback, never()).onDeviceVolumeChanged(eq(mDeviceTwo), eq(deviceOneVolume)); @@ -1480,6 +1617,25 @@ public class VolumeControlServiceTest { mService.messageFromNative(event); } + private void generateVolumeStateChanged( + BluetoothDevice device, + int group_id, + int volume, + int flags, + boolean mute, + boolean isAutonomous) { + VolumeControlStackEvent stackEvent = + new VolumeControlStackEvent( + VolumeControlStackEvent.EVENT_TYPE_VOLUME_STATE_CHANGED); + stackEvent.device = device; + stackEvent.valueInt1 = group_id; + stackEvent.valueInt2 = volume; + stackEvent.valueInt3 = flags; + stackEvent.valueBool1 = mute; + stackEvent.valueBool2 = isAutonomous; + mService.messageFromNative(stackEvent); + } + private void generateDeviceOffsetChangedMessageFromNative( BluetoothDevice device, int extOffsetIndex, int offset) { // Send a message to trigger connection completed diff --git a/android/app/tests/unit/src/com/android/bluetooth/vc/VolumeControlStateMachineTest.java b/android/app/tests/unit/src/com/android/bluetooth/vc/VolumeControlStateMachineTest.java index 8c22fb144b..11c59e1425 100644 --- a/android/app/tests/unit/src/com/android/bluetooth/vc/VolumeControlStateMachineTest.java +++ b/android/app/tests/unit/src/com/android/bluetooth/vc/VolumeControlStateMachineTest.java @@ -28,7 +28,6 @@ import static org.mockito.Mockito.verify; import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothProfile; -import android.content.Context; import android.content.Intent; import android.os.HandlerThread; import android.os.Message; @@ -57,7 +56,7 @@ import org.mockito.junit.MockitoRule; @RunWith(AndroidJUnit4.class) public class VolumeControlStateMachineTest { private BluetoothAdapter mAdapter; - private HandlerThread mHandlerThread; + private HandlerThread mHandlerThread = null; private VolumeControlStateMachine mVolumeControlStateMachine; private BluetoothDevice mTestDevice; private static final int TIMEOUT_MS = 1000; @@ -68,6 +67,8 @@ public class VolumeControlStateMachineTest { @Mock private VolumeControlService mVolumeControlService; @Mock private VolumeControlNativeInterface mVolumeControlNativeInterface; + boolean mIsAdapterServiceSet; + @Before public void setUp() throws Exception { InstrumentationRegistry.getInstrumentation() @@ -76,6 +77,7 @@ public class VolumeControlStateMachineTest { TestUtils.setAdapterService(mAdapterService); mAdapter = BluetoothAdapter.getDefaultAdapter(); + mIsAdapterServiceSet = true; // Get a device for testing mTestDevice = mAdapter.getRemoteDevice("00:01:02:03:04:05"); @@ -96,8 +98,12 @@ public class VolumeControlStateMachineTest { @After public void tearDown() throws Exception { - mHandlerThread.quit(); - TestUtils.clearAdapterService(mAdapterService); + if (mHandlerThread != null) { + mHandlerThread.quit(); + } + if (mIsAdapterServiceSet) { + TestUtils.clearAdapterService(mAdapterService); + } } /** Test that default state is disconnected */ @@ -216,7 +222,7 @@ public class VolumeControlStateMachineTest { ArgumentCaptor<Intent> intentArgument2 = ArgumentCaptor.forClass(Intent.class); verify( mVolumeControlService, - timeout(VolumeControlStateMachine.sConnectTimeoutMs * 2).times(2)) + timeout(VolumeControlStateMachine.sConnectTimeoutMs * 2L).times(2)) .sendBroadcast(intentArgument2.capture(), anyString()); Assert.assertEquals( BluetoothProfile.STATE_DISCONNECTED, @@ -265,7 +271,7 @@ public class VolumeControlStateMachineTest { ArgumentCaptor<Intent> intentArgument2 = ArgumentCaptor.forClass(Intent.class); verify( mVolumeControlService, - timeout(VolumeControlStateMachine.sConnectTimeoutMs * 2).times(2)) + timeout(VolumeControlStateMachine.sConnectTimeoutMs * 2L).times(2)) .sendBroadcast(intentArgument2.capture(), anyString()); Assert.assertEquals( BluetoothProfile.STATE_DISCONNECTED, diff --git a/android/pandora/server/configs/pts_bot_tests_config.json b/android/pandora/server/configs/pts_bot_tests_config.json index 6fc7ae07dd..d9dcd52db7 100644 --- a/android/pandora/server/configs/pts_bot_tests_config.json +++ b/android/pandora/server/configs/pts_bot_tests_config.json @@ -3,6 +3,18 @@ "A2DP/SNK/AS/BV-01-I", "A2DP/SNK/AS/BV-03-I", "A2DP/SNK/AS/BV-04-I", + "A2DP/SNK/AVP/BI-01-C", + "A2DP/SNK/AVP/BI-02-C", + "A2DP/SNK/AVP/BI-03-C", + "A2DP/SNK/AVP/BI-06-C", + "A2DP/SNK/AVP/BI-08-C", + "A2DP/SNK/AVP/BI-10-C", + "A2DP/SNK/AVP/BI-11-C", + "A2DP/SNK/AVP/BI-12-C", + "A2DP/SNK/AVP/BI-13-C", + "A2DP/SNK/AVP/BI-14-C", + "A2DP/SNK/AVP/BI-15-C", + "A2DP/SNK/AVP/BI-16-C", "A2DP/SNK/AVP/BI-20-C", "A2DP/SNK/CC/BV-01-I", "A2DP/SNK/CC/BV-02-I", @@ -21,6 +33,14 @@ "A2DP/SNK/SYN/BV-01-C", "A2DP/SRC/AS/BI-01-I", "A2DP/SRC/AS/BI-02-I", + "A2DP/SRC/AVP/BI-10-C", + "A2DP/SRC/AVP/BI-11-C", + "A2DP/SRC/AVP/BI-12-C", + "A2DP/SRC/AVP/BI-16-C", + "A2DP/SRC/AVP/BI-17-C", + "A2DP/SRC/AVP/BI-18-C", + "A2DP/SRC/AVP/BI-20-C", + "A2DP/SRC/AVP/BI-30-C", "A2DP/SRC/CC/BV-09-I", "A2DP/SRC/REL/BV-01-I", "A2DP/SRC/REL/BV-02-I", @@ -125,7 +145,6 @@ "AVRCP/TG/MCN/CB/BI-03-C", "AVRCP/TG/MCN/CB/BI-04-C", "AVRCP/TG/MCN/CB/BI-05-C", - "AVRCP/TG/MCN/CB/BV-01-I", "AVRCP/TG/MCN/CB/BV-02-C", "AVRCP/TG/MCN/CB/BV-02-I", "AVRCP/TG/MCN/CB/BV-03-I", @@ -144,7 +163,6 @@ "AVRCP/TG/MDI/BV-02-C", "AVRCP/TG/MPS/BI-01-C", "AVRCP/TG/MPS/BI-02-C", - "AVRCP/TG/MPS/BV-01-I", "AVRCP/TG/MPS/BV-02-C", "AVRCP/TG/MPS/BV-02-I", "AVRCP/TG/MPS/BV-03-I", @@ -675,33 +693,13 @@ "PAN/NAP/MISC/UUID/BV-02-C" ], "skip": [ - "A2DP/SNK/AVP/BI-01-C", - "A2DP/SNK/AVP/BI-02-C", - "A2DP/SNK/AVP/BI-03-C", - "A2DP/SNK/AVP/BI-06-C", "A2DP/SNK/AVP/BI-07-C", - "A2DP/SNK/AVP/BI-08-C", - "A2DP/SNK/AVP/BI-10-C", - "A2DP/SNK/AVP/BI-11-C", - "A2DP/SNK/AVP/BI-12-C", - "A2DP/SNK/AVP/BI-13-C", - "A2DP/SNK/AVP/BI-14-C", - "A2DP/SNK/AVP/BI-15-C", - "A2DP/SNK/AVP/BI-16-C", "A2DP/SNK/SET/BV-04-I", "A2DP/SNK/SET/BV-06-I", "A2DP/SNK/SUS/BV-02-I", "A2DP/SRC/AS/BV-01-I", "A2DP/SRC/AS/BV-03-I", "A2DP/SRC/AS/BV-04-I", - "A2DP/SRC/AVP/BI-10-C", - "A2DP/SRC/AVP/BI-11-C", - "A2DP/SRC/AVP/BI-12-C", - "A2DP/SRC/AVP/BI-16-C", - "A2DP/SRC/AVP/BI-17-C", - "A2DP/SRC/AVP/BI-18-C", - "A2DP/SRC/AVP/BI-20-C", - "A2DP/SRC/AVP/BI-30-C", "A2DP/SRC/CC/BV-10-I", "A2DP/SRC/SET/BV-05-I", "A2DP/SRC/SET/BV-06-I", @@ -739,12 +737,14 @@ "AVRCP/CT/CRC/BV-01-I", "AVRCP/CT/PTH/BV-01-C", "AVRCP/CT/PTT/BV-01-I", + "AVRCP/TG/MCN/CB/BV-01-I", "AVRCP/TG/MCN/CB/BI-02-C", "AVRCP/TG/MCN/CB/BV-04-I", "AVRCP/TG/MCN/CB/BV-06-C", "AVRCP/TG/MCN/CB/BV-09-C", "AVRCP/TG/MDI/BV-04-C", "AVRCP/TG/MDI/BV-05-C", + "AVRCP/TG/MPS/BV-01-I", "AVRCP/TG/NFY/BV-04-C", "BNEP/TX-TYPE-0/BV-20-C", "GAP/BIS/BBM/BV-01-C", @@ -3128,5 +3128,10 @@ "SUM ICS": {}, "VCP": {} }, - "flags": {} + "flags": { + "avdtp_error_codes": [ + "A2DP/SNK/AVP", + "A2DP/SRC/AVP" + ] + } } diff --git a/android/pandora/server/src/MediaPlayerBrowserService.kt b/android/pandora/server/src/MediaPlayerBrowserService.kt index b1cf2662b1..b7a358f79c 100644 --- a/android/pandora/server/src/MediaPlayerBrowserService.kt +++ b/android/pandora/server/src/MediaPlayerBrowserService.kt @@ -240,7 +240,7 @@ class MediaPlayerBrowserService : MediaBrowserServiceCompat() { result.sendResult(mediaIdToChildren[NOW_PLAYING_PREFIX]) } else { Log.i(TAG, "onloadchildren inside else") - result.sendResult(null) + result.sendResult(mediaIdToChildren[ROOT]) } } diff --git a/android/pandora/test/a2dp_test.py b/android/pandora/test/a2dp_test.py index f852963588..2ca7bcf797 100644 --- a/android/pandora/test/a2dp_test.py +++ b/android/pandora/test/a2dp_test.py @@ -56,7 +56,7 @@ from pandora.security_pb2 import LEVEL2 from threading import Thread from typing import Optional -AVRCP_CONNECT_A2DP_DELAYED = 'persist.device_config.aconfig_flags.bluetooth.com.android.bluetooth.flags.avrcp_connect_a2dp_delayed' +AVRCP_CONNECT_A2DP_WITH_DELAY = 'persist.device_config.aconfig_flags.bluetooth.com.android.bluetooth.flags.avrcp_connect_a2dp_with_delay' async def initiate_pairing(device, address) -> Connection: """Connect and pair a remote device.""" @@ -264,7 +264,7 @@ class A2dpTest(base_test.BaseTestClass): # type: ignore[misc] # Enable AVRCP connect A2DP delayed feature for server in self.devices._servers: if isinstance(server, AndroidPandoraServer): - server.device.adb.shell(['setprop', AVRCP_CONNECT_A2DP_DELAYED, 'true']) # type: ignore + server.device.adb.shell(['setprop', AVRCP_CONNECT_A2DP_WITH_DELAY, 'true']) # type: ignore break # Connect and pair RD1. @@ -69,6 +69,7 @@ USE_DEFAULTS = { VALID_TARGETS = [ 'all', # All targets except test and clean + 'bloat', # Check bloat of crates 'clean', # Clean up output directory 'docs', # Build Rust docs 'hosttools', # Build the host tools (i.e. packetgen) @@ -148,7 +149,7 @@ REQUIRED_APT_PACKAGES = [ ] # List of cargo packages required for linux build -REQUIRED_CARGO_PACKAGES = ['cxxbridge-cmd', 'pdl-compiler'] +REQUIRED_CARGO_PACKAGES = ['cxxbridge-cmd', 'pdl-compiler', 'grpcio-compiler', 'cargo-bloat'] APT_PKG_LIST = ['apt', '-qq', 'list'] CARGO_PKG_LIST = ['cargo', 'install', '--list'] @@ -249,6 +250,8 @@ class HostBuild(): 'link-arg=-Wl,--allow-multiple-definition', # exclude uninteresting warnings '-A improper_ctypes_definitions -A improper_ctypes -A unknown_lints', + '-Cstrip=debuginfo', + '-Copt-level=z', ] return ' '.join(rust_flags) @@ -295,6 +298,10 @@ class HostBuild(): if not env: env = self.env + for k, v in env.items(): + if env[k] is None: + env[k] = "" + log_file = os.path.join(self.output_dir, '{}.log'.format(target)) with open(log_file, 'wb') as lf: rc = 0 @@ -566,6 +573,17 @@ class HostBuild(): print('Tarball created at {}'.format(tar_location)) + def _target_bloat(self): + """Run cargo bloat on workspace. + """ + crate_paths = [ + os.path.join(self.platform_dir, 'bt', 'system', 'gd', 'rust', 'linux', 'mgmt'), + os.path.join(self.platform_dir, 'bt', 'system', 'gd', 'rust', 'linux', 'service'), + os.path.join(self.platform_dir, 'bt', 'system', 'gd', 'rust', 'linux', 'client') + ] + for crate in crate_paths: + self.run_command('bloat', ['cargo', 'bloat', '--release', '--crates', '--wide'], cwd=crate, env=self.env) + def _target_clean(self): """ Delete the output directory entirely. """ @@ -620,6 +638,8 @@ class HostBuild(): self._target_install() elif self.target == 'utils': self._target_utils() + elif self.target == 'bloat': + self._target_bloat() elif self.target == 'all': self._target_all() diff --git a/flags/Android.bp b/flags/Android.bp index d4a9a7928e..168040f148 100644 --- a/flags/Android.bp +++ b/flags/Android.bp @@ -41,6 +41,7 @@ aconfig_declarations { "ranging.aconfig", "rfcomm.aconfig", "rnr.aconfig", + "sco.aconfig", "sdp.aconfig", "security.aconfig", "sockets.aconfig", diff --git a/flags/BUILD.gn b/flags/BUILD.gn index 9ea5b5afc1..e5d813f0c2 100644 --- a/flags/BUILD.gn +++ b/flags/BUILD.gn @@ -35,6 +35,7 @@ aconfig("bluetooth_flags_c_lib") { "ranging.aconfig", "rfcomm.aconfig", "rnr.aconfig", + "sco.aconfig", "sdp.aconfig", "security.aconfig", "sockets.aconfig", diff --git a/flags/active_device_manager.aconfig b/flags/active_device_manager.aconfig index 37f2b65e1c..aa49c7269b 100644 --- a/flags/active_device_manager.aconfig +++ b/flags/active_device_manager.aconfig @@ -2,7 +2,7 @@ package: "com.android.bluetooth.flags" container: "com.android.btservices" flag { - name: "fallback_when_wired_audio_disconnected" + name: "adm_fallback_when_wired_audio_disconnected" namespace: "bluetooth" description: "Fallback to other connected device when wired audio device disconnects" bug: "348124361" @@ -12,7 +12,7 @@ flag { } flag { - name: "always_fallback_to_available_device" + name: "adm_always_fallback_to_available_device" namespace: "bluetooth" description: "Fix audio path and always fallback to available device" bug: "351820274" diff --git a/flags/asha.aconfig b/flags/asha.aconfig index fb0bf10b37..2aeae17165 100644 --- a/flags/asha.aconfig +++ b/flags/asha.aconfig @@ -2,13 +2,6 @@ package: "com.android.bluetooth.flags" container: "com.android.btservices" flag { - name: "higher_l2cap_flush_threshold" - namespace: "bluetooth" - description: "Use a higher threshold for flushing L2CAP packets" - bug: "315500864" -} - -flag { name: "asha_asrc" namespace: "bluetooth" description: "Sync audio stream with the bluetooth link clock" diff --git a/flags/avrcp.aconfig b/flags/avrcp.aconfig index d099f38085..95dfa3c39e 100644 --- a/flags/avrcp.aconfig +++ b/flags/avrcp.aconfig @@ -2,10 +2,13 @@ package: "com.android.bluetooth.flags" container: "com.android.btservices" flag { - name: "avrcp_connect_a2dp_delayed" + name: "avrcp_connect_a2dp_with_delay" namespace: "bluetooth" description: "When peer device connects AVRCP but not A2DP we initiate A2DP connection after some time delay" bug: "328406945" + metadata { + purpose: PURPOSE_BUGFIX + } } flag { diff --git a/flags/bta_dm.aconfig b/flags/bta_dm.aconfig index c0428f4460..2962cd6510 100644 --- a/flags/bta_dm.aconfig +++ b/flags/bta_dm.aconfig @@ -35,3 +35,13 @@ flag { description: "perform both LE and Classic service discovery simulteanously on capable devices" bug: "339217881" } + +flag { + name: "cancel_open_discovery_client" + namespace: "bluetooth" + description: "Cancel connection from discovery client correctly" + bug: "356168480" + metadata { + purpose: PURPOSE_BUGFIX + } +} diff --git a/flags/connectivity.aconfig b/flags/connectivity.aconfig index ef83336d00..80efed1aa2 100644 --- a/flags/connectivity.aconfig +++ b/flags/connectivity.aconfig @@ -14,3 +14,23 @@ flag { description: "Guard the le shim connection map with a mutex" bug: "302054609" } + +flag { + name: "improve_create_connection_for_already_connecting_device" + namespace: "bluetooth" + description: "Make sure to not stop controller with create connection cancel when not needed" + bug: "356593752" + metadata { + purpose: PURPOSE_BUGFIX + } +} + +flag { + name: "progress_acl_scheduler_upon_incoming_connection" + namespace: "bluetooth" + description: "Allow outgoing connections to other devices and rnr to same device" + bug: "355256744" + metadata { + purpose: PURPOSE_BUGFIX + } +} diff --git a/flags/framework.aconfig b/flags/framework.aconfig index b609628492..996962231a 100644 --- a/flags/framework.aconfig +++ b/flags/framework.aconfig @@ -43,10 +43,13 @@ flag { } flag { - name: "identity_address_null_if_unknown" + name: "identity_address_null_if_not_known" namespace: "bluetooth" description: "Return null for identity address if identity address is not known" bug: "317120534" + metadata { + purpose: PURPOSE_BUGFIX + } } flag { diff --git a/flags/gap.aconfig b/flags/gap.aconfig index 13c3a57f22..d4c68363db 100644 --- a/flags/gap.aconfig +++ b/flags/gap.aconfig @@ -231,10 +231,30 @@ flag { } flag { - name: "gatt_cleanup_jni_thread" + name: "android_os_identifier" namespace: "bluetooth" - description: "Clean up gatt inside jni thread to prevent a race" - bug: "354831506" + description: "Add a custom service to provide Android OS identifier" + bug: "351860033" + metadata { + purpose: PURPOSE_BUGFIX + } +} + +flag { + name: "gatt_callback_on_failure" + namespace: "bluetooth" + description: "Invoke callbacks on early failure from the native stack" + bug: "356550596" + metadata { + purpose: PURPOSE_BUGFIX + } +} + +flag { + name: "le_inquiry_duration" + namespace: "bluetooth" + description: "Use the same duration for LE inquiry scan that classic discovery uses" + bug: "357894405" metadata { purpose: PURPOSE_BUGFIX } diff --git a/flags/hid.aconfig b/flags/hid.aconfig index 33c54d49ca..5cd21b0f85 100644 --- a/flags/hid.aconfig +++ b/flags/hid.aconfig @@ -82,3 +82,13 @@ flag { purpose: PURPOSE_BUGFIX } } + +flag { + name: "close_hid_only_if_connected" + namespace: "bluetooth" + description: "Do not close BTA HID host if it is already closed" + bug: "358241286" + metadata { + purpose: PURPOSE_BUGFIX + } +} diff --git a/flags/leaudio.aconfig b/flags/leaudio.aconfig index 3d9d835179..639d5fcef2 100644 --- a/flags/leaudio.aconfig +++ b/flags/leaudio.aconfig @@ -384,3 +384,10 @@ flag { purpose: PURPOSE_BUGFIX } } + +flag { + name: "leaudio_set_codec_config_preference" + namespace: "bluetooth" + description: "New apis to set codec config preference" + bug: "353909820" +} diff --git a/flags/pairing.aconfig b/flags/pairing.aconfig index a6791c3c1c..7bab058ceb 100644 --- a/flags/pairing.aconfig +++ b/flags/pairing.aconfig @@ -2,10 +2,13 @@ package: "com.android.bluetooth.flags" container: "com.android.btservices" flag { - name: "clear_collision_state_on_pairing_complete" + name: "clear_auth_collision_state_on_pairing_complete" namespace: "bluetooth" description: "Clear authentication collision state on pairing conclusion" - bug: "327208896" + bug: "358116527" + metadata { + purpose: PURPOSE_BUGFIX + } } flag { @@ -104,3 +107,23 @@ flag { purpose: PURPOSE_BUGFIX } } + +flag { + name: "transmit_smp_packets_before_release" + namespace: "bluetooth" + description: "Ensure that SMP packets are transmitted before SMP channel is released" + bug: "357106628" + metadata { + purpose: PURPOSE_BUGFIX + } +} + +flag { + name: "use_encrypt_req_for_av" + namespace: "bluetooth" + description: "Use encrypted link for AVDTP and AVCTP channel" + bug: "357662929" + metadata { + purpose: PURPOSE_BUGFIX + } +} diff --git a/flags/sco.aconfig b/flags/sco.aconfig new file mode 100644 index 0000000000..26379f4ea1 --- /dev/null +++ b/flags/sco.aconfig @@ -0,0 +1,12 @@ +package: "com.android.bluetooth.flags" +container: "com.android.btservices" + +flag { + name: "fix_sco_command_status_handling" + namespace: "bluetooth" + description: "Make sure to properly handle Command Status error when SCO is creating" + bug: "358573137" + metadata { + purpose: PURPOSE_BUGFIX + } +}
\ No newline at end of file diff --git a/flags/system_service.aconfig b/flags/system_service.aconfig index b59a9c1b4c..2dc4cb1b04 100644 --- a/flags/system_service.aconfig +++ b/flags/system_service.aconfig @@ -30,6 +30,16 @@ flag { } flag { + name: "broadcast_adapter_state_with_callback" + namespace: "bluetooth" + description: "Instead of caching the value with an IPC cache, we directly broadcast the state to each app so they can store it locally" + metadata { + purpose: PURPOSE_BUGFIX + } + bug: "357645528" +} + +flag { name: "fast_bind_to_app" namespace: "bluetooth" description: "Remove complexity and non necessary initialization when simply binding" diff --git a/floss/build/Dockerfile b/floss/build/Dockerfile index 2e0f3a3241..23ec4cbc07 100644 --- a/floss/build/Dockerfile +++ b/floss/build/Dockerfile @@ -67,7 +67,11 @@ RUN /tmp/rustup.sh -y --default-toolchain 1.77.1 ENV PATH="/root/.cargo/bin:${PATH}" # Install cargo packages required on build image. -RUN cargo install --locked cxxbridge-cmd@1.0.94 pdl-compiler@0.1.1 grpcio-compiler@0.13.0 +RUN cargo install --locked \ + cxxbridge-cmd@1.0.94 \ + pdl-compiler@0.1.1 \ + grpcio-compiler@0.13.0 \ + cargo-bloat@0.12.1 RUN cargo install --git https://android.googlesource.com/platform/build#8f9ca807 aconfig # Rename llvm packages. By default, they are named 11vm-ar-13, etc. which won't diff --git a/framework/Android.bp b/framework/Android.bp index fb962a5c6f..6ab18f0ce4 100644 --- a/framework/Android.bp +++ b/framework/Android.bp @@ -88,10 +88,14 @@ java_sdk_library { "com.android.bluetooth.flags", "com.android.bluetooth.jarjar", ], + plugins: [ + "error_prone_android_framework", + ], errorprone: { javacflags: [ "-Xep:InlineMeSuggester:OFF", // The @InlineMe annotation is not available + "-Xep:AndroidFrameworkRequiresPermission:ERROR", "-Xep:BadImport:ERROR", "-Xep:CatchFail:ERROR", "-Xep:ClassCanBeStatic:ERROR", diff --git a/framework/api/current.txt b/framework/api/current.txt index 98e8b0ef91..445e8a0a94 100644 --- a/framework/api/current.txt +++ b/framework/api/current.txt @@ -20,7 +20,7 @@ package android.bluetooth { method public void closeProfileProxy(int, android.bluetooth.BluetoothProfile); method @Deprecated @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean disable(); method @Deprecated @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean enable(); - method public String getAddress(); + method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.LOCAL_MAC_ADDRESS}) public String getAddress(); method public android.bluetooth.le.BluetoothLeAdvertiser getBluetoothLeAdvertiser(); method public android.bluetooth.le.BluetoothLeScanner getBluetoothLeScanner(); method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public java.util.Set<android.bluetooth.BluetoothDevice> getBondedDevices(); @@ -515,9 +515,9 @@ package android.bluetooth { public final class BluetoothCsipSetCoordinator implements java.lang.AutoCloseable android.bluetooth.BluetoothProfile { method public void close(); method protected void finalize(); - method @NonNull public java.util.List<android.bluetooth.BluetoothDevice> getConnectedDevices(); - method public int getConnectionState(@Nullable android.bluetooth.BluetoothDevice); - method @NonNull public java.util.List<android.bluetooth.BluetoothDevice> getDevicesMatchingConnectionStates(@NonNull int[]); + method @NonNull @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public java.util.List<android.bluetooth.BluetoothDevice> getConnectedDevices(); + method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getConnectionState(@Nullable android.bluetooth.BluetoothDevice); + method @NonNull @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public java.util.List<android.bluetooth.BluetoothDevice> getDevicesMatchingConnectionStates(@NonNull int[]); field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_CSIS_CONNECTION_STATE_CHANGED = "android.bluetooth.action.CSIS_CONNECTION_STATE_CHANGED"; } @@ -541,7 +541,7 @@ package android.bluetooth { method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public String getName(); method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public int getType(); method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public android.os.ParcelUuid[] getUuids(); - method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public int setAlias(@Nullable String); + method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}, conditional=true) public int setAlias(@Nullable String); method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean setPairingConfirmation(boolean); method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean setPin(byte[]); method public void writeToParcel(android.os.Parcel, int); @@ -1267,12 +1267,12 @@ package android.bluetooth.le { } public final class BluetoothLeAdvertiser { - method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADVERTISE) public void startAdvertising(android.bluetooth.le.AdvertiseSettings, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertiseCallback); - method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADVERTISE) public void startAdvertising(android.bluetooth.le.AdvertiseSettings, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertiseCallback); - method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADVERTISE) public void startAdvertisingSet(android.bluetooth.le.AdvertisingSetParameters, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertiseData, android.bluetooth.le.PeriodicAdvertisingParameters, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertisingSetCallback); - method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADVERTISE) public void startAdvertisingSet(android.bluetooth.le.AdvertisingSetParameters, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertiseData, android.bluetooth.le.PeriodicAdvertisingParameters, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertisingSetCallback, android.os.Handler); - method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADVERTISE) public void startAdvertisingSet(android.bluetooth.le.AdvertisingSetParameters, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertiseData, android.bluetooth.le.PeriodicAdvertisingParameters, android.bluetooth.le.AdvertiseData, int, int, android.bluetooth.le.AdvertisingSetCallback); - method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADVERTISE) public void startAdvertisingSet(android.bluetooth.le.AdvertisingSetParameters, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertiseData, android.bluetooth.le.PeriodicAdvertisingParameters, android.bluetooth.le.AdvertiseData, int, int, android.bluetooth.le.AdvertisingSetCallback, android.os.Handler); + method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_ADVERTISE, android.Manifest.permission.BLUETOOTH_PRIVILEGED}, conditional=true) public void startAdvertising(android.bluetooth.le.AdvertiseSettings, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertiseCallback); + method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_ADVERTISE, android.Manifest.permission.BLUETOOTH_PRIVILEGED}, conditional=true) public void startAdvertising(android.bluetooth.le.AdvertiseSettings, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertiseCallback); + method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_ADVERTISE, android.Manifest.permission.BLUETOOTH_PRIVILEGED}, conditional=true) public void startAdvertisingSet(android.bluetooth.le.AdvertisingSetParameters, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertiseData, android.bluetooth.le.PeriodicAdvertisingParameters, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertisingSetCallback); + method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_ADVERTISE, android.Manifest.permission.BLUETOOTH_PRIVILEGED}, conditional=true) public void startAdvertisingSet(android.bluetooth.le.AdvertisingSetParameters, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertiseData, android.bluetooth.le.PeriodicAdvertisingParameters, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertisingSetCallback, android.os.Handler); + method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_ADVERTISE, android.Manifest.permission.BLUETOOTH_PRIVILEGED}, conditional=true) public void startAdvertisingSet(android.bluetooth.le.AdvertisingSetParameters, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertiseData, android.bluetooth.le.PeriodicAdvertisingParameters, android.bluetooth.le.AdvertiseData, int, int, android.bluetooth.le.AdvertisingSetCallback); + method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_ADVERTISE, android.Manifest.permission.BLUETOOTH_PRIVILEGED}, conditional=true) public void startAdvertisingSet(android.bluetooth.le.AdvertisingSetParameters, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertiseData, android.bluetooth.le.PeriodicAdvertisingParameters, android.bluetooth.le.AdvertiseData, int, int, android.bluetooth.le.AdvertisingSetCallback, android.os.Handler); method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADVERTISE) public void stopAdvertising(android.bluetooth.le.AdvertiseCallback); method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADVERTISE) public void stopAdvertisingSet(android.bluetooth.le.AdvertisingSetCallback); } diff --git a/framework/api/system-current.txt b/framework/api/system-current.txt index 275ee81a21..e9b58e4f2e 100644 --- a/framework/api/system-current.txt +++ b/framework/api/system-current.txt @@ -60,7 +60,7 @@ package android.bluetooth { public final class BluetoothAdapter { method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean addOnMetadataChangedListener(@NonNull android.bluetooth.BluetoothDevice, @NonNull java.util.concurrent.Executor, @NonNull android.bluetooth.BluetoothAdapter.OnMetadataChangedListener); method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean clearBluetooth(); - method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean disable(boolean); + method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}, conditional=true) public boolean disable(boolean); method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean disableBLE(); method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean enableBLE(); method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean enableNoAutoConnect(); @@ -167,12 +167,12 @@ package android.bluetooth { } public final class BluetoothCsipSetCoordinator implements java.lang.AutoCloseable android.bluetooth.BluetoothProfile { - method @NonNull @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public java.util.List<java.lang.Integer> getAllGroupIds(@Nullable android.os.ParcelUuid); - method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public int getConnectionPolicy(@Nullable android.bluetooth.BluetoothDevice); - method @NonNull @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public java.util.Map<java.lang.Integer,android.os.ParcelUuid> getGroupUuidMapByDevice(@Nullable android.bluetooth.BluetoothDevice); - method @Nullable @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public java.util.UUID lockGroup(int, @NonNull java.util.concurrent.Executor, @NonNull android.bluetooth.BluetoothCsipSetCoordinator.ClientLockCallback); - method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean setConnectionPolicy(@Nullable android.bluetooth.BluetoothDevice, int); - method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean unlockGroup(@NonNull java.util.UUID); + method @NonNull @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public java.util.List<java.lang.Integer> getAllGroupIds(@Nullable android.os.ParcelUuid); + method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getConnectionPolicy(@Nullable android.bluetooth.BluetoothDevice); + method @NonNull @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public java.util.Map<java.lang.Integer,android.os.ParcelUuid> getGroupUuidMapByDevice(@Nullable android.bluetooth.BluetoothDevice); + method @Nullable @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public java.util.UUID lockGroup(int, @NonNull java.util.concurrent.Executor, @NonNull android.bluetooth.BluetoothCsipSetCoordinator.ClientLockCallback); + method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean setConnectionPolicy(@Nullable android.bluetooth.BluetoothDevice, int); + method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean unlockGroup(@NonNull java.util.UUID); field @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public static final String ACTION_CSIS_DEVICE_AVAILABLE = "android.bluetooth.action.CSIS_DEVICE_AVAILABLE"; field @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public static final String ACTION_CSIS_SET_MEMBER_AVAILABLE = "android.bluetooth.action.CSIS_SET_MEMBER_AVAILABLE"; field public static final String EXTRA_CSIS_GROUP_ID = "android.bluetooth.extra.CSIS_GROUP_ID"; @@ -185,14 +185,14 @@ package android.bluetooth { public final class BluetoothDevice implements android.os.Parcelable { method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean canBondWithoutDialog(); - method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean cancelBondProcess(); + method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean cancelBondProcess(); method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED, android.Manifest.permission.MODIFY_PHONE_STATE}) public int connect(); method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean createBond(int); method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean createBondOutOfBand(int, @Nullable android.bluetooth.OobData, @Nullable android.bluetooth.OobData); method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int disconnect(); - method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean fetchUuidsWithSdp(int); + method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}, conditional=true) public boolean fetchUuidsWithSdp(int); method @FlaggedApi("com.android.bluetooth.flags.metadata_api_inactive_audio_device_upon_connection") @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getActiveAudioDevicePolicy(); - method @NonNull @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public String getAnonymizedAddress(); + method @NonNull public String getAnonymizedAddress(); method @IntRange(from=0xffffff9c, to=100) @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public int getBatteryLevel(); method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getConnectionHandle(int); method @Nullable @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public String getIdentityAddress(); @@ -207,7 +207,7 @@ package android.bluetooth { method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean isEncrypted(); method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean isInSilenceMode(); method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int isRequestAudioPolicyAsSinkSupported(); - method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public void prepareToEnterProcess(@NonNull android.content.AttributionSource); + method public void prepareToEnterProcess(@NonNull android.content.AttributionSource); method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean removeBond(); method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int requestAudioPolicyAsSink(@NonNull android.bluetooth.BluetoothSinkAudioPolicy); method @FlaggedApi("com.android.bluetooth.flags.metadata_api_inactive_audio_device_upon_connection") @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int setActiveAudioDevicePolicy(int); @@ -431,11 +431,11 @@ package android.bluetooth { public static final class BluetoothHearingAid.AdvertisementServiceData implements android.os.Parcelable { method public int describeContents(); - method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_SCAN, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getDeviceMode(); - method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_SCAN, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getDeviceSide(); - method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_SCAN, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getTruncatedHiSyncId(); - method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_SCAN, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean isCsipSupported(); - method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_SCAN, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean isInPairWith(@Nullable android.bluetooth.BluetoothHearingAid.AdvertisementServiceData); + method public int getDeviceMode(); + method public int getDeviceSide(); + method public int getTruncatedHiSyncId(); + method public boolean isCsipSupported(); + method public boolean isInPairWith(@Nullable android.bluetooth.BluetoothHearingAid.AdvertisementServiceData); method public void writeToParcel(@NonNull android.os.Parcel, int); field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.BluetoothHearingAid.AdvertisementServiceData> CREATOR; } @@ -552,9 +552,9 @@ package android.bluetooth { method public void close(); method protected void finalize(); method @NonNull @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public java.util.List<android.bluetooth.BluetoothLeBroadcastMetadata> getAllBroadcastMetadata(); - method @NonNull @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public java.util.List<android.bluetooth.BluetoothDevice> getConnectedDevices(); - method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getConnectionState(@NonNull android.bluetooth.BluetoothDevice); - method @NonNull @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public java.util.List<android.bluetooth.BluetoothDevice> getDevicesMatchingConnectionStates(@NonNull int[]); + method @NonNull public java.util.List<android.bluetooth.BluetoothDevice> getConnectedDevices(); + method public int getConnectionState(@NonNull android.bluetooth.BluetoothDevice); + method @NonNull public java.util.List<android.bluetooth.BluetoothDevice> getDevicesMatchingConnectionStates(@NonNull int[]); method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public int getMaximumNumberOfBroadcasts(); method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public int getMaximumStreamsPerBroadcast(); method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public int getMaximumSubgroupsPerBroadcast(); @@ -1112,12 +1112,12 @@ package android.bluetooth { } public final class BluetoothVolumeControl implements java.lang.AutoCloseable android.bluetooth.BluetoothProfile { - method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public void close(); + method public void close(); method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) protected void finalize(); method @NonNull @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public java.util.List<android.bluetooth.BluetoothDevice> getConnectedDevices(); method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice); method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public int getConnectionState(android.bluetooth.BluetoothDevice); - method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public java.util.List<android.bluetooth.BluetoothDevice> getDevicesMatchingConnectionStates(int[]); + method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public java.util.List<android.bluetooth.BluetoothDevice> getDevicesMatchingConnectionStates(int[]); method @FlaggedApi("com.android.bluetooth.flags.leaudio_multiple_vocs_instances_api") @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getNumberOfVolumeOffsetInstances(@NonNull android.bluetooth.BluetoothDevice); method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean isVolumeOffsetAvailable(@NonNull android.bluetooth.BluetoothDevice); method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void registerCallback(@NonNull java.util.concurrent.Executor, @NonNull android.bluetooth.BluetoothVolumeControl.Callback); @@ -1246,7 +1246,7 @@ package android.bluetooth.le { } public final class BluetoothLeAdvertiser { - method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_PRIVILEGED, android.Manifest.permission.BLUETOOTH_ADVERTISE, android.Manifest.permission.BLUETOOTH_CONNECT}) public void startAdvertisingSet(@NonNull android.bluetooth.le.AdvertisingSetParameters, @Nullable android.bluetooth.le.AdvertiseData, @Nullable android.bluetooth.le.AdvertiseData, @Nullable android.bluetooth.le.PeriodicAdvertisingParameters, @Nullable android.bluetooth.le.AdvertiseData, int, int, @Nullable android.bluetooth.BluetoothGattServer, @Nullable android.bluetooth.le.AdvertisingSetCallback, @NonNull android.os.Handler); + method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_ADVERTISE, android.Manifest.permission.BLUETOOTH_PRIVILEGED}, conditional=true) public void startAdvertisingSet(@NonNull android.bluetooth.le.AdvertisingSetParameters, @Nullable android.bluetooth.le.AdvertiseData, @Nullable android.bluetooth.le.AdvertiseData, @Nullable android.bluetooth.le.PeriodicAdvertisingParameters, @Nullable android.bluetooth.le.AdvertiseData, int, int, @Nullable android.bluetooth.BluetoothGattServer, @Nullable android.bluetooth.le.AdvertisingSetCallback, @NonNull android.os.Handler); } public final class BluetoothLeScanner { diff --git a/framework/java/android/bluetooth/BluetoothA2dp.java b/framework/java/android/bluetooth/BluetoothA2dp.java index 6769927d4f..15c83b1aff 100644 --- a/framework/java/android/bluetooth/BluetoothA2dp.java +++ b/framework/java/android/bluetooth/BluetoothA2dp.java @@ -583,7 +583,7 @@ public final class BluetoothA2dp implements BluetoothProfile { */ @RequiresLegacyBluetoothPermission @RequiresBluetoothConnectPermission - @RequiresPermission(BLUETOOTH_CONNECT) + @RequiresPermission(allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED}) @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023) public int getPriority(BluetoothDevice device) { if (VDBG) log("getPriority(" + device + ")"); @@ -602,11 +602,7 @@ public final class BluetoothA2dp implements BluetoothProfile { */ @SystemApi @RequiresBluetoothConnectPermission - @RequiresPermission( - allOf = { - BLUETOOTH_CONNECT, - BLUETOOTH_PRIVILEGED, - }) + @RequiresPermission(allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED}) public @ConnectionPolicy int getConnectionPolicy(@NonNull BluetoothDevice device) { if (VDBG) log("getConnectionPolicy(" + device + ")"); final IBluetoothA2dp service = getService(); diff --git a/framework/java/android/bluetooth/BluetoothAdapter.java b/framework/java/android/bluetooth/BluetoothAdapter.java index 85752258a0..68d61b1588 100644 --- a/framework/java/android/bluetooth/BluetoothAdapter.java +++ b/framework/java/android/bluetooth/BluetoothAdapter.java @@ -22,6 +22,7 @@ import static android.Manifest.permission.BLUETOOTH_ADVERTISE; import static android.Manifest.permission.BLUETOOTH_CONNECT; import static android.Manifest.permission.BLUETOOTH_PRIVILEGED; import static android.Manifest.permission.BLUETOOTH_SCAN; +import static android.Manifest.permission.LOCAL_MAC_ADDRESS; import static android.Manifest.permission.MODIFY_PHONE_STATE; import static java.util.Objects.requireNonNull; @@ -873,6 +874,8 @@ public final class BluetoothAdapter { @GuardedBy("mServiceLock") private IBluetooth mService; + private static int sAdapterState = BluetoothAdapter.STATE_OFF; + private final ReentrantReadWriteLock mServiceLock = new ReentrantReadWriteLock(); @GuardedBy("sServiceLock") @@ -887,10 +890,6 @@ public final class BluetoothAdapter { private final Map<LeScanCallback, ScanCallback> mLeScanClients = new HashMap<>(); private final Map<BluetoothDevice, List<Pair<OnMetadataChangedListener, Executor>>> mMetadataListeners = new HashMap<>(); - private final Map<BluetoothConnectionCallback, Executor> - mBluetoothConnectionCallbackExecutorMap = new HashMap<>(); - private final Map<PreferredAudioProfilesChangedCallback, Executor> - mAudioProfilesChangedCallbackExecutorMap = new HashMap<>(); private static final class ProfileConnection { int mProfile; @@ -1096,6 +1095,7 @@ public final class BluetoothAdapter { } /** Use {@link #getDefaultAdapter} to get the BluetoothAdapter instance. */ + @SuppressLint("AndroidFrameworkRequiresPermission") // Consumer wrongly report permission BluetoothAdapter(IBluetoothManager managerService, AttributionSource attributionSource) { mManagerService = requireNonNull(managerService); mAttributionSource = requireNonNull(attributionSource); @@ -1128,6 +1128,50 @@ public final class BluetoothAdapter { new CallbackWrapper( registerQualityReportCallbackConsumer, unregisterQualityReportCallbackConsumer); + Consumer<IBluetooth> registerAudioProfilesCallbackConsumer = + (IBluetooth service) -> { + try { + service.registerPreferredAudioProfilesChangedCallback( + mPreferredAudioProfilesChangedCallback, mAttributionSource); + } catch (RemoteException e) { + Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable())); + } + }; + Consumer<IBluetooth> unregisterAudioProfilesCallbackConsumer = + (IBluetooth service) -> { + try { + service.unregisterPreferredAudioProfilesChangedCallback( + mPreferredAudioProfilesChangedCallback, mAttributionSource); + } catch (RemoteException e) { + Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable())); + } + }; + mAudioProfilesCallbackWrapper = + new CallbackWrapper( + registerAudioProfilesCallbackConsumer, + unregisterAudioProfilesCallbackConsumer); + Consumer<IBluetooth> registerBluetoothConnectionCallbackConsumer = + (IBluetooth service) -> { + try { + service.registerBluetoothConnectionCallback( + mBluetoothConnectionCallback, mAttributionSource); + } catch (RemoteException e) { + Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable())); + } + }; + Consumer<IBluetooth> unregisterBluetoothConnectionCallbackConsumer = + (IBluetooth service) -> { + try { + service.registerBluetoothConnectionCallback( + mBluetoothConnectionCallback, mAttributionSource); + } catch (RemoteException e) { + Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable())); + } + }; + mBluetoothConnectionCallbackWrapper = + new CallbackWrapper( + registerBluetoothConnectionCallbackConsumer, + unregisterBluetoothConnectionCallbackConsumer); } /** @@ -1470,6 +1514,9 @@ public final class BluetoothAdapter { /** Fetch the current bluetooth state. If the service is down, return OFF. */ private @InternalAdapterState int getStateInternal() { + if (Flags.broadcastAdapterStateWithCallback()) { + return sAdapterState; + } mServiceLock.readLock().lock(); try { if (mService != null) { @@ -1641,6 +1688,7 @@ public final class BluetoothAdapter { @RequiresLegacyBluetoothAdminPermission @RequiresBluetoothConnectPermission @RequiresPermission(BLUETOOTH_CONNECT) + @SuppressLint("AndroidFrameworkRequiresPermission") // See disable(boolean) for reason public boolean disable() { return disable(true); } @@ -1648,6 +1696,11 @@ public final class BluetoothAdapter { /** * Turn off the local Bluetooth adapter and don't persist the setting. * + * <p>Requires the {@link android.Manifest.permission#BLUETOOTH_PRIVILEGED} permission only when + * {@code persist} is {@code false}. + * + * <p>The {@link android.Manifest.permission#BLUETOOTH_CONNECT} permission is always enforced. + * * @param persist Indicate whether the off state should be persisted following the next reboot * @return true to indicate adapter shutdown has begun, or false on immediate error * @hide @@ -1656,10 +1709,8 @@ public final class BluetoothAdapter { @RequiresLegacyBluetoothAdminPermission @RequiresBluetoothConnectPermission @RequiresPermission( - allOf = { - BLUETOOTH_CONNECT, - BLUETOOTH_PRIVILEGED, - }) + allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED}, + conditional = true) public boolean disable(boolean persist) { try { return mManagerService.disable(mAttributionSource, persist); @@ -1675,11 +1726,10 @@ public final class BluetoothAdapter { * <p>For example, "00:11:22:AA:BB:CC". * * @return Bluetooth hardware address as string - * <p>Requires {@code android.Manifest.permission#LOCAL_MAC_ADDRESS} and {@link - * android.Manifest.permission#BLUETOOTH_CONNECT}. */ @RequiresLegacyBluetoothPermission @RequiresBluetoothConnectPermission + @RequiresPermission(allOf = {BLUETOOTH_CONNECT, LOCAL_MAC_ADDRESS}) public String getAddress() { try { return mManagerService.getAddress(mAttributionSource); @@ -2725,7 +2775,7 @@ public final class BluetoothAdapter { * @hide */ @RequiresBluetoothConnectPermission - @RequiresPermission(BLUETOOTH_CONNECT) + @RequiresPermission(BLUETOOTH_SCAN) public boolean isHardwareTrackingFiltersAvailable() { if (!getLeAccess()) { return false; @@ -2974,7 +3024,7 @@ public final class BluetoothAdapter { Pair<IBluetooth, Pair<AttributionSource, Integer>>, Integer> sBluetoothProfileQuery = new IpcDataCache.QueryHandler<>() { - @RequiresNoPermission + @SuppressLint("AndroidFrameworkRequiresPermission") @Override public Integer apply( Pair<IBluetooth, Pair<AttributionSource, Integer>> pairQuery) { @@ -3016,6 +3066,7 @@ public final class BluetoothAdapter { @RequiresLegacyBluetoothPermission @RequiresBluetoothConnectPermission @RequiresPermission(BLUETOOTH_CONNECT) + @SuppressLint("AndroidFrameworkRequiresPermission") // IpcDataCache prevent lint enforcement public @ConnectionState int getProfileConnectionState(int profile) { if (getState() != STATE_ON) { return STATE_DISCONNECTED; @@ -3596,6 +3647,7 @@ public final class BluetoothAdapter { * @param proxy Profile proxy object * @hide */ + @SuppressLint("AndroidFrameworkRequiresPermission") // Call control is not exposed to 3p app public void closeProfileProxy(@NonNull BluetoothProfile proxy) { if (proxy instanceof BluetoothGatt gatt) { gatt.close(); @@ -3728,10 +3780,15 @@ public final class BluetoothAdapter { } } } + + public void onBluetoothAdapterStateChange(int newState) { + sAdapterState = newState; + } }; private final IBluetoothManagerCallback mManagerCallback = new IBluetoothManagerCallback.Stub() { + @SuppressLint("AndroidFrameworkRequiresPermission") // Internal callback public void onBluetoothServiceUp(@NonNull IBinder bluetoothService) { requireNonNull(bluetoothService, "bluetoothService cannot be null"); mServiceLock.writeLock().lock(); @@ -3762,26 +3819,12 @@ public final class BluetoothAdapter { } }); } - synchronized (mAudioProfilesChangedCallbackExecutorMap) { - if (!mAudioProfilesChangedCallbackExecutorMap.isEmpty()) { - try { - mService.registerPreferredAudioProfilesChangedCallback( - mPreferredAudioProfilesChangedCallback, - mAttributionSource); - } catch (RemoteException e) { - Log.e( - TAG, - "onBluetoothServiceUp: Failed to register bluetooth" - + "connection callback", - e); - } - } - } + mAudioProfilesCallbackWrapper.registerToNewService(mService); mQualityCallbackWrapper.registerToNewService(mService); + mBluetoothConnectionCallbackWrapper.registerToNewService(mService); } finally { mServiceLock.readLock().unlock(); } - registerBluetoothConnectionCallbackIfNeeded(); } public void onBluetoothServiceDown() { @@ -3834,6 +3877,10 @@ public final class BluetoothAdapter { }); }); } + + public void onBluetoothAdapterStateChange(int newState) { + // Nothing to do, this is entirely handled by sManagerCallback. + } }; /** @@ -4632,29 +4679,23 @@ public final class BluetoothAdapter { void onMetadataChanged(@NonNull BluetoothDevice device, int key, @Nullable byte[] value); } - @SuppressLint("AndroidFrameworkBluetoothPermission") + private final CallbackWrapper<BluetoothConnectionCallback, IBluetooth> + mBluetoothConnectionCallbackWrapper; + private final IBluetoothConnectionCallback mBluetoothConnectionCallback = new IBluetoothConnectionCallback.Stub() { @Override public void onDeviceConnected(BluetoothDevice device) { Attributable.setAttributionSource(device, mAttributionSource); - for (Map.Entry<BluetoothConnectionCallback, Executor> callbackExecutorEntry : - mBluetoothConnectionCallbackExecutorMap.entrySet()) { - BluetoothConnectionCallback callback = callbackExecutorEntry.getKey(); - Executor executor = callbackExecutorEntry.getValue(); - executor.execute(() -> callback.onDeviceConnected(device)); - } + mBluetoothConnectionCallbackWrapper.forEach( + (cb) -> cb.onDeviceConnected(device)); } @Override public void onDeviceDisconnected(BluetoothDevice device, int hciReason) { Attributable.setAttributionSource(device, mAttributionSource); - for (Map.Entry<BluetoothConnectionCallback, Executor> callbackExecutorEntry : - mBluetoothConnectionCallbackExecutorMap.entrySet()) { - BluetoothConnectionCallback callback = callbackExecutorEntry.getKey(); - Executor executor = callbackExecutorEntry.getValue(); - executor.execute(() -> callback.onDeviceDisconnected(device, hciReason)); - } + mBluetoothConnectionCallbackWrapper.forEach( + (cb) -> cb.onDeviceDisconnected(device, hciReason)); } }; @@ -4670,56 +4711,20 @@ public final class BluetoothAdapter { */ @SystemApi @RequiresBluetoothConnectPermission - @RequiresPermission( - allOf = { - BLUETOOTH_CONNECT, - BLUETOOTH_PRIVILEGED, - }) + @RequiresPermission(allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED}) public boolean registerBluetoothConnectionCallback( @NonNull @CallbackExecutor Executor executor, @NonNull BluetoothConnectionCallback callback) { if (DBG) Log.d(TAG, "registerBluetoothConnectionCallback()"); - if (callback == null || executor == null) { - return false; - } - - synchronized (mBluetoothConnectionCallbackExecutorMap) { - if (mBluetoothConnectionCallbackExecutorMap.containsKey(callback)) { - throw new IllegalArgumentException("This callback has already been registered"); - } - if (mBluetoothConnectionCallbackExecutorMap.isEmpty()) { - registerBluetoothConnectionCallback(); - } - - mBluetoothConnectionCallbackExecutorMap.put(callback, executor); - } - - return true; - } - - private void registerBluetoothConnectionCallback() { mServiceLock.readLock().lock(); try { - if (mService == null) { - return; - } - mService.registerBluetoothConnectionCallback( - mBluetoothConnectionCallback, mAttributionSource); - } catch (RemoteException e) { - Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable())); + mBluetoothConnectionCallbackWrapper.registerCallback(mService, callback, executor); } finally { mServiceLock.readLock().unlock(); } - } - private void registerBluetoothConnectionCallbackIfNeeded() { - synchronized (mBluetoothConnectionCallbackExecutorMap) { - if (mBluetoothConnectionCallbackExecutorMap.isEmpty()) { - return; - } - registerBluetoothConnectionCallback(); - } + return true; } /** @@ -4731,42 +4736,16 @@ public final class BluetoothAdapter { */ @SystemApi @RequiresBluetoothConnectPermission - @RequiresPermission( - allOf = { - BLUETOOTH_CONNECT, - BLUETOOTH_PRIVILEGED, - }) + @RequiresPermission(allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED}) public boolean unregisterBluetoothConnectionCallback( @NonNull BluetoothConnectionCallback callback) { if (DBG) Log.d(TAG, "unregisterBluetoothConnectionCallback()"); - if (callback == null) { - return false; - } - - synchronized (mBluetoothConnectionCallbackExecutorMap) { - if (!mBluetoothConnectionCallbackExecutorMap.containsKey(callback)) { - return true; - } - - mBluetoothConnectionCallbackExecutorMap.remove(callback); - - if (mBluetoothConnectionCallbackExecutorMap.isEmpty()) { - // If the callback map is empty, we unregister the service-to-app callback - mServiceLock.readLock().lock(); - try { - if (mService == null) { - return true; - } - mService.unregisterBluetoothConnectionCallback( - mBluetoothConnectionCallback, mAttributionSource); - } catch (RemoteException e) { - Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable())); - } finally { - mServiceLock.readLock().unlock(); - } - } + mServiceLock.readLock().lock(); + try { + mBluetoothConnectionCallbackWrapper.unregisterCallback(mService, callback); + } finally { + mServiceLock.readLock().unlock(); } - return true; } @@ -4896,27 +4875,22 @@ public final class BluetoothAdapter { * @hide */ @SystemApi - @RequiresPermission( - allOf = { - BLUETOOTH_CONNECT, - BLUETOOTH_PRIVILEGED, - }) + @RequiresPermission(allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED}) @SetPreferredAudioProfilesReturnValues public int setPreferredAudioProfiles( @NonNull BluetoothDevice device, @NonNull Bundle modeToProfileBundle) { if (DBG) { Log.d(TAG, "setPreferredAudioProfiles( " + modeToProfileBundle + ", " + device + ")"); } - requireNonNull(modeToProfileBundle, "modeToProfileBundle must not be null"); - requireNonNull(device, "device must not be null"); - if (!BluetoothAdapter.checkBluetoothAddress(getAddress())) { + requireNonNull(modeToProfileBundle); + requireNonNull(device); + if (!BluetoothAdapter.checkBluetoothAddress(device.getAddress())) { throw new IllegalArgumentException("device cannot have an invalid address"); } if (!modeToProfileBundle.containsKey(AUDIO_MODE_OUTPUT_ONLY) && !modeToProfileBundle.containsKey(AUDIO_MODE_DUPLEX)) { throw new IllegalArgumentException( - "Bundle does not contain a key " - + "AUDIO_MODE_OUTPUT_ONLY or AUDIO_MODE_DUPLEX"); + "Bundle does not contain a key AUDIO_MODE_OUTPUT_ONLY or AUDIO_MODE_DUPLEX"); } if (modeToProfileBundle.containsKey(AUDIO_MODE_OUTPUT_ONLY) && modeToProfileBundle.getInt(AUDIO_MODE_OUTPUT_ONLY) != BluetoothProfile.A2DP @@ -4984,11 +4958,7 @@ public final class BluetoothAdapter { * @hide */ @SystemApi - @RequiresPermission( - allOf = { - BLUETOOTH_CONNECT, - BLUETOOTH_PRIVILEGED, - }) + @RequiresPermission(allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED}) @NonNull public Bundle getPreferredAudioProfiles(@NonNull BluetoothDevice device) { if (DBG) Log.d(TAG, "getPreferredAudioProfiles(" + device + ")"); @@ -5041,11 +5011,7 @@ public final class BluetoothAdapter { * @hide */ @SystemApi - @RequiresPermission( - allOf = { - BLUETOOTH_CONNECT, - BLUETOOTH_PRIVILEGED, - }) + @RequiresPermission(allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED}) @NotifyActiveDeviceChangeAppliedReturnValues public int notifyActiveDeviceChangeApplied(@NonNull BluetoothDevice device) { if (DBG) Log.d(TAG, "notifyActiveDeviceChangeApplied(" + device + ")"); @@ -5068,23 +5034,18 @@ public final class BluetoothAdapter { return BluetoothStatusCodes.ERROR_UNKNOWN; } - @SuppressLint("AndroidFrameworkBluetoothPermission") + private final CallbackWrapper<PreferredAudioProfilesChangedCallback, IBluetooth> + mAudioProfilesCallbackWrapper; + private final IBluetoothPreferredAudioProfilesCallback mPreferredAudioProfilesChangedCallback = new IBluetoothPreferredAudioProfilesCallback.Stub() { @Override public void onPreferredAudioProfilesChanged( BluetoothDevice device, Bundle preferredAudioProfiles, int status) { - for (Map.Entry<PreferredAudioProfilesChangedCallback, Executor> - callbackExecutorEntry : - mAudioProfilesChangedCallbackExecutorMap.entrySet()) { - PreferredAudioProfilesChangedCallback callback = - callbackExecutorEntry.getKey(); - Executor executor = callbackExecutorEntry.getValue(); - executor.execute( - () -> - callback.onPreferredAudioProfilesChanged( - device, preferredAudioProfiles, status)); - } + mAudioProfilesCallbackWrapper.forEach( + (cb) -> + cb.onPreferredAudioProfilesChanged( + device, preferredAudioProfiles, status)); } }; @@ -5116,46 +5077,26 @@ public final class BluetoothAdapter { * @hide */ @SystemApi - @RequiresPermission( - allOf = { - BLUETOOTH_CONNECT, - BLUETOOTH_PRIVILEGED, - }) + @RequiresPermission(allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED}) @RegisterPreferredAudioProfilesCallbackReturnValues public int registerPreferredAudioProfilesChangedCallback( @NonNull @CallbackExecutor Executor executor, @NonNull PreferredAudioProfilesChangedCallback callback) { if (DBG) Log.d(TAG, "registerPreferredAudioProfilesChangedCallback()"); - requireNonNull(executor, "executor cannot be null"); - requireNonNull(callback, "callback cannot be null"); - - synchronized (mAudioProfilesChangedCallbackExecutorMap) { - // If the callback map is empty, we register the service-to-app callback - if (mAudioProfilesChangedCallbackExecutorMap.isEmpty()) { - int serviceCallStatus = BluetoothStatusCodes.ERROR_UNKNOWN; - mServiceLock.readLock().lock(); - try { - if (mService != null) { - serviceCallStatus = - mService.registerPreferredAudioProfilesChangedCallback( - mPreferredAudioProfilesChangedCallback, mAttributionSource); - } - } catch (RemoteException e) { - Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable())); - } finally { - mServiceLock.readLock().unlock(); - } - if (serviceCallStatus != BluetoothStatusCodes.SUCCESS) { - return serviceCallStatus; - } - } + requireNonNull(callback); + requireNonNull(executor); - // Adds the passed in callback to our local mapping - if (mAudioProfilesChangedCallbackExecutorMap.containsKey(callback)) { - throw new IllegalArgumentException("This callback has already been registered"); - } else { - mAudioProfilesChangedCallbackExecutorMap.put(callback, executor); + mServiceLock.readLock().lock(); + try { + int status = mService.isDualModeAudioEnabled(mAttributionSource); + if (status != BluetoothStatusCodes.SUCCESS) { + return status; } + mAudioProfilesCallbackWrapper.registerCallback(mService, callback, executor); + } catch (RemoteException e) { + Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable())); + } finally { + mServiceLock.readLock().unlock(); } return BluetoothStatusCodes.SUCCESS; @@ -5187,41 +5128,20 @@ public final class BluetoothAdapter { * @hide */ @SystemApi - @RequiresPermission( - allOf = { - BLUETOOTH_CONNECT, - BLUETOOTH_PRIVILEGED, - }) + @RequiresPermission(allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED}) @UnRegisterPreferredAudioProfilesCallbackReturnValues public int unregisterPreferredAudioProfilesChangedCallback( @NonNull PreferredAudioProfilesChangedCallback callback) { if (DBG) Log.d(TAG, "unregisterPreferredAudioProfilesChangedCallback()"); - requireNonNull(callback, "callback cannot be null"); - synchronized (mAudioProfilesChangedCallbackExecutorMap) { - if (mAudioProfilesChangedCallbackExecutorMap.remove(callback) == null) { - throw new IllegalArgumentException("This callback has not been registered"); - } - } - - if (!mAudioProfilesChangedCallbackExecutorMap.isEmpty()) { - return BluetoothStatusCodes.SUCCESS; - } - - // If the callback map is empty, we unregister the service-to-app callback mServiceLock.readLock().lock(); try { - if (mService != null) { - return mService.unregisterPreferredAudioProfilesChangedCallback( - mPreferredAudioProfilesChangedCallback, mAttributionSource); - } - } catch (RemoteException e) { - Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable())); + mAudioProfilesCallbackWrapper.unregisterCallback(mService, callback); } finally { mServiceLock.readLock().unlock(); } - return BluetoothStatusCodes.ERROR_UNKNOWN; + return BluetoothStatusCodes.SUCCESS; } /** @@ -5303,11 +5223,7 @@ public final class BluetoothAdapter { * @hide */ @SystemApi - @RequiresPermission( - allOf = { - BLUETOOTH_CONNECT, - BLUETOOTH_PRIVILEGED, - }) + @RequiresPermission(allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED}) @RegisterBluetoothQualityReportReadyCallbackReturnValues public int registerBluetoothQualityReportReadyCallback( @NonNull @CallbackExecutor Executor executor, @@ -5347,11 +5263,7 @@ public final class BluetoothAdapter { * @hide */ @SystemApi - @RequiresPermission( - allOf = { - BLUETOOTH_CONNECT, - BLUETOOTH_PRIVILEGED, - }) + @RequiresPermission(allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED}) @UnRegisterBluetoothQualityReportReadyCallbackReturnValues public int unregisterBluetoothQualityReportReadyCallback( @NonNull BluetoothQualityReportReadyCallback callback) { diff --git a/framework/java/android/bluetooth/BluetoothCsipSetCoordinator.java b/framework/java/android/bluetooth/BluetoothCsipSetCoordinator.java index 4ab5534a00..ddc8f9c3a2 100644 --- a/framework/java/android/bluetooth/BluetoothCsipSetCoordinator.java +++ b/framework/java/android/bluetooth/BluetoothCsipSetCoordinator.java @@ -268,7 +268,7 @@ public final class BluetoothCsipSetCoordinator implements BluetoothProfile, Auto * @hide */ @SystemApi - @RequiresPermission(BLUETOOTH_PRIVILEGED) + @RequiresPermission(allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED}) public @Nullable UUID lockGroup( int groupId, @NonNull @CallbackExecutor Executor executor, @@ -302,7 +302,7 @@ public final class BluetoothCsipSetCoordinator implements BluetoothProfile, Auto * @hide */ @SystemApi - @RequiresPermission(BLUETOOTH_PRIVILEGED) + @RequiresPermission(allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED}) public boolean unlockGroup(@NonNull UUID lockUuid) { if (VDBG) log("unlockGroup()"); Objects.requireNonNull(lockUuid, "lockUuid cannot be null"); @@ -329,7 +329,7 @@ public final class BluetoothCsipSetCoordinator implements BluetoothProfile, Auto * @hide */ @SystemApi - @RequiresPermission(BLUETOOTH_PRIVILEGED) + @RequiresPermission(allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED}) @NonNull public Map<Integer, ParcelUuid> getGroupUuidMapByDevice(@Nullable BluetoothDevice device) { if (VDBG) log("getGroupUuidMapByDevice()"); @@ -354,7 +354,7 @@ public final class BluetoothCsipSetCoordinator implements BluetoothProfile, Auto * @hide */ @SystemApi - @RequiresPermission(BLUETOOTH_PRIVILEGED) + @RequiresPermission(allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED}) public @NonNull List<Integer> getAllGroupIds(@Nullable ParcelUuid uuid) { if (VDBG) log("getAllGroupIds()"); final IBluetoothCsipSetCoordinator service = getService(); @@ -373,6 +373,7 @@ public final class BluetoothCsipSetCoordinator implements BluetoothProfile, Auto /** {@inheritDoc} */ @Override + @RequiresPermission(allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED}) public @NonNull List<BluetoothDevice> getConnectedDevices() { if (VDBG) log("getConnectedDevices()"); final IBluetoothCsipSetCoordinator service = getService(); @@ -391,6 +392,7 @@ public final class BluetoothCsipSetCoordinator implements BluetoothProfile, Auto /** {@inheritDoc} */ @Override + @RequiresPermission(allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED}) @NonNull public List<BluetoothDevice> getDevicesMatchingConnectionStates(@NonNull int[] states) { if (VDBG) log("getDevicesMatchingStates(states=" + Arrays.toString(states) + ")"); @@ -411,6 +413,7 @@ public final class BluetoothCsipSetCoordinator implements BluetoothProfile, Auto /** {@inheritDoc} */ @Override @BluetoothProfile.BtProfileState + @RequiresPermission(allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED}) public int getConnectionState(@Nullable BluetoothDevice device) { if (VDBG) log("getState(" + device + ")"); final IBluetoothCsipSetCoordinator service = getService(); @@ -440,7 +443,7 @@ public final class BluetoothCsipSetCoordinator implements BluetoothProfile, Auto * @hide */ @SystemApi - @RequiresPermission(BLUETOOTH_PRIVILEGED) + @RequiresPermission(allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED}) public boolean setConnectionPolicy( @Nullable BluetoothDevice device, @ConnectionPolicy int connectionPolicy) { if (DBG) log("setConnectionPolicy(" + device + ", " + connectionPolicy + ")"); @@ -472,7 +475,7 @@ public final class BluetoothCsipSetCoordinator implements BluetoothProfile, Auto * @hide */ @SystemApi - @RequiresPermission(BLUETOOTH_PRIVILEGED) + @RequiresPermission(allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED}) public @ConnectionPolicy int getConnectionPolicy(@Nullable BluetoothDevice device) { if (VDBG) log("getConnectionPolicy(" + device + ")"); final IBluetoothCsipSetCoordinator service = getService(); diff --git a/framework/java/android/bluetooth/BluetoothDevice.java b/framework/java/android/bluetooth/BluetoothDevice.java index 140a8e202a..7f8e4da575 100644 --- a/framework/java/android/bluetooth/BluetoothDevice.java +++ b/framework/java/android/bluetooth/BluetoothDevice.java @@ -1481,7 +1481,6 @@ public final class BluetoothDevice implements Parcelable, Attributable { * @hide */ @SystemApi - @RequiresPermission(BLUETOOTH_PRIVILEGED) public void prepareToEnterProcess(@NonNull AttributionSource attributionSource) { setAttributionSource(attributionSource); } @@ -1579,7 +1578,6 @@ public final class BluetoothDevice implements Parcelable, Attributable { */ @SystemApi @NonNull - @RequiresPermission(BLUETOOTH_PRIVILEGED) public String getAnonymizedAddress() { return BluetoothUtils.toAnonymizedAddress(mAddress); } @@ -1731,7 +1729,9 @@ public final class BluetoothDevice implements Parcelable, Attributable { */ @RequiresLegacyBluetoothPermission @RequiresBluetoothConnectPermission - @RequiresPermission(BLUETOOTH_CONNECT) + @RequiresPermission( + allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED}, + conditional = true) public @SetAliasReturnValues int setAlias(@Nullable String alias) { if (alias != null && alias.isEmpty()) { throw new IllegalArgumentException("alias cannot be the empty string"); @@ -1908,7 +1908,7 @@ public final class BluetoothDevice implements Parcelable, Attributable { * @hide */ @SystemApi - @RequiresPermission(BLUETOOTH_CONNECT) + @RequiresPermission(allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED}) public boolean cancelBondProcess() { if (DBG) log("cancelBondProcess()"); final IBluetooth service = getService(); @@ -2036,6 +2036,7 @@ public final class BluetoothDevice implements Parcelable, Attributable { @RequiresLegacyBluetoothPermission @RequiresBluetoothConnectPermission @RequiresPermission(BLUETOOTH_CONNECT) + @SuppressLint("AndroidFrameworkRequiresPermission") // IpcDataCache prevent lint enforcement public int getBondState() { if (DBG) log("getBondState(" + this + ")"); final IBluetooth service = getService(); @@ -2377,6 +2378,7 @@ public final class BluetoothDevice implements Parcelable, Attributable { @RequiresLegacyBluetoothPermission @RequiresBluetoothConnectPermission @RequiresPermission(BLUETOOTH_CONNECT) + @SuppressLint("AndroidFrameworkRequiresPermission") // See fetchUuidsWithSdp(int) for reason public boolean fetchUuidsWithSdp() { return fetchUuidsWithSdp(TRANSPORT_AUTO); } @@ -2393,6 +2395,11 @@ public final class BluetoothDevice implements Parcelable, Attributable { * there is an ongoing bonding process, service discovery or device inquiry, the request will be * queued. * + * <p>Requires the {@link android.Manifest.permission#BLUETOOTH_PRIVILEGED} permission only when + * {@code transport} is not {@code #TRANSPORT_AUTO}. + * + * <p>The {@link android.Manifest.permission#BLUETOOTH_CONNECT} permission is always enforced. + * * @param transport - provide type of transport (e.g. LE or Classic). * @return False if the check fails, True if the process of initiating an ACL connection to the * remote device was started or cached UUIDs will be broadcast with the specific transport. @@ -2403,7 +2410,8 @@ public final class BluetoothDevice implements Parcelable, Attributable { allOf = { BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED, - }) + }, + conditional = true) public boolean fetchUuidsWithSdp(@Transport int transport) { if (DBG) log("fetchUuidsWithSdp()"); final IBluetooth service = getService(); diff --git a/framework/java/android/bluetooth/BluetoothHapClient.java b/framework/java/android/bluetooth/BluetoothHapClient.java index cc11589685..d099e458f1 100644 --- a/framework/java/android/bluetooth/BluetoothHapClient.java +++ b/framework/java/android/bluetooth/BluetoothHapClient.java @@ -29,6 +29,7 @@ import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.RequiresPermission; import android.annotation.SdkConstant; +import android.annotation.SuppressLint; import android.annotation.SystemApi; import android.bluetooth.annotations.RequiresBluetoothConnectPermission; import android.content.AttributionSource; @@ -444,6 +445,7 @@ public final class BluetoothHapClient implements BluetoothProfile, AutoCloseable * Create a BluetoothHapClient proxy object for interacting with the local Bluetooth Hearing * Access Profile (HAP) client. */ + @SuppressLint("AndroidFrameworkRequiresPermission") // Consumer wrongly report permission BluetoothHapClient(Context context, BluetoothAdapter adapter) { mAdapter = adapter; mAttributionSource = mAdapter.getAttributionSource(); @@ -527,6 +529,7 @@ public final class BluetoothHapClient implements BluetoothProfile, AutoCloseable @SystemApi @RequiresBluetoothConnectPermission @RequiresPermission(allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED}) + @SuppressLint("AndroidFrameworkRequiresPermission") // Consumer are fakely reporting permission public void registerCallback( @NonNull @CallbackExecutor Executor executor, @NonNull Callback callback) { mCallbackWrapper.registerCallback(mService, callback, executor); @@ -548,6 +551,7 @@ public final class BluetoothHapClient implements BluetoothProfile, AutoCloseable @SystemApi @RequiresBluetoothConnectPermission @RequiresPermission(allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED}) + @SuppressLint("AndroidFrameworkRequiresPermission") // Consumer are fakely reporting permission public void unregisterCallback(@NonNull Callback callback) { mCallbackWrapper.unregisterCallback(mService, callback); } diff --git a/framework/java/android/bluetooth/BluetoothHeadset.java b/framework/java/android/bluetooth/BluetoothHeadset.java index 1ffdaf5acd..43a58c86d4 100644 --- a/framework/java/android/bluetooth/BluetoothHeadset.java +++ b/framework/java/android/bluetooth/BluetoothHeadset.java @@ -597,7 +597,7 @@ public final class BluetoothHeadset implements BluetoothProfile { @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) @RequiresLegacyBluetoothPermission @RequiresBluetoothConnectPermission - @RequiresPermission(BLUETOOTH_CONNECT) + @RequiresPermission(allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED}) public int getPriority(BluetoothDevice device) { if (VDBG) log("getPriority(" + device + ")"); return BluetoothAdapter.connectionPolicyToPriority(getConnectionPolicy(device)); @@ -615,11 +615,7 @@ public final class BluetoothHeadset implements BluetoothProfile { */ @SystemApi @RequiresBluetoothConnectPermission - @RequiresPermission( - allOf = { - BLUETOOTH_CONNECT, - BLUETOOTH_PRIVILEGED, - }) + @RequiresPermission(allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED}) public @ConnectionPolicy int getConnectionPolicy(@NonNull BluetoothDevice device) { if (VDBG) log("getConnectionPolicy(" + device + ")"); final IBluetoothHeadset service = getService(); @@ -819,7 +815,6 @@ public final class BluetoothHeadset implements BluetoothProfile { return service.getAudioState(device, mAttributionSource); } catch (RemoteException e) { Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable())); - throw e.rethrowAsRuntimeException(); } } return BluetoothHeadset.STATE_AUDIO_DISCONNECTED; @@ -878,7 +873,6 @@ public final class BluetoothHeadset implements BluetoothProfile { return BluetoothStatusCodes.SUCCESS; } catch (RemoteException e) { Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable())); - throw e.rethrowAsRuntimeException(); } } @@ -913,7 +907,6 @@ public final class BluetoothHeadset implements BluetoothProfile { : BluetoothStatusCodes.NOT_ALLOWED; } catch (RemoteException e) { Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable())); - throw e.rethrowAsRuntimeException(); } } @@ -995,7 +988,6 @@ public final class BluetoothHeadset implements BluetoothProfile { return service.connectAudio(mAttributionSource); } catch (RemoteException e) { Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable())); - throw e.rethrowAsRuntimeException(); } } @@ -1046,7 +1038,6 @@ public final class BluetoothHeadset implements BluetoothProfile { return service.disconnectAudio(mAttributionSource); } catch (RemoteException e) { Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable())); - throw e.rethrowAsRuntimeException(); } } diff --git a/framework/java/android/bluetooth/BluetoothHeadsetClient.java b/framework/java/android/bluetooth/BluetoothHeadsetClient.java index 830e6d5c0e..6beba77dff 100644 --- a/framework/java/android/bluetooth/BluetoothHeadsetClient.java +++ b/framework/java/android/bluetooth/BluetoothHeadsetClient.java @@ -1006,7 +1006,7 @@ public final class BluetoothHeadsetClient implements BluetoothProfile, AutoClose * @hide */ @RequiresBluetoothConnectPermission - @RequiresPermission(BLUETOOTH_CONNECT) + @RequiresPermission(allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED}) public Bundle getCurrentAgEvents(BluetoothDevice device) { if (DBG) log("getCurrentAgEvents()"); final IBluetoothHeadsetClient service = getService(); diff --git a/framework/java/android/bluetooth/BluetoothHearingAid.java b/framework/java/android/bluetooth/BluetoothHearingAid.java index 8c087137a1..5ac2e015b4 100644 --- a/framework/java/android/bluetooth/BluetoothHearingAid.java +++ b/framework/java/android/bluetooth/BluetoothHearingAid.java @@ -97,11 +97,6 @@ public final class BluetoothHearingAid implements BluetoothProfile { * * @hide */ - @RequiresPermission( - allOf = { - BLUETOOTH_SCAN, - BLUETOOTH_PRIVILEGED, - }) @SystemApi @DeviceMode public int getDeviceMode() { @@ -119,11 +114,6 @@ public final class BluetoothHearingAid implements BluetoothProfile { * * @hide */ - @RequiresPermission( - allOf = { - BLUETOOTH_SCAN, - BLUETOOTH_PRIVILEGED, - }) @SystemApi @DeviceSide public int getDeviceSide() { @@ -138,11 +128,6 @@ public final class BluetoothHearingAid implements BluetoothProfile { * @return {@code true} when CSIP is supported, {@code false} otherwise * @hide */ - @RequiresPermission( - allOf = { - BLUETOOTH_SCAN, - BLUETOOTH_PRIVILEGED, - }) @SystemApi public boolean isCsipSupported() { if (VDBG) Log.v(TAG, "isCsipSupported()"); @@ -154,11 +139,6 @@ public final class BluetoothHearingAid implements BluetoothProfile { * * @hide */ - @RequiresPermission( - allOf = { - BLUETOOTH_SCAN, - BLUETOOTH_PRIVILEGED, - }) @SystemApi public int getTruncatedHiSyncId() { if (VDBG) Log.v(TAG, "getTruncatedHiSyncId: " + mTruncatedHiSyncId); @@ -174,11 +154,6 @@ public final class BluetoothHearingAid implements BluetoothProfile { * @return {@code true} if the devices are a likely pair, {@code false} otherwise * @hide */ - @RequiresPermission( - allOf = { - BLUETOOTH_SCAN, - BLUETOOTH_PRIVILEGED, - }) @SystemApi public boolean isInPairWith(@Nullable AdvertisementServiceData data) { if (VDBG) Log.v(TAG, "isInPairWith()"); diff --git a/framework/java/android/bluetooth/BluetoothLeAudio.java b/framework/java/android/bluetooth/BluetoothLeAudio.java index 3b13ce284b..594edfd2db 100644 --- a/framework/java/android/bluetooth/BluetoothLeAudio.java +++ b/framework/java/android/bluetooth/BluetoothLeAudio.java @@ -20,6 +20,8 @@ package android.bluetooth; import static android.Manifest.permission.BLUETOOTH_CONNECT; import static android.Manifest.permission.BLUETOOTH_PRIVILEGED; +import static java.util.Objects.requireNonNull; + import android.annotation.CallbackExecutor; import android.annotation.FlaggedApi; import android.annotation.IntDef; @@ -36,6 +38,7 @@ import android.bluetooth.annotations.RequiresLegacyBluetoothPermission; import android.content.AttributionSource; import android.content.Context; import android.os.IBinder; +import android.os.Process; import android.os.RemoteException; import android.util.CloseGuard; import android.util.Log; @@ -45,11 +48,9 @@ import com.android.bluetooth.flags.Flags; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; -import java.util.Objects; import java.util.concurrent.Executor; +import java.util.function.Consumer; /** * This class provides the public APIs to control the LeAudio profile. @@ -65,8 +66,6 @@ public final class BluetoothLeAudio implements BluetoothProfile, AutoCloseable { private static final boolean DBG = Log.isLoggable(TAG, Log.DEBUG); private static final boolean VDBG = false; - private final Map<Callback, Executor> mCallbackExecutorMap = new HashMap<>(); - private CloseGuard mCloseGuard; /** @@ -155,67 +154,41 @@ public final class BluetoothLeAudio implements BluetoothProfile, AutoCloseable { } } - @SuppressLint("AndroidFrameworkBluetoothPermission") - private final IBluetoothLeAudioCallback mCallback = - new IBluetoothLeAudioCallback.Stub() { - @Override - public void onCodecConfigChanged( - int groupId, @NonNull BluetoothLeAudioCodecStatus status) { - for (Map.Entry<BluetoothLeAudio.Callback, Executor> callbackExecutorEntry : - mCallbackExecutorMap.entrySet()) { - BluetoothLeAudio.Callback callback = callbackExecutorEntry.getKey(); - Executor executor = callbackExecutorEntry.getValue(); - executor.execute(() -> callback.onCodecConfigChanged(groupId, status)); - } - } - - @Override - public void onGroupNodeAdded(@NonNull BluetoothDevice device, int groupId) { - Attributable.setAttributionSource(device, mAttributionSource); - for (Map.Entry<BluetoothLeAudio.Callback, Executor> callbackExecutorEntry : - mCallbackExecutorMap.entrySet()) { - BluetoothLeAudio.Callback callback = callbackExecutorEntry.getKey(); - Executor executor = callbackExecutorEntry.getValue(); - executor.execute(() -> callback.onGroupNodeAdded(device, groupId)); - } - } - - @Override - public void onGroupNodeRemoved(@NonNull BluetoothDevice device, int groupId) { - Attributable.setAttributionSource(device, mAttributionSource); - for (Map.Entry<BluetoothLeAudio.Callback, Executor> callbackExecutorEntry : - mCallbackExecutorMap.entrySet()) { - BluetoothLeAudio.Callback callback = callbackExecutorEntry.getKey(); - Executor executor = callbackExecutorEntry.getValue(); - executor.execute(() -> callback.onGroupNodeRemoved(device, groupId)); - } - } - - @Override - public void onGroupStatusChanged(int groupId, int groupStatus) { - for (Map.Entry<BluetoothLeAudio.Callback, Executor> callbackExecutorEntry : - mCallbackExecutorMap.entrySet()) { - BluetoothLeAudio.Callback callback = callbackExecutorEntry.getKey(); - Executor executor = callbackExecutorEntry.getValue(); - executor.execute(() -> callback.onGroupStatusChanged(groupId, groupStatus)); - } - } - - @Override - public void onGroupStreamStatusChanged(int groupId, int groupStreamStatus) { - if (Flags.leaudioCallbackOnGroupStreamStatus()) { - for (Map.Entry<BluetoothLeAudio.Callback, Executor> callbackExecutorEntry : - mCallbackExecutorMap.entrySet()) { - BluetoothLeAudio.Callback callback = callbackExecutorEntry.getKey(); - Executor executor = callbackExecutorEntry.getValue(); - executor.execute( - () -> - callback.onGroupStreamStatusChanged( - groupId, groupStreamStatus)); - } - } - } - }; + private final CallbackWrapper<Callback, IBluetoothLeAudio> mCallbackWrapper; + + private final IBluetoothLeAudioCallback mCallback = new LeAudioNotifyCallback(); + + private class LeAudioNotifyCallback extends IBluetoothLeAudioCallback.Stub { + @Override + public void onCodecConfigChanged(int groupId, BluetoothLeAudioCodecStatus status) { + mCallbackWrapper.forEach((cb) -> cb.onCodecConfigChanged(groupId, status)); + } + + @Override + public void onGroupNodeAdded(@NonNull BluetoothDevice device, int groupId) { + Attributable.setAttributionSource(device, mAttributionSource); + mCallbackWrapper.forEach((cb) -> cb.onGroupNodeAdded(device, groupId)); + } + + @Override + public void onGroupNodeRemoved(@NonNull BluetoothDevice device, int groupId) { + Attributable.setAttributionSource(device, mAttributionSource); + mCallbackWrapper.forEach((cb) -> cb.onGroupNodeRemoved(device, groupId)); + } + + @Override + public void onGroupStatusChanged(int groupId, int groupStatus) { + mCallbackWrapper.forEach((cb) -> cb.onGroupStatusChanged(groupId, groupStatus)); + } + + @Override + public void onGroupStreamStatusChanged(int groupId, int groupStreamStatus) { + if (Flags.leaudioCallbackOnGroupStreamStatus()) { + mCallbackWrapper.forEach( + (cb) -> cb.onGroupStreamStatusChanged(groupId, groupStreamStatus)); + } + } + } /** * Intent used to broadcast the change in connection state of the LeAudio profile. Please note @@ -664,6 +637,7 @@ public final class BluetoothLeAudio implements BluetoothProfile, AutoCloseable { public static final String EXTRA_LE_AUDIO_AVAILABLE_CONTEXTS = "android.bluetooth.extra.LE_AUDIO_AVAILABLE_CONTEXTS"; + private final Context mContext; private final BluetoothAdapter mAdapter; private final AttributionSource mAttributionSource; @@ -706,11 +680,31 @@ public final class BluetoothLeAudio implements BluetoothProfile, AutoCloseable { * Create a BluetoothLeAudio proxy object for interacting with the local Bluetooth LeAudio * service. */ + @SuppressLint("AndroidFrameworkRequiresPermission") // Consumer wrongly report permission /* package */ BluetoothLeAudio(Context context, BluetoothAdapter adapter) { + mContext = requireNonNull(context); mAdapter = adapter; mAttributionSource = adapter.getAttributionSource(); mService = null; + Consumer<IBluetoothLeAudio> registerConsumer = + (IBluetoothLeAudio service) -> { + try { + service.registerCallback(mCallback, mAttributionSource); + } catch (RemoteException e) { + Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable())); + } + }; + Consumer<IBluetoothLeAudio> unregisterConsumer = + (IBluetoothLeAudio service) -> { + try { + service.unregisterCallback(mCallback, mAttributionSource); + } catch (RemoteException e) { + Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable())); + } + }; + + mCallbackWrapper = new CallbackWrapper(registerConsumer, unregisterConsumer); mCloseGuard = new CloseGuard(); mCloseGuard.open("close"); } @@ -723,21 +717,10 @@ public final class BluetoothLeAudio implements BluetoothProfile, AutoCloseable { /** @hide */ @Override + @SuppressLint("AndroidFrameworkRequiresPermission") // Unexposed re-entrant callback public void onServiceConnected(IBinder service) { mService = IBluetoothLeAudio.Stub.asInterface(service); - // re-register the service-to-app callback - synchronized (mCallbackExecutorMap) { - if (mCallbackExecutorMap.isEmpty()) { - return; - } - try { - if (service != null) { - mService.registerCallback(mCallback, mAttributionSource); - } - } catch (RemoteException e) { - Log.e(TAG, "Failed to register callback", e); - } - } + mCallbackWrapper.registerToNewService(mService); } /** @hide */ @@ -960,36 +943,15 @@ public final class BluetoothLeAudio implements BluetoothProfile, AutoCloseable { }) public void registerCallback( @NonNull @CallbackExecutor Executor executor, @NonNull Callback callback) { - Objects.requireNonNull(executor, "executor cannot be null"); - Objects.requireNonNull(callback, "callback cannot be null"); - if (DBG) log("registerCallback"); - - synchronized (mCallbackExecutorMap) { - // If the callback map is empty, we register the service-to-app callback - if (mCallbackExecutorMap.isEmpty()) { - if (!mAdapter.isEnabled()) { - /* If Bluetooth is off, just store callback and it will be registered - * when Bluetooth is on - */ - mCallbackExecutorMap.put(callback, executor); - return; - } - try { - final IBluetoothLeAudio service = getService(); - if (service != null) { - service.registerCallback(mCallback, mAttributionSource); - } - } catch (RemoteException e) { - throw e.rethrowAsRuntimeException(); - } - } - - // Adds the passed in callback to our map of callbacks to executors - if (mCallbackExecutorMap.containsKey(callback)) { - throw new IllegalArgumentException("This callback has already been registered"); - } - mCallbackExecutorMap.put(callback, executor); - } + // Enforcing permission in the framework is useless from security point of view. + // This is being done to help normal app developer to catch the missing permission, since + // the call to the service is oneway and the SecurityException will just be logged + final int pid = Process.myPid(); + final int uid = Process.myUid(); + mContext.enforcePermission(BLUETOOTH_CONNECT, pid, uid, null); + mContext.enforcePermission(BLUETOOTH_PRIVILEGED, pid, uid, null); + + mCallbackWrapper.registerCallback(getService(), callback, executor); } /** @@ -1013,26 +975,15 @@ public final class BluetoothLeAudio implements BluetoothProfile, AutoCloseable { BLUETOOTH_PRIVILEGED, }) public void unregisterCallback(@NonNull Callback callback) { - Objects.requireNonNull(callback, "callback cannot be null"); - if (DBG) log("unregisterCallback"); - - synchronized (mCallbackExecutorMap) { - if (mCallbackExecutorMap.remove(callback) == null) { - throw new IllegalArgumentException("This callback has not been registered"); - } - } - - // If the callback map is empty, we unregister the service-to-app callback - if (mCallbackExecutorMap.isEmpty()) { - try { - final IBluetoothLeAudio service = getService(); - if (service != null) { - service.unregisterCallback(mCallback, mAttributionSource); - } - } catch (RemoteException e) { - throw e.rethrowAsRuntimeException(); - } - } + // Enforcing permission in the framework is useless from security point of view. + // This is being done to help normal app developer to catch the missing permission, since + // the call to the service is oneway and the SecurityException will just be logged + final int pid = Process.myPid(); + final int uid = Process.myUid(); + mContext.enforcePermission(BLUETOOTH_CONNECT, pid, uid, null); + mContext.enforcePermission(BLUETOOTH_PRIVILEGED, pid, uid, null); + + mCallbackWrapper.unregisterCallback(getService(), callback); } /** @@ -1411,8 +1362,8 @@ public final class BluetoothLeAudio implements BluetoothProfile, AutoCloseable { @NonNull BluetoothLeAudioCodecConfig outputCodecConfig) { if (DBG) Log.d(TAG, "setCodecConfigPreference(" + groupId + ")"); - Objects.requireNonNull(inputCodecConfig, " inputCodecConfig shall not be null"); - Objects.requireNonNull(outputCodecConfig, " outputCodecConfig shall not be null"); + requireNonNull(inputCodecConfig); + requireNonNull(outputCodecConfig); final IBluetoothLeAudio service = getService(); diff --git a/framework/java/android/bluetooth/BluetoothLeBroadcast.java b/framework/java/android/bluetooth/BluetoothLeBroadcast.java index ac289a8373..b41218e330 100644 --- a/framework/java/android/bluetooth/BluetoothLeBroadcast.java +++ b/framework/java/android/bluetooth/BluetoothLeBroadcast.java @@ -313,12 +313,6 @@ public final class BluetoothLeBroadcast implements AutoCloseable, BluetoothProfi * @hide */ @Override - @RequiresBluetoothConnectPermission - @RequiresPermission( - allOf = { - BLUETOOTH_CONNECT, - BLUETOOTH_PRIVILEGED, - }) public int getConnectionState(@NonNull BluetoothDevice device) { throw new UnsupportedOperationException("LE Audio Broadcasts are not connection-oriented."); } @@ -329,12 +323,6 @@ public final class BluetoothLeBroadcast implements AutoCloseable, BluetoothProfi * @hide */ @Override - @RequiresBluetoothConnectPermission - @RequiresPermission( - allOf = { - BLUETOOTH_CONNECT, - BLUETOOTH_PRIVILEGED, - }) @NonNull public List<BluetoothDevice> getDevicesMatchingConnectionStates(@NonNull int[] states) { throw new UnsupportedOperationException("LE Audio Broadcasts are not connection-oriented."); @@ -346,12 +334,6 @@ public final class BluetoothLeBroadcast implements AutoCloseable, BluetoothProfi * @hide */ @Override - @RequiresBluetoothConnectPermission - @RequiresPermission( - allOf = { - BLUETOOTH_CONNECT, - BLUETOOTH_PRIVILEGED, - }) public @NonNull List<BluetoothDevice> getConnectedDevices() { throw new UnsupportedOperationException("LE Audio Broadcasts are not connection-oriented."); } @@ -848,6 +830,7 @@ public final class BluetoothLeBroadcast implements AutoCloseable, BluetoothProfi /** @hide */ @Override + @SuppressLint("AndroidFrameworkRequiresPermission") // Unexposed re-entrant callback public void onServiceConnected(IBinder service) { mService = IBluetoothLeAudio.Stub.asInterface(service); // re-register the service-to-app callback diff --git a/framework/java/android/bluetooth/BluetoothLeBroadcastAssistant.java b/framework/java/android/bluetooth/BluetoothLeBroadcastAssistant.java index afd9fba4c9..5cd5ace9cc 100644 --- a/framework/java/android/bluetooth/BluetoothLeBroadcastAssistant.java +++ b/framework/java/android/bluetooth/BluetoothLeBroadcastAssistant.java @@ -516,6 +516,7 @@ public final class BluetoothLeBroadcastAssistant implements BluetoothProfile, Au /** @hide */ @Override + @RequiresPermission(allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED}) public void onServiceConnected(IBinder service) { mService = IBluetoothLeBroadcastAssistant.Stub.asInterface(service); // re-register the service-to-app callback diff --git a/framework/java/android/bluetooth/BluetoothMap.java b/framework/java/android/bluetooth/BluetoothMap.java index 64fc3a3ef8..62fb47ec55 100644 --- a/framework/java/android/bluetooth/BluetoothMap.java +++ b/framework/java/android/bluetooth/BluetoothMap.java @@ -404,6 +404,7 @@ public final class BluetoothMap implements BluetoothProfile, AutoCloseable { */ @RequiresBluetoothConnectPermission @RequiresPermission(BLUETOOTH_CONNECT) + @SuppressLint("AndroidFrameworkRequiresPermission") // IpcDataCache prevent lint enforcement public int getConnectionState(BluetoothDevice device) { if (DBG) log("getConnectionState(" + device + ")"); final IBluetoothMap service = getService(); diff --git a/framework/java/android/bluetooth/BluetoothSap.java b/framework/java/android/bluetooth/BluetoothSap.java index 49c4720dff..1d4e4ba04a 100644 --- a/framework/java/android/bluetooth/BluetoothSap.java +++ b/framework/java/android/bluetooth/BluetoothSap.java @@ -401,6 +401,7 @@ public final class BluetoothSap implements BluetoothProfile, AutoCloseable { */ @RequiresBluetoothConnectPermission @RequiresPermission(BLUETOOTH_CONNECT) + @SuppressLint("AndroidFrameworkRequiresPermission") // IpcDataCache prevent lint enforcement public int getConnectionState(BluetoothDevice device) { if (DBG) log("getConnectionState(" + device + ")"); final IBluetoothSap service = getService(); diff --git a/framework/java/android/bluetooth/BluetoothSocket.java b/framework/java/android/bluetooth/BluetoothSocket.java index df84822dc6..efe90f55d7 100644 --- a/framework/java/android/bluetooth/BluetoothSocket.java +++ b/framework/java/android/bluetooth/BluetoothSocket.java @@ -18,6 +18,7 @@ package android.bluetooth; import static android.Manifest.permission.BLUETOOTH_CONNECT; import static android.Manifest.permission.BLUETOOTH_PRIVILEGED; +import static android.Manifest.permission.LOCAL_MAC_ADDRESS; import android.annotation.FlaggedApi; import android.annotation.RequiresNoPermission; @@ -193,6 +194,7 @@ public final class BluetoothSocket implements Closeable { * @param uuid SDP uuid * @throws IOException On error, for example Bluetooth not available, or insufficient privileges */ + @RequiresPermission(allOf = {BLUETOOTH_CONNECT, LOCAL_MAC_ADDRESS}) /*package*/ BluetoothSocket( int type, boolean auth, @@ -217,6 +219,7 @@ public final class BluetoothSocket implements Closeable { * @param min16DigitPin enforce a minimum length of 16 digits for a sec mode 2 connection * @throws IOException On error, for example Bluetooth not available, or insufficient privileges */ + @RequiresPermission(allOf = {BLUETOOTH_CONNECT, LOCAL_MAC_ADDRESS}) /*package*/ BluetoothSocket( int type, boolean auth, diff --git a/framework/java/android/bluetooth/BluetoothVolumeControl.java b/framework/java/android/bluetooth/BluetoothVolumeControl.java index e13bd47d08..70aefad50f 100644 --- a/framework/java/android/bluetooth/BluetoothVolumeControl.java +++ b/framework/java/android/bluetooth/BluetoothVolumeControl.java @@ -278,7 +278,6 @@ public final class BluetoothVolumeControl implements BluetoothProfile, AutoClose * <p>Application should call this method as early as possible after it is done with this * VolumeControl server. */ - @RequiresPermission(BLUETOOTH_PRIVILEGED) @Override public void close() { if (VDBG) log("close()"); @@ -288,6 +287,7 @@ public final class BluetoothVolumeControl implements BluetoothProfile, AutoClose /** @hide */ @Override + @SuppressLint("AndroidFrameworkRequiresPermission") // Unexposed re-entrant callback public void onServiceConnected(IBinder service) { mService = IBluetoothVolumeControl.Stub.asInterface(service); // re-register the service-to-app callback @@ -356,7 +356,7 @@ public final class BluetoothVolumeControl implements BluetoothProfile, AutoClose * @hide */ @RequiresBluetoothConnectPermission - @RequiresPermission(BLUETOOTH_CONNECT) + @RequiresPermission(allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED}) public List<BluetoothDevice> getDevicesMatchingConnectionStates(int[] states) { if (DBG) log("getDevicesMatchingStates()"); final IBluetoothVolumeControl service = getService(); @@ -577,6 +577,7 @@ public final class BluetoothVolumeControl implements BluetoothProfile, AutoClose * @param volumeOffset volume offset to be set on VOCS instance * @hide */ + @RequiresPermission(allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED}) private void setVolumeOffsetInternal( @NonNull BluetoothDevice device, @IntRange(from = 1, to = 255) int instanceId, diff --git a/framework/java/android/bluetooth/CallbackWrapper.java b/framework/java/android/bluetooth/CallbackWrapper.java index 47b50fec8f..820b3c97ee 100644 --- a/framework/java/android/bluetooth/CallbackWrapper.java +++ b/framework/java/android/bluetooth/CallbackWrapper.java @@ -16,11 +16,16 @@ package android.bluetooth; +import static android.Manifest.permission.BLUETOOTH_CONNECT; +import static android.Manifest.permission.BLUETOOTH_PRIVILEGED; + import static java.util.Objects.requireNonNull; import android.annotation.CallbackExecutor; import android.annotation.NonNull; import android.annotation.Nullable; +import android.annotation.RequiresPermission; +import android.annotation.SuppressLint; import com.android.internal.annotations.GuardedBy; import com.android.internal.annotations.VisibleForTesting; @@ -78,6 +83,8 @@ public class CallbackWrapper<T, S> { } /** Register the callback and save the wrapper to the service if needed */ + @RequiresPermission(allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED}) + @SuppressLint("AndroidFrameworkRequiresPermission") // Consumer wrongly report permission public void registerCallback( @Nullable S service, @NonNull T callback, @@ -99,6 +106,8 @@ public class CallbackWrapper<T, S> { } /** Register the callback and remove the wrapper to the service if needed */ + @RequiresPermission(allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED}) + @SuppressLint("AndroidFrameworkRequiresPermission") // Consumer wrongly report permission public void unregisterCallback(@Nullable S service, @NonNull T callback) { requireNonNull(callback); synchronized (mCallbackExecutorMap) { diff --git a/framework/java/android/bluetooth/le/BluetoothLeAdvertiser.java b/framework/java/android/bluetooth/le/BluetoothLeAdvertiser.java index a3e61b3078..e2572582a1 100644 --- a/framework/java/android/bluetooth/le/BluetoothLeAdvertiser.java +++ b/framework/java/android/bluetooth/le/BluetoothLeAdvertiser.java @@ -17,7 +17,6 @@ package android.bluetooth.le; import static android.Manifest.permission.BLUETOOTH_ADVERTISE; -import static android.Manifest.permission.BLUETOOTH_CONNECT; import static android.Manifest.permission.BLUETOOTH_PRIVILEGED; import android.annotation.NonNull; @@ -93,13 +92,21 @@ public final class BluetoothLeAdvertiser { * Start Bluetooth LE Advertising. On success, the {@code advertiseData} will be broadcasted. * Returns immediately, the operation status is delivered through {@code callback}. * + * <p>Requires the {@link android.Manifest.permission#BLUETOOTH_PRIVILEGED} permission only when + * {@code settings.getOwnAddressType()} is different from {@code + * AdvertisingSetParameters.ADDRESS_TYPE_DEFAULT}. + * + * <p>The {@link android.Manifest.permission#BLUETOOTH_ADVERTISE} permission is always enforced. + * * @param settings Settings for Bluetooth LE advertising. * @param advertiseData Advertisement data to be broadcasted. * @param callback Callback for advertising status. */ @RequiresLegacyBluetoothAdminPermission @RequiresBluetoothAdvertisePermission - @RequiresPermission(BLUETOOTH_ADVERTISE) + @RequiresPermission( + allOf = {BLUETOOTH_ADVERTISE, BLUETOOTH_PRIVILEGED}, + conditional = true) public void startAdvertising( AdvertiseSettings settings, AdvertiseData advertiseData, @@ -113,6 +120,12 @@ public final class BluetoothLeAdvertiser { * active scan request. This method returns immediately, the operation status is delivered * through {@code callback}. * + * <p>Requires the {@link android.Manifest.permission#BLUETOOTH_PRIVILEGED} permission only when + * {@code settings.getOwnAddressType()} is different from {@code + * AdvertisingSetParameters.ADDRESS_TYPE_DEFAULT}. + * + * <p>The {@link android.Manifest.permission#BLUETOOTH_ADVERTISE} permission is always enforced. + * * @param settings Settings for Bluetooth LE advertising. * @param advertiseData Advertisement data to be advertised in advertisement packet. * @param scanResponse Scan response associated with the advertisement data. @@ -120,7 +133,9 @@ public final class BluetoothLeAdvertiser { */ @RequiresLegacyBluetoothAdminPermission @RequiresBluetoothAdvertisePermission - @RequiresPermission(BLUETOOTH_ADVERTISE) + @RequiresPermission( + allOf = {BLUETOOTH_ADVERTISE, BLUETOOTH_PRIVILEGED}, + conditional = true) public void startAdvertising( AdvertiseSettings settings, AdvertiseData advertiseData, @@ -254,7 +269,11 @@ public final class BluetoothLeAdvertiser { * method returns immediately, the operation status is delivered through {@code * callback.onAdvertisingSetStarted()}. * - * <p> + * <p>Requires the {@link android.Manifest.permission#BLUETOOTH_PRIVILEGED} permission only when + * {@code parameters.getOwnAddressType()} is different from {@code + * AdvertisingSetParameters.ADDRESS_TYPE_DEFAULT}. + * + * <p>The {@link android.Manifest.permission#BLUETOOTH_ADVERTISE} permission is always enforced. * * @param parameters advertising set parameters. * @param advertiseData Advertisement data to be broadcasted. Size must not exceed {@link @@ -272,8 +291,9 @@ public final class BluetoothLeAdvertiser { * Advertising feature is made when it's not supported by the controller. */ @RequiresLegacyBluetoothAdminPermission - @RequiresBluetoothAdvertisePermission - @RequiresPermission(BLUETOOTH_ADVERTISE) + @RequiresPermission( + allOf = {BLUETOOTH_ADVERTISE, BLUETOOTH_PRIVILEGED}, + conditional = true) public void startAdvertisingSet( AdvertisingSetParameters parameters, AdvertiseData advertiseData, @@ -298,7 +318,11 @@ public final class BluetoothLeAdvertiser { * method returns immediately, the operation status is delivered through {@code * callback.onAdvertisingSetStarted()}. * - * <p> + * <p>Requires the {@link android.Manifest.permission#BLUETOOTH_PRIVILEGED} permission only when + * {@code parameters.getOwnAddressType()} is different from {@code + * AdvertisingSetParameters.ADDRESS_TYPE_DEFAULT}. + * + * <p>The {@link android.Manifest.permission#BLUETOOTH_ADVERTISE} permission is always enforced. * * @param parameters advertising set parameters. * @param advertiseData Advertisement data to be broadcasted. Size must not exceed {@link @@ -318,7 +342,9 @@ public final class BluetoothLeAdvertiser { */ @RequiresLegacyBluetoothAdminPermission @RequiresBluetoothAdvertisePermission - @RequiresPermission(BLUETOOTH_ADVERTISE) + @RequiresPermission( + allOf = {BLUETOOTH_ADVERTISE, BLUETOOTH_PRIVILEGED}, + conditional = true) public void startAdvertisingSet( AdvertisingSetParameters parameters, AdvertiseData advertiseData, @@ -344,7 +370,11 @@ public final class BluetoothLeAdvertiser { * method returns immediately, the operation status is delivered through {@code * callback.onAdvertisingSetStarted()}. * - * <p> + * <p>Requires the {@link android.Manifest.permission#BLUETOOTH_PRIVILEGED} permission only when + * {@code parameters.getOwnAddressType()} is different from {@code + * AdvertisingSetParameters.ADDRESS_TYPE_DEFAULT}. + * + * <p>The {@link android.Manifest.permission#BLUETOOTH_ADVERTISE} permission is always enforced. * * @param parameters advertising set parameters. * @param advertiseData Advertisement data to be broadcasted. Size must not exceed {@link @@ -368,7 +398,9 @@ public final class BluetoothLeAdvertiser { */ @RequiresLegacyBluetoothAdminPermission @RequiresBluetoothAdvertisePermission - @RequiresPermission(BLUETOOTH_ADVERTISE) + @RequiresPermission( + allOf = {BLUETOOTH_ADVERTISE, BLUETOOTH_PRIVILEGED}, + conditional = true) public void startAdvertisingSet( AdvertisingSetParameters parameters, AdvertiseData advertiseData, @@ -395,7 +427,11 @@ public final class BluetoothLeAdvertiser { * method returns immediately, the operation status is delivered through {@code * callback.onAdvertisingSetStarted()}. * - * <p> + * <p>Requires the {@link android.Manifest.permission#BLUETOOTH_PRIVILEGED} permission only when + * {@code parameters.getOwnAddressType()} is different from {@code + * AdvertisingSetParameters.ADDRESS_TYPE_DEFAULT}. + * + * <p>The {@link android.Manifest.permission#BLUETOOTH_ADVERTISE} permission is always enforced. * * @param parameters Advertising set parameters. * @param advertiseData Advertisement data to be broadcasted. Size must not exceed {@link @@ -422,7 +458,9 @@ public final class BluetoothLeAdvertiser { */ @RequiresLegacyBluetoothAdminPermission @RequiresBluetoothAdvertisePermission - @RequiresPermission(BLUETOOTH_ADVERTISE) + @RequiresPermission( + allOf = {BLUETOOTH_ADVERTISE, BLUETOOTH_PRIVILEGED}, + conditional = true) public void startAdvertisingSet( AdvertisingSetParameters parameters, AdvertiseData advertiseData, @@ -455,6 +493,13 @@ public final class BluetoothLeAdvertiser { * services/characteristics in this server, rather than the union of all GATT services (across * all opened servers). * + * <p>Requires the {@link android.Manifest.permission#BLUETOOTH_PRIVILEGED} permission only when + * {@code parameters.getOwnAddressType()} is different from {@code + * AdvertisingSetParameters.ADDRESS_TYPE_DEFAULT} or when the {@code gattServer} is already + * registered + * + * <p>The {@link android.Manifest.permission#BLUETOOTH_ADVERTISE} permission is always enforced. + * * @param parameters Advertising set parameters. * @param advertiseData Advertisement data to be broadcasted. Size must not exceed {@link * BluetoothAdapter#getLeMaximumAdvertisingDataLength}. If the advertisement is connectable, @@ -485,11 +530,8 @@ public final class BluetoothLeAdvertiser { @SuppressLint("ExecutorRegistration") @RequiresBluetoothAdvertisePermission @RequiresPermission( - allOf = { - BLUETOOTH_PRIVILEGED, - BLUETOOTH_ADVERTISE, - BLUETOOTH_CONNECT, - }) + allOf = {BLUETOOTH_ADVERTISE, BLUETOOTH_PRIVILEGED}, + conditional = true) public void startAdvertisingSet( @NonNull AdvertisingSetParameters parameters, @Nullable AdvertiseData advertiseData, diff --git a/framework/java/android/bluetooth/le/BluetoothLeScanner.java b/framework/java/android/bluetooth/le/BluetoothLeScanner.java index 7991000ca1..f0435d0239 100644 --- a/framework/java/android/bluetooth/le/BluetoothLeScanner.java +++ b/framework/java/android/bluetooth/le/BluetoothLeScanner.java @@ -16,7 +16,6 @@ package android.bluetooth.le; -import static android.Manifest.permission.BLUETOOTH_CONNECT; import static android.Manifest.permission.BLUETOOTH_SCAN; import static android.Manifest.permission.UPDATE_DEVICE_STATS; @@ -713,7 +712,7 @@ public final class BluetoothLeScanner { return true; } - @RequiresPermission(BLUETOOTH_CONNECT) + @RequiresPermission(BLUETOOTH_SCAN) private boolean isHardwareResourcesAvailableForScan(ScanSettings settings) { final int callbackType = settings.getCallbackType(); if ((callbackType & ScanSettings.CALLBACK_TYPE_FIRST_MATCH) != 0 diff --git a/framework/java/android/bluetooth/le/PeriodicAdvertisingManager.java b/framework/java/android/bluetooth/le/PeriodicAdvertisingManager.java index 93e1cf8522..7df1bf76fc 100644 --- a/framework/java/android/bluetooth/le/PeriodicAdvertisingManager.java +++ b/framework/java/android/bluetooth/le/PeriodicAdvertisingManager.java @@ -222,6 +222,7 @@ public final class PeriodicAdvertisingManager { * * @hide */ + @RequiresPermission(android.Manifest.permission.BLUETOOTH_SCAN) public void transferSync(BluetoothDevice bda, int serviceData, int syncHandle) { if (Flags.scanManagerRefactor()) { IBluetoothScan scan = mBluetoothAdapter.getBluetoothScan(); @@ -247,6 +248,7 @@ public final class PeriodicAdvertisingManager { * * @hide */ + @RequiresPermission(android.Manifest.permission.BLUETOOTH_SCAN) public void transferSetInfo( BluetoothDevice bda, int serviceData, @@ -260,6 +262,7 @@ public final class PeriodicAdvertisingManager { * * @hide */ + @RequiresPermission(android.Manifest.permission.BLUETOOTH_SCAN) public void transferSetInfo( BluetoothDevice bda, int serviceData, diff --git a/framework/java/android/bluetooth/le/ScanFilter.java b/framework/java/android/bluetooth/le/ScanFilter.java index 20ef64bf97..c3edbdfdfd 100644 --- a/framework/java/android/bluetooth/le/ScanFilter.java +++ b/framework/java/android/bluetooth/le/ScanFilter.java @@ -225,6 +225,7 @@ public final class ScanFilter implements Parcelable { } @Override + @RequiresPermission(allOf = {BLUETOOTH_SCAN, BLUETOOTH_PRIVILEGED}) public ScanFilter createFromParcel(Parcel in) { Builder builder = new Builder(); if (in.readInt() == 1) { diff --git a/framework/java/android/bluetooth/le/ScanSettings.java b/framework/java/android/bluetooth/le/ScanSettings.java index ac0179b7ec..44364e0286 100644 --- a/framework/java/android/bluetooth/le/ScanSettings.java +++ b/framework/java/android/bluetooth/le/ScanSettings.java @@ -465,4 +465,30 @@ public final class ScanSettings implements Parcelable { mPhy); } } + + /** + * Converts scan mode integer into string. For internal use only when logging. + * + * @hide + */ + public static String getScanModeString(int scanMode) { + switch (scanMode) { + case SCAN_MODE_OPPORTUNISTIC: + return "SCAN_MODE_OPPORTUNISTIC"; + case SCAN_MODE_LOW_POWER: + return "SCAN_MODE_LOW_POWER"; + case SCAN_MODE_BALANCED: + return "SCAN_MODE_BALANCED"; + case SCAN_MODE_LOW_LATENCY: + return "SCAN_MODE_LOW_LATENCY"; + case SCAN_MODE_AMBIENT_DISCOVERY: + return "SCAN_MODE_AMBIENT_DISCOVERY"; + case SCAN_MODE_SCREEN_OFF: + return "SCAN_MODE_SCREEN_OFF"; + case SCAN_MODE_SCREEN_OFF_BALANCED: + return "SCAN_MODE_SCREEN_OFF_BALANCED"; + default: + return "UNKNOWN value=" + scanMode; + } + } } diff --git a/framework/tests/bumble/AndroidTest.xml b/framework/tests/bumble/AndroidTest.xml index 1b31b827e2..4855fec134 100644 --- a/framework/tests/bumble/AndroidTest.xml +++ b/framework/tests/bumble/AndroidTest.xml @@ -42,6 +42,7 @@ <option name="test-tag" value="BumbleBluetoothTests" /> <test class="com.android.tradefed.testtype.AndroidJUnitTest" > <option name="package" value="android.bluetooth" /> + <option name="hidden-api-checks" value="false" /> </test> <!-- Only run if the Bluetooth Mainline module is installed. --> diff --git a/framework/tests/bumble/src/android/bluetooth/RfcommTest.kt b/framework/tests/bumble/src/android/bluetooth/RfcommTest.kt index b5f2a68c8b..31c1314cb4 100644 --- a/framework/tests/bumble/src/android/bluetooth/RfcommTest.kt +++ b/framework/tests/bumble/src/android/bluetooth/RfcommTest.kt @@ -18,7 +18,6 @@ package android.bluetooth import android.Manifest import android.content.Context import androidx.test.core.app.ApplicationProvider -import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.platform.app.InstrumentationRegistry import com.android.compatibility.common.util.AdoptShellPermissionsRule import com.google.common.truth.Truth @@ -30,14 +29,16 @@ import kotlinx.coroutines.* import kotlinx.coroutines.channels.* import org.junit.After import org.junit.Before +import org.junit.Ignore import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith +import org.junit.runners.JUnit4 import pandora.RfcommProto import pandora.RfcommProto.ServerId import pandora.RfcommProto.StartServerRequest -@RunWith(AndroidJUnit4::class) +@RunWith(JUnit4::class) @kotlinx.coroutines.ExperimentalCoroutinesApi class RfcommTest { private val mContext = ApplicationProvider.getApplicationContext<Context>() @@ -77,16 +78,19 @@ class RfcommTest { } @Test + @Ignore("b/355328584") fun clientConnectToOpenServerSocketBondedInsecure() { startServer { serverId -> createConnectAcceptSocket(isSecure = false, serverId) } } @Test + @Ignore("b/355328584") fun clientConnectToOpenServerSocketBondedSecure() { startServer { serverId -> createConnectAcceptSocket(isSecure = true, serverId) } } @Test + @Ignore("b/355328584") fun clientSendDataOverInsecureSocket() { startServer { serverId -> val (insecureSocket, connection) = createConnectAcceptSocket(isSecure = false, serverId) @@ -104,6 +108,7 @@ class RfcommTest { } @Test + @Ignore("b/355328584") fun clientSendDataOverSecureSocket() { startServer { serverId -> val (secureSocket, connection) = createConnectAcceptSocket(isSecure = true, serverId) @@ -121,6 +126,7 @@ class RfcommTest { } @Test + @Ignore("b/355328584") fun clientReceiveDataOverInsecureSocket() { startServer { serverId -> val (insecureSocket, connection) = createConnectAcceptSocket(isSecure = false, serverId) @@ -139,6 +145,7 @@ class RfcommTest { } @Test + @Ignore("b/355328584") fun clientReceiveDataOverSecureSocket() { startServer { serverId -> val (secureSocket, connection) = createConnectAcceptSocket(isSecure = true, serverId) diff --git a/framework/tests/bumble/src/android/bluetooth/hid/HidHostDualModeTest.java b/framework/tests/bumble/src/android/bluetooth/hid/HidHostDualModeTest.java new file mode 100644 index 0000000000..916966f0aa --- /dev/null +++ b/framework/tests/bumble/src/android/bluetooth/hid/HidHostDualModeTest.java @@ -0,0 +1,413 @@ +/* + * Copyright (C) 2024 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.bluetooth; + +import static com.google.common.truth.Truth.assertThat; + +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import android.content.IntentFilter; +import android.os.ParcelUuid; +import android.platform.test.annotations.RequiresFlagsEnabled; +import android.platform.test.flag.junit.CheckFlagsRule; +import android.platform.test.flag.junit.DeviceFlagsValueProvider; +import android.util.Log; + +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import com.android.bluetooth.flags.Flags; +import com.android.compatibility.common.util.AdoptShellPermissionsRule; + +import com.google.common.util.concurrent.SettableFuture; + +import org.junit.After; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; + +import pandora.HostProto.AdvertiseRequest; +import pandora.HostProto.OwnAddressType; + +/** Test cases for {@link Hid Host}. */ +@RunWith(AndroidJUnit4.class) +public class HidHostDualModeTest { + private static final String TAG = "HidHostDualModeTest"; + private SettableFuture<Integer> mFutureConnectionIntent, + mFutureBondIntent, + mFutureHandShakeIntent, + mFutureReportIntent, + mFutureProtocolModeIntent, + mFutureTransportIntent; + private SettableFuture<Boolean> mFutureHogpServiceIntent; + private BluetoothDevice mDevice; + private BluetoothHidHost mHidService; + private BluetoothHeadset mHfpService; + private BluetoothA2dp mA2dpService; + private final Context mContext = ApplicationProvider.getApplicationContext(); + private final BluetoothManager mManager = mContext.getSystemService(BluetoothManager.class); + private final BluetoothAdapter mAdapter = mManager.getAdapter(); + private byte mReportId; + private static final int KEYBD_RPT_ID = 1; + private static final int KEYBD_RPT_SIZE = 9; + private static final int MOUSE_RPT_ID = 2; + private static final int MOUSE_RPT_SIZE = 4; + + @Rule(order = 0) + public final CheckFlagsRule mCheckFlagsRule = DeviceFlagsValueProvider.createCheckFlagsRule(); + + @Rule(order = 1) + public final AdoptShellPermissionsRule mPermissionRule = new AdoptShellPermissionsRule(); + + @Rule(order = 2) + public final PandoraDevice mBumble = new PandoraDevice(); + + private BroadcastReceiver mHidStateReceiver = + new BroadcastReceiver() { + @Override + public void onReceive(Context context, Intent intent) { + switch (intent.getAction()) { + case BluetoothHidHost.ACTION_CONNECTION_STATE_CHANGED: + int state = + intent.getIntExtra( + BluetoothProfile.EXTRA_STATE, BluetoothAdapter.ERROR); + int transport = + intent.getIntExtra( + BluetoothDevice.EXTRA_TRANSPORT, + BluetoothDevice.TRANSPORT_AUTO); + Log.i( + TAG, + "Connection state change: " + + state + + "transport: " + + transport); + if (state == BluetoothProfile.STATE_CONNECTED + || state == BluetoothProfile.STATE_DISCONNECTED) { + if (mFutureConnectionIntent != null) { + mFutureConnectionIntent.set(state); + } + if (state == BluetoothProfile.STATE_CONNECTED + && mFutureTransportIntent != null) { + mFutureTransportIntent.set(transport); + } + } + break; + case BluetoothDevice.ACTION_PAIRING_REQUEST: + mBumble.getRemoteDevice().setPairingConfirmation(true); + break; + case BluetoothDevice.ACTION_BOND_STATE_CHANGED: + int bondState = + intent.getIntExtra( + BluetoothDevice.EXTRA_BOND_STATE, + BluetoothDevice.ERROR); + Log.i(TAG, "Bond state change:" + bondState); + if (bondState == BluetoothDevice.BOND_BONDED + || bondState == BluetoothDevice.BOND_NONE) { + if (mFutureBondIntent != null) { + mFutureBondIntent.set(bondState); + } + } + break; + case BluetoothDevice.ACTION_UUID: + ParcelUuid[] parcelUuids = + intent.getParcelableArrayExtra( + BluetoothDevice.EXTRA_UUID, ParcelUuid.class); + for (int i = 0; i < parcelUuids.length; i++) { + Log.d(TAG, "UUIDs : index=" + i + " uuid=" + parcelUuids[i]); + if (parcelUuids[i].equals(BluetoothUuid.HOGP)) { + if (mFutureHogpServiceIntent != null) { + mFutureHogpServiceIntent.set(true); + } + } + } + break; + case BluetoothHidHost.ACTION_PROTOCOL_MODE_CHANGED: + int protocolMode = + intent.getIntExtra( + BluetoothHidHost.EXTRA_PROTOCOL_MODE, + BluetoothHidHost.PROTOCOL_UNSUPPORTED_MODE); + Log.i(TAG, "Protocol mode:" + protocolMode); + if (mFutureProtocolModeIntent != null) { + mFutureProtocolModeIntent.set(protocolMode); + } + break; + case BluetoothHidHost.ACTION_HANDSHAKE: + int handShake = + intent.getIntExtra( + BluetoothHidHost.EXTRA_STATUS, + BluetoothHidDevice.ERROR_RSP_UNKNOWN); + Log.i(TAG, "Handshake status:" + handShake); + if (mFutureHandShakeIntent != null) { + mFutureHandShakeIntent.set(handShake); + } + break; + case BluetoothHidHost.ACTION_REPORT: + byte[] report = intent.getByteArrayExtra(BluetoothHidHost.EXTRA_REPORT); + int reportSize = + intent.getIntExtra( + BluetoothHidHost.EXTRA_REPORT_BUFFER_SIZE, 0); + mReportId = report[0]; + if (mFutureReportIntent != null) { + mFutureReportIntent.set((reportSize - 1)); + } + break; + default: + break; + } + } + }; + + // These callbacks run on the main thread. + private final BluetoothProfile.ServiceListener mBluetoothProfileServiceListener = + new BluetoothProfile.ServiceListener() { + + @Override + public void onServiceConnected(int profile, BluetoothProfile proxy) { + switch (profile) { + case BluetoothProfile.HEADSET: + mHfpService = (BluetoothHeadset) proxy; + break; + case BluetoothProfile.A2DP: + mA2dpService = (BluetoothA2dp) proxy; + break; + case BluetoothProfile.HID_HOST: + mHidService = (BluetoothHidHost) proxy; + break; + default: + break; + } + } + + @Override + public void onServiceDisconnected(int profile) {} + }; + + @Before + public void setUp() throws Exception { + final IntentFilter filter = new IntentFilter(); + filter.addAction(BluetoothHidHost.ACTION_CONNECTION_STATE_CHANGED); + filter.addAction(BluetoothDevice.ACTION_BOND_STATE_CHANGED); + filter.addAction(BluetoothDevice.ACTION_PAIRING_REQUEST); + filter.addAction(BluetoothDevice.ACTION_UUID); + filter.addAction(BluetoothHidHost.ACTION_PROTOCOL_MODE_CHANGED); + filter.addAction(BluetoothHidHost.ACTION_HANDSHAKE); + filter.addAction(BluetoothHidHost.ACTION_REPORT); + mContext.registerReceiver(mHidStateReceiver, filter); + mAdapter.getProfileProxy( + mContext, mBluetoothProfileServiceListener, BluetoothProfile.HID_HOST); + mAdapter.getProfileProxy(mContext, mBluetoothProfileServiceListener, BluetoothProfile.A2DP); + mAdapter.getProfileProxy( + mContext, mBluetoothProfileServiceListener, BluetoothProfile.HEADSET); + AdvertiseRequest request = + AdvertiseRequest.newBuilder() + .setLegacy(true) + .setConnectable(true) + .setOwnAddressType(OwnAddressType.RANDOM) + .build(); + mBumble.hostBlocking().advertise(request); + + mFutureConnectionIntent = SettableFuture.create(); + + mDevice = mBumble.getRemoteDevice(); + mFutureBondIntent = SettableFuture.create(); + assertThat(mDevice.createBond()).isTrue(); + assertThat(mFutureBondIntent.get()).isEqualTo(BluetoothDevice.BOND_BONDED); + if (mA2dpService != null + && mA2dpService.getConnectionPolicy(mDevice) + == BluetoothProfile.CONNECTION_POLICY_ALLOWED) { + assertThat( + mA2dpService.setConnectionPolicy( + mDevice, BluetoothProfile.CONNECTION_POLICY_FORBIDDEN)) + .isTrue(); + } + if (mHfpService != null + && mHfpService.getConnectionPolicy(mDevice) + == BluetoothProfile.CONNECTION_POLICY_ALLOWED) { + assertThat( + mHfpService.setConnectionPolicy( + mDevice, BluetoothProfile.CONNECTION_POLICY_FORBIDDEN)) + .isTrue(); + } + assertThat(mFutureConnectionIntent.get()).isEqualTo(BluetoothProfile.STATE_CONNECTED); + mFutureHogpServiceIntent = SettableFuture.create(); + assertThat(mFutureHogpServiceIntent.get()).isTrue(); + assertThat(mHidService.getPreferredTransport(mDevice)) + .isEqualTo(BluetoothDevice.TRANSPORT_BREDR); + // LE transport + mFutureTransportIntent = SettableFuture.create(); + mHidService.setPreferredTransport(mDevice, BluetoothDevice.TRANSPORT_LE); + // Verifies BREDR transport Disconnected + mFutureConnectionIntent = SettableFuture.create(); + assertThat(mFutureConnectionIntent.get()).isEqualTo(BluetoothProfile.STATE_DISCONNECTED); + + assertThat(mFutureTransportIntent.get()).isEqualTo(BluetoothDevice.TRANSPORT_LE); + assertThat(mHidService.getPreferredTransport(mDevice)) + .isEqualTo(BluetoothDevice.TRANSPORT_LE); + } + + @After + public void tearDown() throws Exception { + if (mDevice.getBondState() == BluetoothDevice.BOND_BONDED) { + mFutureBondIntent = SettableFuture.create(); + mDevice.removeBond(); + assertThat(mFutureBondIntent.get()).isEqualTo(BluetoothDevice.BOND_NONE); + } + mContext.unregisterReceiver(mHidStateReceiver); + } + + /** + * Test HID Preferred transport selection Test case + * + * <ol> + * <li>1. Android to creates bonding and HID connected with default transport. + * <li>2. Android switch the transport to LE and Verifies the transport + * <li>3. Android switch the transport to BR/EDR and Verifies the transport + * </ol> + */ + @Test + @RequiresFlagsEnabled({ + Flags.FLAG_ALLOW_SWITCHING_HID_AND_HOGP, + Flags.FLAG_SAVE_INITIAL_HID_CONNECTION_POLICY + }) + public void setPreferredTransportTest() throws Exception { + + // BREDR transport + mFutureTransportIntent = SettableFuture.create(); + mHidService.setPreferredTransport(mDevice, BluetoothDevice.TRANSPORT_BREDR); + // Verifies LE transport Disconnected + mFutureConnectionIntent = SettableFuture.create(); + assertThat(mFutureConnectionIntent.get()).isEqualTo(BluetoothProfile.STATE_DISCONNECTED); + + assertThat(mFutureTransportIntent.get()).isEqualTo(BluetoothDevice.TRANSPORT_BREDR); + assertThat(mHidService.getPreferredTransport(mDevice)) + .isEqualTo(BluetoothDevice.TRANSPORT_BREDR); + } + + /** + * Test Get Report + * + * <ol> + * <li>1. Android creates bonding and connect the HID Device + * <li>2. Android get report and verifies the report + * </ol> + */ + @Test + @RequiresFlagsEnabled({ + Flags.FLAG_ALLOW_SWITCHING_HID_AND_HOGP, + Flags.FLAG_SAVE_INITIAL_HID_CONNECTION_POLICY + }) + public void hogpGetReportTest() throws Exception { + + // Keyboard report + byte id = KEYBD_RPT_ID; + mHidService.getReport(mDevice, BluetoothHidHost.REPORT_TYPE_INPUT, id, (int) 0); + mFutureReportIntent = SettableFuture.create(); + assertThat(mFutureReportIntent.get()).isEqualTo(KEYBD_RPT_SIZE); + assertThat(mReportId).isEqualTo(KEYBD_RPT_ID); + + // Mouse report + id = MOUSE_RPT_ID; + mHidService.getReport(mDevice, BluetoothHidHost.REPORT_TYPE_INPUT, id, (int) 0); + mFutureReportIntent = SettableFuture.create(); + assertThat(mFutureReportIntent.get()).isEqualTo(MOUSE_RPT_SIZE); + assertThat(mReportId).isEqualTo(MOUSE_RPT_ID); + } + + /** + * Test Get Protocol mode + * + * <ol> + * <li>1. Android creates bonding and connect the HID Device + * <li>2. Android Gets the Protocol mode and verifies the mode + * </ol> + */ + @Test + @RequiresFlagsEnabled({ + Flags.FLAG_ALLOW_SWITCHING_HID_AND_HOGP, + Flags.FLAG_SAVE_INITIAL_HID_CONNECTION_POLICY + }) + public void hogpGetProtocolModeTest() throws Exception { + mHidService.getProtocolMode(mDevice); + mFutureProtocolModeIntent = SettableFuture.create(); + assertThat(mFutureProtocolModeIntent.get()) + .isEqualTo(BluetoothHidHost.PROTOCOL_REPORT_MODE); + } + + /** + * Test Set Protocol mode + * + * <ol> + * <li>1. Android creates bonding and connect the HID Device + * <li>2. Android Sets the Protocol mode and verifies the mode + * </ol> + */ + @Test + @RequiresFlagsEnabled({ + Flags.FLAG_ALLOW_SWITCHING_HID_AND_HOGP, + Flags.FLAG_SAVE_INITIAL_HID_CONNECTION_POLICY + }) + public void hogpSetProtocolModeTest() throws Exception { + mHidService.setProtocolMode(mDevice, BluetoothHidHost.PROTOCOL_BOOT_MODE); + mFutureHandShakeIntent = SettableFuture.create(); + assertThat(mFutureHandShakeIntent.get()).isEqualTo(BluetoothHidDevice.ERROR_RSP_SUCCESS); + } + + /** + * Test Set Report + * + * <ol> + * <li>1. Android creates bonding and connect the HID Device + * <li>2. Android Set report and verifies the report + * </ol> + */ + @Test + @RequiresFlagsEnabled({ + Flags.FLAG_ALLOW_SWITCHING_HID_AND_HOGP, + Flags.FLAG_SAVE_INITIAL_HID_CONNECTION_POLICY + }) + public void hogpSetReportTest() throws Exception { + // Keyboard report + mHidService.setReport(mDevice, BluetoothHidHost.REPORT_TYPE_INPUT, "010203040506070809"); + mFutureHandShakeIntent = SettableFuture.create(); + assertThat(mFutureHandShakeIntent.get()).isEqualTo(BluetoothHidDevice.ERROR_RSP_SUCCESS); + // Mouse report + mHidService.setReport(mDevice, BluetoothHidHost.REPORT_TYPE_INPUT, "02030405"); + mFutureHandShakeIntent = SettableFuture.create(); + assertThat(mFutureHandShakeIntent.get()).isEqualTo(BluetoothHidDevice.ERROR_RSP_SUCCESS); + } + + /** + * Test Virtual Unplug from Hid Host + * + * <ol> + * <li>1. Android creates bonding and connect the HID Device + * <li>2. Android Virtual Unplug and verifies Bonding + * </ol> + */ + @Test + @RequiresFlagsEnabled({ + Flags.FLAG_ALLOW_SWITCHING_HID_AND_HOGP, + Flags.FLAG_SAVE_INITIAL_HID_CONNECTION_POLICY + }) + public void hogpVirtualUnplugFromHidHostTest() throws Exception { + mHidService.virtualUnplug(mDevice); + mFutureBondIntent = SettableFuture.create(); + assertThat(mFutureBondIntent.get()).isEqualTo(BluetoothDevice.BOND_NONE); + } +} diff --git a/framework/tests/bumble/src/android/bluetooth/hid/HidHostTest.java b/framework/tests/bumble/src/android/bluetooth/hid/HidHostTest.java index 4166d4b3e2..4e11e4d4af 100644 --- a/framework/tests/bumble/src/android/bluetooth/hid/HidHostTest.java +++ b/framework/tests/bumble/src/android/bluetooth/hid/HidHostTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2023 The Android Open Source Project + * Copyright (C) 2024 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -44,7 +44,11 @@ import org.junit.Test; import org.junit.runner.RunWith; import pandora.HIDGrpc; +import pandora.HidProto.ProtocolModeEvent; +import pandora.HidProto.ReportEvent; +import java.time.Duration; +import java.util.Iterator; import java.util.concurrent.CompletableFuture; import java.util.concurrent.TimeUnit; @@ -55,7 +59,11 @@ public class HidHostTest { private static final String TAG = "HidHostTest"; private SettableFuture<Integer> mFutureConnectionIntent, mFutureAdapterStateIntent, - mFutureBondIntent; + mFutureBondIntent, + mFutureHandShakeIntent, + mFutureProtocolModeIntent, + mFutureVirtualUnplugIntent, + mFutureReportIntent; private SettableFuture<Boolean> mAclConnectionIntent; private BluetoothDevice mDevice; private BluetoothHidHost mHidService; @@ -65,8 +73,16 @@ public class HidHostTest { private final BluetoothManager mManager = mContext.getSystemService(BluetoothManager.class); private final BluetoothAdapter mAdapter = mManager.getAdapter(); private HIDGrpc.HIDBlockingStub mHidBlockingStub; + private byte mReportId; + private static final int KEYBD_RPT_ID = 1; + private static final int KEYBD_RPT_SIZE = 9; + private static final int MOUSE_RPT_ID = 2; + private static final int MOUSE_RPT_SIZE = 4; + private static final int INVALID_RPT_ID = 3; private static final int CONNECTION_TIMEOUT_MS = 2_000; + private static final Duration PROTO_MODE_TIMEOUT = Duration.ofSeconds(10); + @Rule(order = 0) public final CheckFlagsRule mCheckFlagsRule = DeviceFlagsValueProvider.createCheckFlagsRule(); @@ -76,51 +92,98 @@ public class HidHostTest { @Rule(order = 2) public final PandoraDevice mBumble = new PandoraDevice(); - private BroadcastReceiver mConnectionStateReceiver = + private BroadcastReceiver mHidStateReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { - if (BluetoothHidHost.ACTION_CONNECTION_STATE_CHANGED.equals( - intent.getAction())) { - int state = - intent.getIntExtra( - BluetoothProfile.EXTRA_STATE, BluetoothAdapter.ERROR); - Log.i(TAG, "Connection state change:" + state); - if (state == BluetoothProfile.STATE_CONNECTED - || state == BluetoothProfile.STATE_DISCONNECTED) { - if (mFutureConnectionIntent != null) { - mFutureConnectionIntent.set(state); + switch (intent.getAction()) { + case BluetoothHidHost.ACTION_CONNECTION_STATE_CHANGED: + int state = + intent.getIntExtra( + BluetoothProfile.EXTRA_STATE, BluetoothAdapter.ERROR); + Log.i(TAG, "Connection state change:" + state); + if (state == BluetoothProfile.STATE_CONNECTED + || state == BluetoothProfile.STATE_DISCONNECTED) { + if (mFutureConnectionIntent != null) { + mFutureConnectionIntent.set(state); + } + } + break; + case BluetoothDevice.ACTION_PAIRING_REQUEST: + mBumble.getRemoteDevice().setPairingConfirmation(true); + break; + case BluetoothAdapter.ACTION_STATE_CHANGED: + int adapterState = + intent.getIntExtra( + BluetoothAdapter.EXTRA_STATE, BluetoothAdapter.ERROR); + Log.i(TAG, "Adapter state change:" + adapterState); + if (adapterState == BluetoothAdapter.STATE_ON + || adapterState == BluetoothAdapter.STATE_OFF) { + if (mFutureAdapterStateIntent != null) { + mFutureAdapterStateIntent.set(adapterState); + } + } + break; + case BluetoothDevice.ACTION_BOND_STATE_CHANGED: + int bondState = + intent.getIntExtra( + BluetoothDevice.EXTRA_BOND_STATE, + BluetoothDevice.ERROR); + Log.i(TAG, "Bond state change:" + bondState); + if (bondState == BluetoothDevice.BOND_BONDED + || bondState == BluetoothDevice.BOND_NONE) { + if (mFutureBondIntent != null) { + mFutureBondIntent.set(bondState); + } + } + break; + case BluetoothHidHost.ACTION_PROTOCOL_MODE_CHANGED: + int protocolMode = + intent.getIntExtra( + BluetoothHidHost.EXTRA_PROTOCOL_MODE, + BluetoothHidHost.PROTOCOL_UNSUPPORTED_MODE); + Log.i(TAG, "Protocol mode:" + protocolMode); + if (mFutureProtocolModeIntent != null) { + mFutureProtocolModeIntent.set(protocolMode); + } + break; + case BluetoothHidHost.ACTION_HANDSHAKE: + int handShake = + intent.getIntExtra( + BluetoothHidHost.EXTRA_STATUS, + BluetoothHidDevice.ERROR_RSP_UNKNOWN); + Log.i(TAG, "Handshake status:" + handShake); + if (mFutureHandShakeIntent != null) { + mFutureHandShakeIntent.set(handShake); + } + break; + case BluetoothHidHost.ACTION_VIRTUAL_UNPLUG_STATUS: + int virtualUnplug = + intent.getIntExtra( + BluetoothHidHost.EXTRA_VIRTUAL_UNPLUG_STATUS, + BluetoothHidHost.VIRTUAL_UNPLUG_STATUS_FAIL); + Log.i(TAG, "Virtual Unplug status:" + virtualUnplug); + if (mFutureVirtualUnplugIntent != null) { + mFutureVirtualUnplugIntent.set(virtualUnplug); } - } - } else if (BluetoothDevice.ACTION_PAIRING_REQUEST.equals(intent.getAction())) { - mBumble.getRemoteDevice().setPairingConfirmation(true); - } else if (BluetoothAdapter.ACTION_STATE_CHANGED.equals(intent.getAction())) { - int adapterState = - intent.getIntExtra( - BluetoothAdapter.EXTRA_STATE, BluetoothAdapter.ERROR); - Log.i(TAG, "Adapter state change:" + adapterState); - if (adapterState == BluetoothAdapter.STATE_ON - || adapterState == BluetoothAdapter.STATE_OFF) { - if (mFutureAdapterStateIntent != null) { - mFutureAdapterStateIntent.set(adapterState); + break; + case BluetoothHidHost.ACTION_REPORT: + byte[] report = intent.getByteArrayExtra(BluetoothHidHost.EXTRA_REPORT); + int reportSize = + intent.getIntExtra( + BluetoothHidHost.EXTRA_REPORT_BUFFER_SIZE, 0); + mReportId = report[0]; + if (mFutureReportIntent != null) { + mFutureReportIntent.set((reportSize - 1)); } - } - } else if (BluetoothDevice.ACTION_BOND_STATE_CHANGED.equals( - intent.getAction())) { - int bondState = - intent.getIntExtra( - BluetoothDevice.EXTRA_BOND_STATE, BluetoothDevice.ERROR); - Log.i(TAG, "Bond state change:" + bondState); - if (bondState == BluetoothDevice.BOND_BONDED - || bondState == BluetoothDevice.BOND_NONE) { - if (mFutureBondIntent != null) { - mFutureBondIntent.set(bondState); + break; + case BluetoothDevice.ACTION_ACL_DISCONNECTED: + if (mAclConnectionIntent != null) { + mAclConnectionIntent.set(true); } - } - } else if (BluetoothDevice.ACTION_ACL_DISCONNECTED.equals(intent.getAction())) { - if (mAclConnectionIntent != null) { - mAclConnectionIntent.set(true); - } + break; + default: + break; } } }; @@ -152,17 +215,18 @@ public class HidHostTest { @Before public void setUp() throws Exception { - mContext.registerReceiver( - mConnectionStateReceiver, - new IntentFilter(BluetoothHidHost.ACTION_CONNECTION_STATE_CHANGED)); - mContext.registerReceiver( - mConnectionStateReceiver, new IntentFilter(BluetoothDevice.ACTION_PAIRING_REQUEST)); - mContext.registerReceiver( - mConnectionStateReceiver, - new IntentFilter(BluetoothDevice.ACTION_BOND_STATE_CHANGED)); - mContext.registerReceiver( - mConnectionStateReceiver, - new IntentFilter(BluetoothDevice.ACTION_ACL_DISCONNECTED)); + final IntentFilter filter = new IntentFilter(); + filter.addAction(BluetoothHidHost.ACTION_CONNECTION_STATE_CHANGED); + filter.addAction(BluetoothDevice.ACTION_PAIRING_REQUEST); + filter.addAction(BluetoothDevice.ACTION_BOND_STATE_CHANGED); + filter.addAction(BluetoothHidHost.ACTION_PROTOCOL_MODE_CHANGED); + filter.addAction(BluetoothHidHost.ACTION_HANDSHAKE); + filter.addAction(BluetoothHidHost.ACTION_VIRTUAL_UNPLUG_STATUS); + filter.addAction(BluetoothHidHost.ACTION_REPORT); + filter.addAction(BluetoothAdapter.ACTION_STATE_CHANGED); + filter.addAction(BluetoothDevice.ACTION_ACL_DISCONNECTED); + + mContext.registerReceiver(mHidStateReceiver, filter); mAdapter.getProfileProxy( mContext, mBluetoothProfileServiceListener, BluetoothProfile.HID_HOST); mAdapter.getProfileProxy(mContext, mBluetoothProfileServiceListener, BluetoothProfile.A2DP); @@ -172,25 +236,32 @@ public class HidHostTest { mFutureConnectionIntent = SettableFuture.create(); mDevice = mBumble.getRemoteDevice(); + mFutureBondIntent = SettableFuture.create(); assertThat(mDevice.createBond()).isTrue(); + assertThat(mFutureBondIntent.get()).isEqualTo(BluetoothDevice.BOND_BONDED); - assertThat(mFutureConnectionIntent.get()).isEqualTo(BluetoothProfile.STATE_CONNECTED); - if (mA2dpService != null) { + if (mA2dpService != null + && mA2dpService.getConnectionPolicy(mDevice) + == BluetoothProfile.CONNECTION_POLICY_ALLOWED) { assertThat( mA2dpService.setConnectionPolicy( mDevice, BluetoothProfile.CONNECTION_POLICY_FORBIDDEN)) .isTrue(); } - if (mHfpService != null) { + if (mHfpService != null + && mHfpService.getConnectionPolicy(mDevice) + == BluetoothProfile.CONNECTION_POLICY_ALLOWED) { assertThat( mHfpService.setConnectionPolicy( mDevice, BluetoothProfile.CONNECTION_POLICY_FORBIDDEN)) .isTrue(); } + assertThat(mFutureConnectionIntent.get()).isEqualTo(BluetoothProfile.STATE_CONNECTED); } @After public void tearDown() throws Exception { + if (mDevice.getBondState() == BluetoothDevice.BOND_BONDED) { mFutureBondIntent = SettableFuture.create(); mDevice.removeBond(); @@ -202,7 +273,8 @@ public class HidHostTest { mDevice.disconnect(); assertThat(mAclConnectionIntent.get()).isTrue(); } - mContext.unregisterReceiver(mConnectionStateReceiver); + + mContext.unregisterReceiver(mHidStateReceiver); } /** @@ -368,12 +440,183 @@ public class HidHostTest { assertThat(mFutureConnectionIntent.get()).isEqualTo(BluetoothProfile.STATE_DISCONNECTED); + mFutureBondIntent = SettableFuture.create(); mDevice.removeBond(); + assertThat(mFutureBondIntent.get()).isEqualTo(BluetoothDevice.BOND_NONE); - mFutureConnectionIntent = SettableFuture.create(); - mHidBlockingStub.connectHost(Empty.getDefaultInstance()); - assertThat(mHidService.getConnectionState(mDevice)) - .isEqualTo(BluetoothProfile.STATE_DISCONNECTED); + reconnectionFromRemoteAndVerifyDisconnectedState(); + } + + /** + * Test Virtual Unplug from Hid Host + * + * <ol> + * <li>1. Android creates bonding and connect the HID Device + * <li>2. Android Virtual Unplug and verifies Bonding + * </ol> + */ + @Test + public void hidVirtualUnplugFromHidHostTest() throws Exception { + mHidService.virtualUnplug(mDevice); + mFutureBondIntent = SettableFuture.create(); + assertThat(mFutureBondIntent.get()).isEqualTo(BluetoothDevice.BOND_NONE); + } + + /** + * Test Virtual Unplug from Hid Device + * + * <ol> + * <li>1. Android creates bonding and connect the HID Device + * <li>2. Bumble Virtual Unplug and Android verifies Bonding + * </ol> + */ + @Test + public void hidVirtualUnplugFromHidDeviceTest() throws Exception { + mHidBlockingStub.virtualCableUnplugHost(Empty.getDefaultInstance()); + mFutureVirtualUnplugIntent = SettableFuture.create(); + assertThat(mFutureVirtualUnplugIntent.get()) + .isEqualTo(BluetoothHidHost.VIRTUAL_UNPLUG_STATUS_SUCCESS); + } + + /** + * Test Get Protocol mode + * + * <ol> + * <li>1. Android creates bonding and connect the HID Device + * <li>2. Android Gets the Protocol mode and verifies the mode + * </ol> + */ + @Test + public void hidGetProtocolModeTest() throws Exception { + mHidService.getProtocolMode(mDevice); + mFutureProtocolModeIntent = SettableFuture.create(); + assertThat(mFutureProtocolModeIntent.get()) + .isEqualTo(BluetoothHidHost.PROTOCOL_REPORT_MODE); + } + + /** + * Test Set Protocol mode + * + * <ol> + * <li>1. Android creates bonding and connect the HID Device + * <li>2. Android Sets the Protocol mode and verifies the mode + * </ol> + */ + @Test + @Ignore("b/349351673: sets wrong protocol mode value") + public void hidSetProtocolModeTest() throws Exception { + Iterator<ProtocolModeEvent> mHidProtoModeEventObserver = + mHidBlockingStub + .withDeadlineAfter(PROTO_MODE_TIMEOUT.toMillis(), TimeUnit.MILLISECONDS) + .onSetProtocolMode(Empty.getDefaultInstance()); + mHidService.setProtocolMode(mDevice, BluetoothHidHost.PROTOCOL_BOOT_MODE); + mFutureHandShakeIntent = SettableFuture.create(); + assertThat(mFutureHandShakeIntent.get()) + .isEqualTo(BluetoothHidDevice.ERROR_RSP_UNSUPPORTED_REQ); + if (mHidProtoModeEventObserver.hasNext()) { + ProtocolModeEvent hidProtoModeEvent = mHidProtoModeEventObserver.next(); + Log.i(TAG, "Protocol mode:" + hidProtoModeEvent.getProtocolMode()); + assertThat(hidProtoModeEvent.getProtocolModeValue()) + .isEqualTo(BluetoothHidHost.PROTOCOL_BOOT_MODE); + } + } + + /** + * Test Get Report + * + * <ol> + * <li>1. Android creates bonding and connect the HID Device + * <li>2. Android get report and verifies the report + * </ol> + */ + @Test + public void hidGetReportTest() throws Exception { + // Keyboard report + byte id = KEYBD_RPT_ID; + mHidService.getReport(mDevice, BluetoothHidHost.REPORT_TYPE_INPUT, id, (int) 0); + mFutureReportIntent = SettableFuture.create(); + assertThat(mFutureReportIntent.get()).isEqualTo(KEYBD_RPT_SIZE); + assertThat(mReportId).isEqualTo(KEYBD_RPT_ID); + + // Mouse report + id = MOUSE_RPT_ID; + mHidService.getReport(mDevice, BluetoothHidHost.REPORT_TYPE_INPUT, id, (int) 0); + mFutureReportIntent = SettableFuture.create(); + assertThat(mFutureReportIntent.get()).isEqualTo(MOUSE_RPT_SIZE); + assertThat(mReportId).isEqualTo(MOUSE_RPT_ID); + + // Invalid report + id = INVALID_RPT_ID; + mHidService.getReport(mDevice, BluetoothHidHost.REPORT_TYPE_INPUT, id, (int) 0); + mFutureHandShakeIntent = SettableFuture.create(); + assertThat(mFutureHandShakeIntent.get()) + .isEqualTo(BluetoothHidDevice.ERROR_RSP_INVALID_RPT_ID); + } + + /** + * Test Set Report + * + * <ol> + * <li>1. Android creates bonding and connect the HID Device + * <li>2. Android Set report and verifies the report + * </ol> + */ + @Test + public void hidSetReportTest() throws Exception { + Iterator<ReportEvent> mHidReportEventObserver = + mHidBlockingStub + .withDeadlineAfter(PROTO_MODE_TIMEOUT.toMillis(), TimeUnit.MILLISECONDS) + .onSetReport(Empty.getDefaultInstance()); + // Keyboard report + String kbReportData = "010203040506070809"; + mHidService.setReport(mDevice, BluetoothHidHost.REPORT_TYPE_INPUT, kbReportData); + mFutureHandShakeIntent = SettableFuture.create(); + assertThat(mFutureHandShakeIntent.get()).isEqualTo(BluetoothHidDevice.ERROR_RSP_SUCCESS); + if (mHidReportEventObserver.hasNext()) { + ReportEvent hidReportEvent = mHidReportEventObserver.next(); + assertThat(hidReportEvent.getReportTypeValue()) + .isEqualTo(BluetoothHidHost.REPORT_TYPE_INPUT); + assertThat(hidReportEvent.getReportIdValue()).isEqualTo(KEYBD_RPT_ID); + assertThat(hidReportEvent.getReportData()).isEqualTo(kbReportData.substring(2)); + } + // Keyboard report - Invalid param + mHidService.setReport( + mDevice, BluetoothHidHost.REPORT_TYPE_INPUT, kbReportData.substring(0, 10)); + mFutureHandShakeIntent = SettableFuture.create(); + assertThat(mFutureHandShakeIntent.get()) + .isEqualTo(BluetoothHidDevice.ERROR_RSP_INVALID_PARAM); + if (mHidReportEventObserver.hasNext()) { + ReportEvent hidReportEvent = mHidReportEventObserver.next(); + assertThat(hidReportEvent.getReportTypeValue()) + .isEqualTo(BluetoothHidHost.REPORT_TYPE_INPUT); + assertThat(hidReportEvent.getReportIdValue()).isEqualTo(KEYBD_RPT_ID); + assertThat(hidReportEvent.getReportData()).isEqualTo(kbReportData.substring(2, 10)); + } + // Mouse report + String mouseReportData = "02030405"; + mHidService.setReport(mDevice, BluetoothHidHost.REPORT_TYPE_INPUT, mouseReportData); + mFutureHandShakeIntent = SettableFuture.create(); + assertThat(mFutureHandShakeIntent.get()).isEqualTo(BluetoothHidDevice.ERROR_RSP_SUCCESS); + if (mHidReportEventObserver.hasNext()) { + ReportEvent hidReportEvent = mHidReportEventObserver.next(); + assertThat(hidReportEvent.getReportTypeValue()) + .isEqualTo(BluetoothHidHost.REPORT_TYPE_INPUT); + assertThat(hidReportEvent.getReportIdValue()).isEqualTo(MOUSE_RPT_ID); + assertThat(hidReportEvent.getReportData()).isEqualTo(mouseReportData.substring(2)); + } + // Invalid report id + String inValidReportData = "0304"; + mHidService.setReport(mDevice, BluetoothHidHost.REPORT_TYPE_INPUT, inValidReportData); + mFutureHandShakeIntent = SettableFuture.create(); + assertThat(mFutureHandShakeIntent.get()) + .isEqualTo(BluetoothHidDevice.ERROR_RSP_INVALID_RPT_ID); + if (mHidReportEventObserver.hasNext()) { + ReportEvent hidReportEvent = mHidReportEventObserver.next(); + assertThat(hidReportEvent.getReportTypeValue()) + .isEqualTo(BluetoothHidHost.REPORT_TYPE_INPUT); + assertThat(hidReportEvent.getReportIdValue()).isEqualTo(INVALID_RPT_ID); + assertThat(hidReportEvent.getReportData()).isEqualTo(inValidReportData.substring(2)); + } } private void reconnectionFromRemoteAndVerifyDisconnectedState() throws Exception { @@ -385,9 +628,6 @@ public class HidHostTest { } private void bluetoothRestart() throws Exception { - mContext.registerReceiver( - mConnectionStateReceiver, new IntentFilter(BluetoothAdapter.ACTION_STATE_CHANGED)); - mAdapter.disable(); mFutureAdapterStateIntent = SettableFuture.create(); assertThat(mFutureAdapterStateIntent.get()).isEqualTo(BluetoothAdapter.STATE_OFF); diff --git a/framework/tests/util/src/BlockingBluetoothAdapter.kt b/framework/tests/util/src/BlockingBluetoothAdapter.kt index 424beb79aa..49b08c8c43 100644 --- a/framework/tests/util/src/BlockingBluetoothAdapter.kt +++ b/framework/tests/util/src/BlockingBluetoothAdapter.kt @@ -79,7 +79,7 @@ object BlockingBluetoothAdapter { if (adapter.isBleScanAlwaysAvailable()) { break } - Log.d(TAG, "Ble scan not yet available… Sleeping 20 ms $i/5") + Log.d(TAG, "Ble scan not yet available... Sleeping 20 ms $i/5") Thread.sleep(20) } if (!adapter.isBleScanAlwaysAvailable()) { diff --git a/pandora/interfaces/pandora_experimental/hid.proto b/pandora/interfaces/pandora_experimental/hid.proto index 7b1e7d2c8a..709d1577ff 100644 --- a/pandora/interfaces/pandora_experimental/hid.proto +++ b/pandora/interfaces/pandora_experimental/hid.proto @@ -15,8 +15,11 @@ service HID { rpc VirtualCableUnplugHost(google.protobuf.Empty) returns (google.protobuf.Empty); // Send a SET_REPORT command, acting as a HID host, to a connected HID device rpc SendHostReport(SendHostReportRequest) returns (SendHostReportResponse); + // receive Protocol Mode Event + rpc OnSetProtocolMode(google.protobuf.Empty) returns (stream ProtocolModeEvent); + // receive Report Event + rpc OnSetReport(google.protobuf.Empty) returns (stream ReportEvent); } - // Enum values match those in BluetoothHidHost.java enum HidReportType { HID_REPORT_TYPE_UNSPECIFIED = 0; @@ -24,6 +27,17 @@ enum HidReportType { HID_REPORT_TYPE_OUTPUT = 2; HID_REPORT_TYPE_FEATURE = 3; } +// Enum values match those in BluetoothHidHost.java +enum ProtocolMode { + PROTOCOL_REPORT_MODE = 0; + PROTOCOL_BOOT_MODE = 1; + PROTOCOL_UNSUPPORTED_MODE = 255; +} +enum HidReportId { + HID_KEYBD_RPT_ID = 0; + HID_MOUSE_RPT_ID = 1; + HID_INVALID_RPT_ID = 3; +} message SendHostReportRequest { bytes address = 1; @@ -34,3 +48,13 @@ message SendHostReportRequest { message SendHostReportResponse { } + +message ProtocolModeEvent { + ProtocolMode protocol_mode = 1; +} + +message ReportEvent { + HidReportType report_type = 1; + HidReportId report_id = 2; + string report_data = 3; +} diff --git a/pandora/server/bumble_experimental/hid.py b/pandora/server/bumble_experimental/hid.py index 497f5edd4a..6da25ec6e1 100644 --- a/pandora/server/bumble_experimental/hid.py +++ b/pandora/server/bumble_experimental/hid.py @@ -11,6 +11,14 @@ from google.protobuf import empty_pb2 # pytype: disable=pyi-error from pandora_experimental.hid_grpc_aio import HIDServicer from bumble.pandora import utils +from pandora_experimental.hid_pb2 import ( + ProtocolModeEvent, + ReportEvent, + PROTOCOL_REPORT_MODE, + PROTOCOL_BOOT_MODE, + PROTOCOL_UNSUPPORTED_MODE, +) + from bumble.core import ( BT_BR_EDR_TRANSPORT, BT_L2CAP_PROTOCOL_ID, @@ -489,20 +497,30 @@ def sdp_records(): # ----------------------------------------------------------------------------- def hogp_device(device): - global input_report_characteristic # Create an 'input report' characteristic to send keyboard reports to the host - input_report_characteristic = Characteristic( + input_report_kb_characteristic = Characteristic( GATT_REPORT_CHARACTERISTIC, Characteristic.Properties.READ | Characteristic.Properties.WRITE | Characteristic.Properties.NOTIFY, Characteristic.READABLE | Characteristic.WRITEABLE, - bytes([0, 0, 0, 0, 0, 0, 0, 0]), + bytes([0, 0, 0, 0, 0, 0, 0, 0, 0]), [Descriptor( GATT_REPORT_REFERENCE_DESCRIPTOR, Descriptor.READABLE, bytes([0x01, HID_INPUT_REPORT]), )], ) - + # Create an 'input report' characteristic to send mouse reports to the host + input_report_mouse_characteristic = Characteristic( + GATT_REPORT_CHARACTERISTIC, + Characteristic.Properties.READ | Characteristic.Properties.WRITE | Characteristic.Properties.NOTIFY, + Characteristic.READABLE | Characteristic.WRITEABLE, + bytes([0, 0, 0, 0]), + [Descriptor( + GATT_REPORT_REFERENCE_DESCRIPTOR, + Descriptor.READABLE, + bytes([0x02, HID_INPUT_REPORT]), + )], + ) # Create an 'output report' characteristic to receive keyboard reports from the host output_report_characteristic = Characteristic( GATT_REPORT_CHARACTERISTIC, @@ -558,7 +576,8 @@ def hogp_device(device): Characteristic.READABLE, HID_KEYBOARD_REPORT_MAP, ), - input_report_characteristic, + input_report_kb_characteristic, + input_report_mouse_characteristic, output_report_characteristic, ], ), @@ -630,6 +649,12 @@ def on_set_report_cb(report_id: int, report_type: int, report_size: int, data: b logging.info("SET_REPORT report_id: " + str(report_id) + "report_type: " + str(report_type) + "report_size " + str(report_size) + "data:" + str(data)) + report = ReportEvent() + report.report_type = report_type + report.report_id = report_id + report.report_data = str(data.hex()) + hid_report_queue.put_nowait(report) + if report_type == Message.ReportType.FEATURE_REPORT: retValue.status = hid_device.GetSetReturn.ERR_INVALID_PARAMETER elif report_type == Message.ReportType.INPUT_REPORT: @@ -657,7 +682,15 @@ def on_get_protocol_cb(): def on_set_protocol_cb(protocol: int): retValue = hid_device.GetSetStatus() # We do not support SET_PROTOCOL. - logging.info(f"SET_PROTOCOL report_id: {protocol}") + logging.info(f"SET_PROTOCOL mode: {protocol}") + mode = ProtocolModeEvent() + if protocol == PROTOCOL_REPORT_MODE: + mode.protocol_mode = PROTOCOL_REPORT_MODE + elif protocol == PROTOCOL_BOOT_MODE: + mode.protocol_mode = PROTOCOL_BOOT_MODE + else: + mode.protocol_mode = PROTOCOL_UNSUPPORTED_MODE + hid_protoMode_queue.put_nowait(mode) retValue.status = hid_device.GetSetReturn.ERR_UNSUPPORTED_REQUEST return retValue @@ -667,6 +700,9 @@ def on_virtual_cable_unplug_cb(): asyncio.create_task(handle_virtual_cable_unplug()) +hid_protoMode_queue = None + + # This class implements the Hid Pandora interface. class HIDService(HIDServicer): @@ -676,6 +712,7 @@ class HIDService(HIDServicer): super().__init__() self.device = device self.device.sdp_service_records.update(sdp_records()) + self.event_queue: Optional[asyncio.Queue[ProtocolModeEvent]] = None hogp_device(self.device) logging.info(f'Hid device register: ') global hid_device @@ -742,3 +779,43 @@ class HIDService(HIDServicer): logging.exception(f'Device does not exist') raise e return empty_pb2.Empty() + + @utils.rpc + async def OnSetProtocolMode(self, request: empty_pb2.Empty, + context: grpc.ServicerContext) -> AsyncGenerator[ProtocolModeEvent, None]: + logging.info(f'OnSetProtocolMode') + + if self.event_queue is not None: + raise RuntimeError('already streaming OnSetProtocolMode events') + + self.event_queue = asyncio.Queue() + global hid_protoMode_queue + hid_protoMode_queue = self.event_queue + + try: + while event := await hid_protoMode_queue.get(): + yield event + + finally: + self.event_queue = None + hid_protoMode_queue = None + + @utils.rpc + async def OnSetReport(self, request: empty_pb2.Empty, + context: grpc.ServicerContext) -> AsyncGenerator[ReportEvent, None]: + logging.info(f'OnSetReport') + + if self.event_queue is not None: + raise RuntimeError('already streaming OnSetReport events') + + self.event_queue = asyncio.Queue() + global hid_report_queue + hid_report_queue = self.event_queue + + try: + while event := await hid_report_queue.get(): + yield event + + finally: + self.event_queue = None + hid_report_queue = None diff --git a/service/aidl/android/bluetooth/IBluetoothManager.aidl b/service/aidl/android/bluetooth/IBluetoothManager.aidl index 5ef3b2736f..a2ffede0d9 100644 --- a/service/aidl/android/bluetooth/IBluetoothManager.aidl +++ b/service/aidl/android/bluetooth/IBluetoothManager.aidl @@ -34,7 +34,7 @@ interface IBluetoothManager boolean enable(in AttributionSource attributionSource); @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)") boolean enableNoAutoConnect(in AttributionSource attributionSource); - @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)") + @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED}, conditional=true)") boolean disable(in AttributionSource attributionSource, boolean persist); @JavaPassthrough(annotation="@android.annotation.RequiresNoPermission") int getState(); diff --git a/service/aidl/android/bluetooth/IBluetoothManagerCallback.aidl b/service/aidl/android/bluetooth/IBluetoothManagerCallback.aidl index 846673268c..1234e12d10 100644 --- a/service/aidl/android/bluetooth/IBluetoothManagerCallback.aidl +++ b/service/aidl/android/bluetooth/IBluetoothManagerCallback.aidl @@ -26,4 +26,5 @@ oneway interface IBluetoothManagerCallback { void onBluetoothServiceDown(); void onBluetoothOn(); void onBluetoothOff(); + void onBluetoothAdapterStateChange(int newState); } diff --git a/service/src/LogTest.kt b/service/src/LogTest.kt index c1a48642a4..3f59d16e10 100644 --- a/service/src/LogTest.kt +++ b/service/src/LogTest.kt @@ -57,7 +57,7 @@ class LogTest { @Test fun log_errorThrowable() { - Log.e(TAG, "Logging error… ", RuntimeException("With a Throwable")) + Log.e(TAG, "Logging error... ", RuntimeException("With a Throwable")) } @Test diff --git a/service/src/com/android/server/bluetooth/BluetoothManagerService.java b/service/src/com/android/server/bluetooth/BluetoothManagerService.java index 4410a23924..b76a5c983a 100644 --- a/service/src/com/android/server/bluetooth/BluetoothManagerService.java +++ b/service/src/com/android/server/bluetooth/BluetoothManagerService.java @@ -497,14 +497,14 @@ class BluetoothManagerService { if (BluetoothAdapter.ACTION_LOCAL_NAME_CHANGED.equals(action)) { String newName = intent.getStringExtra(BluetoothAdapter.EXTRA_LOCAL_NAME); if (newName != null) { - Log.d(TAG, "Bluetooth Adapter name changed to " + newName); + Log.d(TAG, "Local name changed to: " + newName); storeNameAndAddress(newName, null); } } else if (BluetoothAdapter.ACTION_BLUETOOTH_ADDRESS_CHANGED.equals(action)) { String newAddress = intent.getStringExtra(BluetoothAdapter.EXTRA_BLUETOOTH_ADDRESS); if (newAddress != null) { - Log.d(TAG, "Local address changed to …" + logAddress(newAddress)); + Log.d(TAG, "Local address changed to: " + logAddress(newAddress)); storeNameAndAddress(null, newAddress); } else { Log.e(TAG, "No Bluetooth Adapter address parameter found"); @@ -775,6 +775,16 @@ class BluetoothManagerService { IBluetooth registerAdapter(IBluetoothManagerCallback callback) { synchronized (mCallbacks) { mCallbacks.register(callback); + if (Flags.broadcastAdapterStateWithCallback()) { + try { + callback.onBluetoothAdapterStateChange(getState()); + } catch (RemoteException e) { + Log.e( + TAG, + "registerAdapter: Unable to call onBluetoothAdapterStateChange()", + e); + } + } } return mAdapter != null ? mAdapter.getAdapterBinder() : null; } @@ -1378,6 +1388,27 @@ class BluetoothManagerService { } } + private void sendBluetoothAdapterStateChangeCallback(int newState) { + if (!Flags.broadcastAdapterStateWithCallback()) { + return; + } + synchronized (mCallbacks) { + try { + int n = mCallbacks.beginBroadcast(); + Log.d(TAG, "sendBluetoothAdapterStateChangeCallback(): to " + n + " receivers"); + for (int i = 0; i < n; i++) { + try { + mCallbacks.getBroadcastItem(i).onBluetoothAdapterStateChange(newState); + } catch (RemoteException e) { + Log.e(TAG, "onBluetoothAdapterStateChange: failed for callback #" + i, e); + } + } + } finally { + mCallbacks.finishBroadcast(); + } + } + } + String getAddress() { mAdapterLock.readLock().lock(); try { @@ -2049,6 +2080,7 @@ class BluetoothManagerService { return; } mState.set(newState); + sendBluetoothAdapterStateChangeCallback(newState); if (prevState == STATE_ON) { autoOnSetupTimer(); diff --git a/service/src/com/android/server/bluetooth/BluetoothServiceBinder.java b/service/src/com/android/server/bluetooth/BluetoothServiceBinder.java index 49e5c2b5b9..74d97a3bd3 100644 --- a/service/src/com/android/server/bluetooth/BluetoothServiceBinder.java +++ b/service/src/com/android/server/bluetooth/BluetoothServiceBinder.java @@ -178,7 +178,6 @@ class BluetoothServiceBinder extends IBluetoothManager.Stub { } @Override - @RequiresPermission(allOf = {BLUETOOTH_CONNECT, LOCAL_MAC_ADDRESS}) public String getAddress(AttributionSource source) { requireNonNull(source, "AttributionSource cannot be null in getAddress"); diff --git a/service/src/com/android/server/bluetooth/BtPermissionUtils.java b/service/src/com/android/server/bluetooth/BtPermissionUtils.java index c68f25b65f..fd7a2fdb54 100644 --- a/service/src/com/android/server/bluetooth/BtPermissionUtils.java +++ b/service/src/com/android/server/bluetooth/BtPermissionUtils.java @@ -137,9 +137,9 @@ class BtPermissionUtils { return ""; } + @RequiresPermission(BLUETOOTH_PRIVILEGED) static void enforcePrivileged(Context ctx) { - ctx.enforceCallingOrSelfPermission( - BLUETOOTH_PRIVILEGED, "Need BLUETOOTH_PRIVILEGED permission"); + ctx.enforceCallingOrSelfPermission(BLUETOOTH_PRIVILEGED, null); } static int getCallingAppId() { diff --git a/system/OWNERS b/system/OWNERS index d9f7284196..7694565c9e 100644 --- a/system/OWNERS +++ b/system/OWNERS @@ -3,6 +3,7 @@ cmanton@google.com eruffieux@google.com hallstrom@google.com +henrichataing@google.com jpawlowski@google.com mylesgw@google.com rwt@google.com diff --git a/system/audio_bluetooth_hw/device_port_proxy.cc b/system/audio_bluetooth_hw/device_port_proxy.cc index 6c0ae4ea04..8f29654d1c 100644 --- a/system/audio_bluetooth_hw/device_port_proxy.cc +++ b/system/audio_bluetooth_hw/device_port_proxy.cc @@ -576,8 +576,7 @@ void BluetoothAudioPortAidl::UpdateSourceMetadata(const source_metadata_v7* sour static_cast<AudioUsage>(source_metadata->tracks[i].base.usage); hal_source_metadata.tracks[i].contentType = static_cast<AudioContentType>(source_metadata->tracks[i].base.content_type); - hal_source_metadata.tracks[i].tags = - std::move(CovertAudioTagFromV7(source_metadata->tracks[i].tags)); + hal_source_metadata.tracks[i].tags = CovertAudioTagFromV7(source_metadata->tracks[i].tags); } BluetoothAudioSessionControl::UpdateSourceMetadata(session_type_, hal_source_metadata); @@ -601,8 +600,7 @@ void BluetoothAudioPortAidl::UpdateSinkMetadata(const sink_metadata_v7* sink_met hal_sink_metadata.tracks[i].source = static_cast<AudioSource>(sink_metadata->tracks[i].base.source); hal_sink_metadata.tracks[i].gain = sink_metadata->tracks[i].base.gain; - hal_sink_metadata.tracks[i].tags = - std::move(CovertAudioTagFromV7(sink_metadata->tracks[i].tags)); + hal_sink_metadata.tracks[i].tags = CovertAudioTagFromV7(sink_metadata->tracks[i].tags); } BluetoothAudioSessionControl::UpdateSinkMetadata(session_type_, hal_sink_metadata); diff --git a/system/audio_hal_interface/aidl/a2dp_encoding_aidl.cc b/system/audio_hal_interface/aidl/a2dp_encoding_aidl.cc index 79b287ac58..039f66ce31 100644 --- a/system/audio_hal_interface/aidl/a2dp_encoding_aidl.cc +++ b/system/audio_hal_interface/aidl/a2dp_encoding_aidl.cc @@ -262,7 +262,7 @@ static uint16_t a2dp_get_peer_mtu(btav_a2dp_codec_index_t codec_index, uint8_t c tA2DP_ENCODER_INIT_PEER_PARAMS peer_params; bta_av_co_get_peer_params(peer_addr, &peer_params); uint16_t peer_mtu = peer_params.peer_mtu; - uint16_t effective_mtu = bta_av_co_get_encoder_effective_frame_size(); + uint16_t effective_mtu = bta_av_co_get_encoder_effective_frame_size(peer_addr); if (effective_mtu > 0 && effective_mtu < peer_mtu) { peer_mtu = effective_mtu; @@ -343,7 +343,7 @@ bool a2dp_get_selected_hal_codec_config(CodecConfiguration* codec_config) { RawAddress peer_addr = btif_av_source_active_peer(); tA2DP_ENCODER_INIT_PEER_PARAMS peer_param; bta_av_co_get_peer_params(peer_addr, &peer_param); - int effectiveMtu = bta_av_co_get_encoder_effective_frame_size(); + int effectiveMtu = bta_av_co_get_encoder_effective_frame_size(peer_addr); if (effectiveMtu > 0 && effectiveMtu < peer_param.peer_mtu) { codec_config->peerMtu = effectiveMtu; } else { diff --git a/system/audio_hal_interface/aidl/client_interface_aidl.cc b/system/audio_hal_interface/aidl/client_interface_aidl.cc index 3db108d206..068dfbdf07 100644 --- a/system/audio_hal_interface/aidl/client_interface_aidl.cc +++ b/system/audio_hal_interface/aidl/client_interface_aidl.cc @@ -16,17 +16,22 @@ #define LOG_TAG "BTAudioClientAIDL" -#include "client_interface_aidl.h" +#include "aidl/client_interface_aidl.h" #include <android/binder_manager.h> #include <bluetooth/log.h> #include <com_android_bluetooth_flags.h> +#include <memory> +#include <set> #include <thread> +#include <utility> #include <vector> #include "bta/ag/bta_ag_int.h" +const uint8_t kFetchAudioProviderRetryNumber = 3; + namespace bluetooth { namespace audio { namespace aidl { @@ -174,42 +179,50 @@ void BluetoothAudioClientInterface::FetchAudioProvider() { if (provider_ != nullptr) { log::warn("refetch"); } - auto provider_factory = IBluetoothAudioProviderFactory::fromBinder(::ndk::SpAIBinder( - AServiceManager_waitForService(kDefaultAudioProviderFactoryInterface.c_str()))); + // Retry if audioserver restarts in the middle of fetching. + // When audioserver restarts, IBluetoothAudioProviderFactory service is also + // re-registered, so we need to re-fetch the service. + for (int retry_no = 0; retry_no < kFetchAudioProviderRetryNumber; ++retry_no) { + auto provider_factory = IBluetoothAudioProviderFactory::fromBinder(::ndk::SpAIBinder( + AServiceManager_waitForService(kDefaultAudioProviderFactoryInterface.c_str()))); - if (provider_factory == nullptr) { - log::error("can't get capability from unknown factory"); - return; - } + if (provider_factory == nullptr) { + log::error("can't get capability from unknown factory"); + return; + } - capabilities_.clear(); - auto aidl_retval = - provider_factory->getProviderCapabilities(transport_->GetSessionType(), &capabilities_); - if (!aidl_retval.isOk()) { - log::fatal("BluetoothAudioHal::getProviderCapabilities failure: {}", - aidl_retval.getDescription()); - return; - } - if (capabilities_.empty()) { - log::warn("SessionType={} Not supported by BluetoothAudioHal", - toString(transport_->GetSessionType())); - return; - } - log::info("BluetoothAudioHal SessionType={} has {} AudioCapabilities", - toString(transport_->GetSessionType()), capabilities_.size()); + capabilities_.clear(); + auto aidl_retval = + provider_factory->getProviderCapabilities(transport_->GetSessionType(), &capabilities_); + if (!aidl_retval.isOk()) { + log::fatal("BluetoothAudioHal::getProviderCapabilities failure: {}", + aidl_retval.getDescription()); + return; + } + if (capabilities_.empty()) { + log::warn("SessionType={} Not supported by BluetoothAudioHal", + toString(transport_->GetSessionType())); + return; + } + log::info("BluetoothAudioHal SessionType={} has {} AudioCapabilities", + toString(transport_->GetSessionType()), capabilities_.size()); - aidl_retval = provider_factory->openProvider(transport_->GetSessionType(), &provider_); - if (!aidl_retval.isOk()) { - log::fatal("BluetoothAudioHal::openProvider failure: {}", aidl_retval.getDescription()); + aidl_retval = provider_factory->openProvider(transport_->GetSessionType(), &provider_); + if (!aidl_retval.isOk()) { + log::error("BluetoothAudioHal::openProvider failure: {}, retry number {}", + aidl_retval.getDescription(), retry_no + 1); + } else { + provider_factory_ = std::move(provider_factory); + break; + } } log::assert_that(provider_ != nullptr, "assert failed: provider_ != nullptr"); binder_status_t binder_status = - AIBinder_linkToDeath(provider_factory->asBinder().get(), death_recipient_.get(), this); + AIBinder_linkToDeath(provider_factory_->asBinder().get(), death_recipient_.get(), this); if (binder_status != STATUS_OK) { log::error("Failed to linkToDeath {}", static_cast<int>(binder_status)); } - provider_factory_ = std::move(provider_factory); log::info("IBluetoothAudioProvidersFactory::openProvider() returned {}{}", fmt::ptr(provider_.get()), (provider_->isRemote() ? " (remote)" : " (local)")); @@ -524,7 +537,7 @@ size_t BluetoothAudioSinkClientInterface::ReadAudioData(uint8_t* p_buf, uint32_t if (avail_to_read > len - total_read) { avail_to_read = len - total_read; } - if (data_mq_->read((MqDataType*)p_buf + total_read, avail_to_read) == 0) { + if (data_mq_->read(reinterpret_cast<MqDataType*>(p_buf) + total_read, avail_to_read) == 0) { log::warn("len={} total_read={} failed", len, total_read); break; } @@ -620,7 +633,7 @@ void BluetoothAudioClientInterface::SetCodecPriority(CodecId codec_id, int32_t p log::assert_that(provider_ != nullptr, "assert failed: provider_ != nullptr"); auto aidl_retval = provider_->setCodecPriority(codec_id, priority); if (!aidl_retval.isOk()) { - log::fatal("BluetoothAudioHal::setCodecPriority failure: {}", aidl_retval.getDescription()); + log::error("BluetoothAudioHal::setCodecPriority failure: {}", aidl_retval.getDescription()); } } @@ -641,14 +654,15 @@ BluetoothAudioClientInterface::GetLeAudioAseConfiguration( requirements, &configurations); if (!aidl_retval.isOk()) { - log::fatal("BluetoothAudioHal::getLeAudioAseConfiguration failure: {}", + log::error("BluetoothAudioHal::getLeAudioAseConfiguration failure: {}", aidl_retval.getDescription()); + } else { + log::info( + "BluetoothAudioHal::getLeAudioAseConfiguration returned {} " + "configurations.", + configurations.size()); } - log::info( - "BluetoothAudioHal::getLeAudioAseConfiguration returned {} " - "configurations.", - configurations.size()); return configurations; } @@ -661,7 +675,7 @@ BluetoothAudioClientInterface::getLeAudioAseQosConfiguration( auto aidl_retval = provider_->getLeAudioAseQosConfiguration(qosRequirement, &qos_configuration); if (!aidl_retval.isOk()) { - log::fatal("BluetoothAudioHal::getLeAudioAseQosConfiguration failure: {}", + log::error("BluetoothAudioHal::getLeAudioAseQosConfiguration failure: {}", aidl_retval.getDescription()); } return qos_configuration; @@ -675,7 +689,7 @@ void BluetoothAudioClientInterface::onSinkAseMetadataChanged( auto aidl_retval = provider_->onSinkAseMetadataChanged(state, cigId, cisId, metadata); if (!aidl_retval.isOk()) { - log::fatal("BluetoothAudioHal::onSinkAseMetadataChanged failure: {}", + log::error("BluetoothAudioHal::onSinkAseMetadataChanged failure: {}", aidl_retval.getDescription()); } } @@ -688,7 +702,7 @@ void BluetoothAudioClientInterface::onSourceAseMetadataChanged( auto aidl_retval = provider_->onSourceAseMetadataChanged(state, cigId, cisId, metadata); if (!aidl_retval.isOk()) { - log::fatal("BluetoothAudioHal::onSinkAseMetadataChanged failure: {}", + log::error("BluetoothAudioHal::onSourceAseMetadataChanged failure: {}", aidl_retval.getDescription()); } } @@ -706,7 +720,7 @@ BluetoothAudioClientInterface::getLeAudioBroadcastConfiguration( requirement, &setting); if (!aidl_retval.isOk()) { - log::fatal("BluetoothAudioHal::onSinkAseMetadataChanged failure: {}", + log::error("BluetoothAudioHal::getLeAudioBroadcastConfiguration failure: {}", aidl_retval.getDescription()); } diff --git a/system/audio_hal_interface/hidl/a2dp_encoding_hidl.cc b/system/audio_hal_interface/hidl/a2dp_encoding_hidl.cc index c15c40bb74..4c48db922b 100644 --- a/system/audio_hal_interface/hidl/a2dp_encoding_hidl.cc +++ b/system/audio_hal_interface/hidl/a2dp_encoding_hidl.cc @@ -295,7 +295,7 @@ bool a2dp_get_selected_hal_codec_config(CodecConfiguration* codec_config) { RawAddress peer_addr = btif_av_source_active_peer(); tA2DP_ENCODER_INIT_PEER_PARAMS peer_param; bta_av_co_get_peer_params(peer_addr, &peer_param); - int effectiveMtu = bta_av_co_get_encoder_effective_frame_size(); + int effectiveMtu = bta_av_co_get_encoder_effective_frame_size(peer_addr); if (effectiveMtu > 0 && effectiveMtu < peer_param.peer_mtu) { codec_config->peerMtu = effectiveMtu; } else { diff --git a/system/bta/ag/bta_ag_act.cc b/system/bta/ag/bta_ag_act.cc index a12b6a84dc..144d174945 100644 --- a/system/bta/ag/bta_ag_act.cc +++ b/system/bta/ag/bta_ag_act.cc @@ -237,7 +237,8 @@ void bta_ag_disc_int_res(tBTA_AG_SCB* p_scb, const tBTA_AG_DATA& data) { log::verbose("bta_ag_disc_int_res: Status: {}", data.disc_result.status); /* if found service */ - if (data.disc_result.status == SDP_SUCCESS || data.disc_result.status == SDP_DB_FULL) { + if (data.disc_result.status == tSDP_STATUS::SDP_SUCCESS || + data.disc_result.status == tSDP_STATUS::SDP_DB_FULL) { /* get attributes */ if (bta_ag_sdp_find_attr(p_scb, p_scb->open_services)) { /* set connected service */ @@ -256,8 +257,9 @@ void bta_ag_disc_int_res(tBTA_AG_SCB* p_scb, const tBTA_AG_DATA& data) { /* if service not found check if we should search for other service */ if ((event == BTA_AG_DISC_FAIL_EVT) && - (data.disc_result.status == SDP_SUCCESS || data.disc_result.status == SDP_DB_FULL || - data.disc_result.status == SDP_NO_RECS_MATCH)) { + (data.disc_result.status == tSDP_STATUS::SDP_SUCCESS || + data.disc_result.status == tSDP_STATUS::SDP_DB_FULL || + data.disc_result.status == tSDP_STATUS::SDP_NO_RECS_MATCH)) { if ((p_scb->open_services & BTA_HFP_SERVICE_MASK) && (p_scb->open_services & BTA_HSP_SERVICE_MASK)) { /* search for HSP */ @@ -290,7 +292,8 @@ void bta_ag_disc_int_res(tBTA_AG_SCB* p_scb, const tBTA_AG_DATA& data) { ******************************************************************************/ void bta_ag_disc_acp_res(tBTA_AG_SCB* p_scb, const tBTA_AG_DATA& data) { /* if found service */ - if (data.disc_result.status == SDP_SUCCESS || data.disc_result.status == SDP_DB_FULL) { + if (data.disc_result.status == tSDP_STATUS::SDP_SUCCESS || + data.disc_result.status == tSDP_STATUS::SDP_DB_FULL) { /* get attributes */ bta_ag_sdp_find_attr(p_scb, bta_ag_svc_mask[p_scb->conn_service]); DEVICE_IOT_CONFIG_ADDR_SET_HEX_IF_GREATER(p_scb->peer_addr, IOT_CONF_KEY_HFP_VERSION, diff --git a/system/bta/ag/bta_ag_sco.cc b/system/bta/ag/bta_ag_sco.cc index 5804162a24..948e325ce7 100644 --- a/system/bta/ag/bta_ag_sco.cc +++ b/system/bta/ag/bta_ag_sco.cc @@ -41,6 +41,7 @@ #include "stack/btm/btm_sco_hfp_hal.h" #include "stack/include/btm_api.h" #include "stack/include/btm_client_interface.h" +#include "stack/include/btm_status.h" #include "stack/include/main_thread.h" #include "types/raw_address.h" @@ -173,7 +174,7 @@ static void bta_ag_sco_conn_cback(uint16_t sco_idx) { /* no match found; disconnect sco, init sco variables */ bta_ag_cb.sco.p_curr_scb = nullptr; bta_ag_cb.sco.state = BTA_AG_SCO_SHUTDOWN_ST; - if (get_btm_client_interface().sco.BTM_RemoveSco(sco_idx) != BTM_SUCCESS) { + if (get_btm_client_interface().sco.BTM_RemoveSco(sco_idx) != tBTM_STATUS::BTM_SUCCESS) { log::warn("Unable to remove SCO idx:{}", sco_idx); } } @@ -318,13 +319,13 @@ static void bta_ag_sco_disc_cback(uint16_t sco_idx) { static bool bta_ag_remove_sco(tBTA_AG_SCB* p_scb, bool only_active) { if (p_scb->sco_idx != BTM_INVALID_SCO_INDEX) { if (!only_active || p_scb->sco_idx == bta_ag_cb.sco.cur_idx) { - tBTM_STATUS status = BTM_RemoveSco(p_scb->sco_idx); + tBTM_STATUS status = get_btm_client_interface().sco.BTM_RemoveSco(p_scb->sco_idx); log::debug("Removed SCO index:0x{:04x} status:{}", p_scb->sco_idx, btm_status_text(status)); - if (status == BTM_CMD_STARTED) { + if (status == tBTM_STATUS::BTM_CMD_STARTED) { /* SCO is connected; set current control block */ bta_ag_cb.sco.p_curr_scb = p_scb; return true; - } else if ((status == BTM_SUCCESS) || (status == BTM_UNKNOWN_ADDR)) { + } else if ((status == tBTM_STATUS::BTM_SUCCESS) || (status == BTM_UNKNOWN_ADDR)) { /* If no connection reset the SCO handle */ p_scb->sco_idx = BTM_INVALID_SCO_INDEX; } @@ -529,7 +530,7 @@ void bta_ag_create_sco(tBTA_AG_SCB* p_scb, bool is_orig) { if (is_orig) { bta_ag_cb.sco.is_local = true; /* Set eSCO Mode */ - if (get_btm_client_interface().sco.BTM_SetEScoMode(¶ms) != BTM_SUCCESS) { + if (get_btm_client_interface().sco.BTM_SetEScoMode(¶ms) != tBTM_STATUS::BTM_SUCCESS) { log::warn("Unable to set ESCO mode"); } bta_ag_cb.sco.p_curr_scb = p_scb; @@ -552,9 +553,9 @@ void bta_ag_create_sco(tBTA_AG_SCB* p_scb, bool is_orig) { } } - if (get_btm_client_interface().sco.BTM_CreateSco(&p_scb->peer_addr, true, params.packet_types, - &p_scb->sco_idx, bta_ag_sco_conn_cback, - bta_ag_sco_disc_cback) == BTM_CMD_STARTED) { + if (get_btm_client_interface().sco.BTM_CreateSco( + &p_scb->peer_addr, true, params.packet_types, &p_scb->sco_idx, + bta_ag_sco_conn_cback, bta_ag_sco_disc_cback) == tBTM_STATUS::BTM_CMD_STARTED) { /* Initiating the connection, set the current sco handle */ bta_ag_cb.sco.cur_idx = p_scb->sco_idx; /* Configure input/output data. */ @@ -569,9 +570,9 @@ void bta_ag_create_sco(tBTA_AG_SCB* p_scb, bool is_orig) { tBTM_STATUS btm_status = get_btm_client_interface().sco.BTM_CreateSco( &p_scb->peer_addr, false, params.packet_types, &p_scb->sco_idx, bta_ag_sco_conn_cback, bta_ag_sco_disc_cback); - if (btm_status == BTM_CMD_STARTED) { + if (btm_status == tBTM_STATUS::BTM_CMD_STARTED) { if (get_btm_client_interface().sco.BTM_RegForEScoEvts( - p_scb->sco_idx, bta_ag_esco_connreq_cback) != BTM_SUCCESS) { + p_scb->sco_idx, bta_ag_esco_connreq_cback) != tBTM_STATUS::BTM_SUCCESS) { log::warn("Unable to register for ESCO events"); } } @@ -1373,9 +1374,6 @@ void bta_ag_sco_conn_open(tBTA_AG_SCB* p_scb, const tBTA_AG_DATA& /* data */) { bta_sys_sco_open(BTA_ID_AG, p_scb->app_id, p_scb->peer_addr); if (bta_ag_is_sco_managed_by_audio()) { - // ConfirmStreamingRequest before sends callback to java layer - hfp_offload_interface->ConfirmStreamingRequest(); - bool is_controller_codec = false; if (sco_config_map.find(p_scb->inuse_codec) == sco_config_map.end()) { log::error("sco_config_map does not have inuse_codec={}", @@ -1391,6 +1389,9 @@ void bta_ag_sco_conn_open(tBTA_AG_SCB* p_scb, const tBTA_AG_DATA& /* data */) { .is_nrec = p_scb->nrec_enabled, }; hfp_offload_interface->UpdateAudioConfigToHal(config); + + // ConfirmStreamingRequest before sends callback to java layer + hfp_offload_interface->ConfirmStreamingRequest(); } /* call app callback */ diff --git a/system/bta/av/bta_av_aact.cc b/system/bta/av/bta_av_aact.cc index 748a8f55c5..5a53e08852 100644 --- a/system/bta/av/bta_av_aact.cc +++ b/system/bta/av/bta_av_aact.cc @@ -55,6 +55,7 @@ #include "stack/include/bt_uuid16.h" #include "stack/include/btm_client_interface.h" #include "stack/include/btm_log_history.h" +#include "stack/include/btm_status.h" #include "stack/include/l2c_api.h" #include "storage/config_keys.h" #include "types/hci_role.h" @@ -1867,7 +1868,7 @@ void bta_av_do_start(tBTA_AV_SCB* p_scb, tBTA_AV_DATA* p_data) { * disable sniff mode unconditionally during streaming */ tHCI_ROLE cur_role; if ((get_btm_client_interface().link_policy.BTM_GetRole(p_scb->PeerAddress(), &cur_role) == - BTM_SUCCESS) && + tBTM_STATUS::BTM_SUCCESS) && (cur_role == HCI_ROLE_CENTRAL)) { BTM_block_role_switch_and_sniff_mode_for(p_scb->PeerAddress()); } else { @@ -2339,7 +2340,7 @@ void bta_av_start_ok(tBTA_AV_SCB* p_scb, tBTA_AV_DATA* p_data) { * central. * disable sniff mode unconditionally during streaming */ if ((get_btm_client_interface().link_policy.BTM_GetRole(p_scb->PeerAddress(), &cur_role) == - BTM_SUCCESS) && + tBTM_STATUS::BTM_SUCCESS) && (cur_role == HCI_ROLE_CENTRAL)) { BTM_block_role_switch_and_sniff_mode_for(p_scb->PeerAddress()); } else { diff --git a/system/bta/av/bta_av_main.cc b/system/bta/av/bta_av_main.cc index b67fc72436..443011d9e1 100644 --- a/system/bta/av/bta_av_main.cc +++ b/system/bta/av/bta_av_main.cc @@ -44,6 +44,7 @@ #include "stack/include/bt_hdr.h" #include "stack/include/bt_uuid16.h" #include "stack/include/btm_client_interface.h" +#include "stack/include/btm_status.h" #include "stack/include/hci_error_code.h" #include "stack/include/sdp_api.h" #include "storage/config_keys.h" @@ -873,7 +874,8 @@ void bta_av_restore_switch(void) { mask = BTA_AV_HNDL_TO_MSK(i); if (p_cb->conn_audio == mask) { if (p_cb->p_scb[i]) { - BTM_unblock_role_switch_for(p_cb->p_scb[i]->PeerAddress()); + get_btm_client_interface().link_policy.BTM_unblock_role_switch_for( + p_cb->p_scb[i]->PeerAddress()); } break; } @@ -920,9 +922,10 @@ static void bta_av_sys_rs_cback(tBTA_SYS_CONN_STATUS /* status */, tHCI_ROLE new /* restore role switch policy, if role switch failed */ if ((HCI_SUCCESS != hci_status) && - (get_btm_client_interface().link_policy.BTM_GetRole(peer_addr, &cur_role) == BTM_SUCCESS) && + (get_btm_client_interface().link_policy.BTM_GetRole(peer_addr, &cur_role) == + tBTM_STATUS::BTM_SUCCESS) && (cur_role == HCI_ROLE_PERIPHERAL)) { - BTM_unblock_role_switch_for(peer_addr); + get_btm_client_interface().link_policy.BTM_unblock_role_switch_for(peer_addr); } /* if BTA_AvOpen() was called for other device, which caused the role switch @@ -1078,7 +1081,7 @@ bool bta_av_switch_if_needed(tBTA_AV_SCB* p_scb) { bool bta_av_link_role_ok(tBTA_AV_SCB* p_scb, uint8_t bits) { tHCI_ROLE role; if (get_btm_client_interface().link_policy.BTM_GetRole(p_scb->PeerAddress(), &role) != - BTM_SUCCESS) { + tBTM_STATUS::BTM_SUCCESS) { log::warn("Unable to find link role for device:{}", p_scb->PeerAddress()); return true; } @@ -1089,9 +1092,10 @@ bool bta_av_link_role_ok(tBTA_AV_SCB* p_scb, uint8_t bits) { "conn_audio:0x{:x} bits:{} features:0x{:x}", p_scb->PeerAddress(), p_scb->hndl, RoleText(role), bta_av_cb.conn_audio, bits, bta_av_cb.features); - const tBTM_STATUS status = BTM_SwitchRoleToCentral(p_scb->PeerAddress()); + const tBTM_STATUS status = + get_btm_client_interface().link_policy.BTM_SwitchRoleToCentral(p_scb->PeerAddress()); switch (status) { - case BTM_CMD_STARTED: + case tBTM_STATUS::BTM_CMD_STARTED: break; case BTM_MODE_UNSUPPORTED: case BTM_DEV_RESTRICT_LISTED: diff --git a/system/bta/csis/csis_client.cc b/system/bta/csis/csis_client.cc index 80e015e380..16e5ad0559 100644 --- a/system/bta/csis/csis_client.cc +++ b/system/bta/csis/csis_client.cc @@ -50,6 +50,7 @@ #include "stack/include/bt_types.h" #include "stack/include/btm_ble_sec_api.h" #include "stack/include/btm_client_interface.h" +#include "stack/include/btm_status.h" using base::Closure; using bluetooth::Uuid; @@ -986,7 +987,7 @@ private: CsisGroupLockStatus status) { log::debug("group id: {}, target state {}", csis_group->GetGroupId(), lock ? "lock" : "unlock"); - NotifyGroupStatus(csis_group->GetGroupId(), lock, status, std::move(csis_group->GetLockCb())); + NotifyGroupStatus(csis_group->GetGroupId(), lock, status, csis_group->GetLockCb()); csis_group->SetTargetLockState(CsisLockState::CSIS_STATE_UNSET); } @@ -1279,7 +1280,7 @@ private: devices.push_back(std::move(bda)); } - return std::move(devices); + return devices; } int GetNumOfKnownExpectedDevicesWaitingForBonding(int group_id) { @@ -1843,9 +1844,9 @@ private: break; case BTA_GATTC_ENC_CMPL_CB_EVT: { - uint8_t encryption_status; + tBTM_STATUS encryption_status; if (BTM_IsEncrypted(p_data->enc_cmpl.remote_bda, BT_TRANSPORT_LE)) { - encryption_status = BTM_SUCCESS; + encryption_status = tBTM_STATUS::BTM_SUCCESS; } else { encryption_status = BTM_FAILED_ON_SECURITY; } @@ -1910,7 +1911,7 @@ private: return; } - int result = + tBTM_STATUS result = BTM_SetEncryption(device->addr, BT_TRANSPORT_LE, nullptr, nullptr, BTM_BLE_SEC_ENCRYPT); log::info("Encryption required for {}. Request result: 0x{:02x}", device->addr, result); @@ -2048,7 +2049,7 @@ private: OnCsisNotification(evt.conn_id, evt.handle, evt.len, evt.value); } - void OnLeEncryptionComplete(const RawAddress& address, uint8_t status) { + void OnLeEncryptionComplete(const RawAddress& address, tBTM_STATUS status) { log::info("{}", address); auto device = FindDeviceByAddress(address); if (device == nullptr) { @@ -2056,7 +2057,7 @@ private: return; } - if (status != BTM_SUCCESS) { + if (status != tBTM_STATUS::BTM_SUCCESS) { log::error("encryption failed. status: 0x{:02x}", status); BTA_GATTC_Close(device->conn_id); diff --git a/system/bta/dm/bta_dm_act.cc b/system/bta/dm/bta_dm_act.cc index 56ecb8fb71..15361f3fbc 100644 --- a/system/bta/dm/bta_dm_act.cc +++ b/system/bta/dm/bta_dm_act.cc @@ -59,6 +59,7 @@ #include "stack/include/bt_uuid16.h" #include "stack/include/btm_client_interface.h" #include "stack/include/btm_inq.h" +#include "stack/include/btm_status.h" #include "stack/include/gatt_api.h" #include "stack/include/l2c_api.h" #include "stack/include/main_thread.h" @@ -235,7 +236,7 @@ void BTA_dm_on_hw_on() { log::info("Read default class of device [0x{:x}, 0x{:x}, 0x{:x}]", dev_class[0], dev_class[1], dev_class[2]); - if (get_btm_client_interface().local.BTM_SetDeviceClass(dev_class) != BTM_SUCCESS) { + if (get_btm_client_interface().local.BTM_SetDeviceClass(dev_class) != tBTM_STATUS::BTM_SUCCESS) { log::warn("Unable to set local device class:{}", dev_class_text(dev_class)); } @@ -281,7 +282,7 @@ void BTA_dm_on_hw_on() { the DM_ENABLE_EVT to be sent only after all the init steps are complete */ if (get_btm_client_interface().local.BTM_ReadLocalDeviceNameFromController( - bta_dm_local_name_cback) != BTM_CMD_STARTED) { + bta_dm_local_name_cback) != tBTM_STATUS::BTM_CMD_STARTED) { log::warn("Unable to read local device name from controller"); } @@ -314,10 +315,10 @@ void bta_dm_disable() { /* disable all active subsystems */ bta_sys_disable(); - if (BTM_SetDiscoverability(BTM_NON_DISCOVERABLE) != BTM_SUCCESS) { + if (BTM_SetDiscoverability(BTM_NON_DISCOVERABLE) != tBTM_STATUS::BTM_SUCCESS) { log::warn("Unable to disable classic BR/EDR discoverability"); } - if (BTM_SetConnectability(BTM_NON_CONNECTABLE) != BTM_SUCCESS) { + if (BTM_SetConnectability(BTM_NON_CONNECTABLE) != tBTM_STATUS::BTM_SUCCESS) { log::warn("Unable to disable classic BR/EDR connectability"); } @@ -412,7 +413,7 @@ static void bta_dm_wait_for_acl_to_drain_cback(void* data) { /** Sets local device name */ void bta_dm_set_dev_name(const std::vector<uint8_t>& name) { if (get_btm_client_interface().local.BTM_SetLocalDeviceName((const char*)name.data()) != - BTM_CMD_STARTED) { + tBTM_STATUS::BTM_CMD_STARTED) { log::warn("Unable to set local device name"); } bta_dm_set_eir((char*)name.data()); @@ -448,10 +449,10 @@ bool BTA_DmSetVisibility(bt_scan_mode_t mode) { return false; } - if (BTM_SetDiscoverability(disc_mode_param) != BTM_SUCCESS) { + if (BTM_SetDiscoverability(disc_mode_param) != tBTM_STATUS::BTM_SUCCESS) { log::warn("Unable to set classic BR/EDR discoverability 0x{:04x}", disc_mode_param); } - if (BTM_SetConnectability(conn_mode_param) != BTM_SUCCESS) { + if (BTM_SetConnectability(conn_mode_param) != tBTM_STATUS::BTM_SUCCESS) { log::warn("Unable to set classic BR/EDR connectability 0x{:04x}", conn_mode_param); } return true; @@ -592,6 +593,12 @@ void bta_dm_remove_device(const RawAddress& target) { bredr_connected = get_btm_client_interface().peer.BTM_ReadConnectedTransportAddress( &identity_addr, BT_TRANSPORT_BR_EDR); } + if (pseudo_addr.IsEmpty()) { + pseudo_addr = target; + } + if (identity_addr.IsEmpty()) { + identity_addr = target; + } // Remove from LE allowlist if (!GATT_CancelConnect(0, pseudo_addr, false)) { @@ -603,11 +610,11 @@ void bta_dm_remove_device(const RawAddress& target) { // Disconnect LE transport if (le_connected) { tBTM_STATUS status = btm_remove_acl(pseudo_addr, BT_TRANSPORT_LE); - if (status != BTM_SUCCESS && identity_addr != pseudo_addr) { + if (status != tBTM_STATUS::BTM_SUCCESS && identity_addr != pseudo_addr) { status = btm_remove_acl(identity_addr, BT_TRANSPORT_LE); } - if (status != BTM_SUCCESS) { + if (status != tBTM_STATUS::BTM_SUCCESS) { le_connected = false; log::error("Unable to disconnect LE connection {}", pseudo_addr); } @@ -616,11 +623,11 @@ void bta_dm_remove_device(const RawAddress& target) { // Disconnect BR/EDR transport if (bredr_connected) { tBTM_STATUS status = btm_remove_acl(identity_addr, BT_TRANSPORT_BR_EDR); - if (status != BTM_SUCCESS && identity_addr != pseudo_addr) { + if (status != tBTM_STATUS::BTM_SUCCESS && identity_addr != pseudo_addr) { status = btm_remove_acl(pseudo_addr, BT_TRANSPORT_BR_EDR); } - if (status != BTM_SUCCESS) { + if (status != tBTM_STATUS::BTM_SUCCESS) { bredr_connected = false; log::error("Unable to disconnect BR/EDR connection {}", identity_addr); } @@ -628,7 +635,7 @@ void bta_dm_remove_device(const RawAddress& target) { if (le_connected || bredr_connected) { // Wait for all transports to be disconnected - tBTA_DM_REMOVE_PENDNIG node = {pseudo_addr, target, le_connected, bredr_connected}; + tBTA_DM_REMOVE_PENDNIG node = {pseudo_addr, identity_addr, le_connected, bredr_connected}; bta_dm_cb.pending_removals.push_back(node); log::info( "Waiting for disconnection over LE:{}, BR/EDR:{} for pseudo address: {}, identity " @@ -715,10 +722,10 @@ static void handle_role_change(const RawAddress& bd_addr, tHCI_ROLE new_role, const tBTM_STATUS status = get_btm_client_interface().link_policy.BTM_SwitchRoleToCentral(bd_addr); switch (status) { - case BTM_SUCCESS: + case tBTM_STATUS::BTM_SUCCESS: log::debug("Role policy already set to central peer:{}", bd_addr); break; - case BTM_CMD_STARTED: + case tBTM_STATUS::BTM_CMD_STARTED: log::debug("Role policy started to central peer:{}", bd_addr); break; default: @@ -1016,10 +1023,10 @@ static void bta_dm_check_av() { const tBTM_STATUS status = get_btm_client_interface().link_policy.BTM_SwitchRoleToCentral(p_dev->peer_bdaddr); switch (status) { - case BTM_SUCCESS: + case tBTM_STATUS::BTM_SUCCESS: log::debug("Role policy already set to central peer:{}", p_dev->peer_bdaddr); break; - case BTM_CMD_STARTED: + case tBTM_STATUS::BTM_CMD_STARTED: log::debug("Role policy started to central peer:{}", p_dev->peer_bdaddr); break; default: @@ -1169,11 +1176,11 @@ static void bta_dm_adjust_roles(bool delay_role_switch) { get_btm_client_interface().link_policy.BTM_SwitchRoleToCentral( bta_dm_cb.device_list.peer_device[i].peer_bdaddr); switch (status) { - case BTM_SUCCESS: + case tBTM_STATUS::BTM_SUCCESS: log::debug("Role policy already set to central peer:{}", bta_dm_cb.device_list.peer_device[i].peer_bdaddr); break; - case BTM_CMD_STARTED: + case tBTM_STATUS::BTM_CMD_STARTED: log::debug("Role policy started to central peer:{}", bta_dm_cb.device_list.peer_device[i].peer_bdaddr); break; @@ -1251,7 +1258,7 @@ static void bta_dm_set_eir(char* local_name) { /* if local name is not provided, get it from controller */ if (local_name == NULL) { if (get_btm_client_interface().local.BTM_ReadLocalDeviceName((const char**)&local_name) != - BTM_SUCCESS) { + tBTM_STATUS::BTM_SUCCESS) { log::error("Fail to read local device name for EIR"); } } @@ -1435,7 +1442,7 @@ static void bta_dm_set_eir(char* local_name) { UINT8_TO_STREAM(p, 0); /* terminator of significant part */ } - if (get_btm_client_interface().eir.BTM_WriteEIR(p_buf) != BTM_SUCCESS) { + if (get_btm_client_interface().eir.BTM_WriteEIR(p_buf) != tBTM_STATUS::BTM_SUCCESS) { log::warn("Unable to write EIR data"); } } @@ -1597,7 +1604,8 @@ void bta_dm_ble_set_data_length(const RawAddress& bd_addr) { uint16_t max_len = bluetooth::shim::GetController()->GetLeMaximumDataLength().supported_max_tx_octets_; - if (BTM_SetBleDataLength(bd_addr, max_len) != BTM_SUCCESS) { + if (get_btm_client_interface().ble.BTM_SetBleDataLength(bd_addr, max_len) != + tBTM_STATUS::BTM_SUCCESS) { log::info("Unable to set ble data length:{}", max_len); } } @@ -1692,7 +1700,7 @@ void bta_dm_ble_get_energy_info(tBTA_BLE_ENERGY_INFO_CBACK* p_energy_info_cback) bta_dm_cb.p_energy_info_cback = p_energy_info_cback; tBTM_STATUS btm_status = get_btm_client_interface().ble.BTM_BleGetEnergyInfo(bta_ble_energy_info_cmpl); - if (btm_status != BTM_CMD_STARTED) { + if (btm_status != tBTM_STATUS::BTM_CMD_STARTED) { bta_ble_energy_info_cmpl(0, 0, 0, 0, HCI_ERR_UNSPECIFIED); } } @@ -1789,7 +1797,7 @@ void bta_dm_allow_wake_by_hid(std::vector<RawAddress> classic_hid_devices, // If there are any entries in the classic hid list, we should also make // the adapter connectable for classic. if (classic_hid_devices.size() > 0) { - if (BTM_SetConnectability(BTM_CONNECTABLE) != BTM_SUCCESS) { + if (BTM_SetConnectability(BTM_CONNECTABLE) != tBTM_STATUS::BTM_SUCCESS) { log::warn("Unable to enable classic BR/EDR connectability"); } } diff --git a/system/bta/dm/bta_dm_api.cc b/system/bta/dm/bta_dm_api.cc index 52ecafcbfc..79cd93252a 100644 --- a/system/bta/dm/bta_dm_api.cc +++ b/system/bta/dm/bta_dm_api.cc @@ -54,7 +54,7 @@ void BTA_dm_init() { /* if UUID list is not provided as static data */ bta_sys_eir_register(bta_dm_eir_update_uuid); bta_sys_cust_eir_register(bta_dm_eir_update_cust_uuid); - BTM_SetConsolidationCallback(bta_dm_consolidate); + get_btm_client_interface().ble.BTM_SetConsolidationCallback(bta_dm_consolidate); } /** Enables bluetooth device under test mode */ @@ -140,8 +140,8 @@ tBTA_STATUS BTA_DmSetLocalDiRecord(tSDP_DI_RECORD* p_device_info, uint32_t* p_ha tBTA_STATUS status = BTA_FAILURE; if (bta_dm_di_cb.di_num < BTA_DI_NUM_MAX) { - if (get_legacy_stack_sdp_api()->device_id.SDP_SetLocalDiRecord((tSDP_DI_RECORD*)p_device_info, - p_handle) == SDP_SUCCESS) { + if (get_legacy_stack_sdp_api()->device_id.SDP_SetLocalDiRecord( + (tSDP_DI_RECORD*)p_device_info, p_handle) == tSDP_STATUS::SDP_SUCCESS) { if (!p_device_info->primary_record) { bta_dm_di_cb.di_handle[bta_dm_di_cb.di_num] = *p_handle; bta_dm_di_cb.di_num++; diff --git a/system/bta/dm/bta_dm_device_search.cc b/system/bta/dm/bta_dm_device_search.cc index d4dbe0a5a9..a8e1a16092 100644 --- a/system/bta/dm/bta_dm_device_search.cc +++ b/system/bta/dm/bta_dm_device_search.cc @@ -43,6 +43,7 @@ #include "stack/include/btm_client_interface.h" #include "stack/include/btm_inq.h" #include "stack/include/btm_log_history.h" +#include "stack/include/btm_status.h" #include "stack/include/main_thread.h" #include "stack/rnr/remote_name_request.h" #include "types/raw_address.h" @@ -107,7 +108,7 @@ void bta_dm_disc_disable_search() { * ******************************************************************************/ static void bta_dm_search_start(tBTA_DM_API_SEARCH& search) { - if (get_btm_client_interface().db.BTM_ClearInqDb(nullptr) != BTM_SUCCESS) { + if (get_btm_client_interface().db.BTM_ClearInqDb(nullptr) != tBTM_STATUS::BTM_SUCCESS) { log::warn("Unable to clear inquiry database for device discovery"); } /* save search params */ @@ -115,7 +116,7 @@ static void bta_dm_search_start(tBTA_DM_API_SEARCH& search) { const tBTM_STATUS btm_status = BTM_StartInquiry(bta_dm_inq_results_cb, bta_dm_inq_cmpl_cb); switch (btm_status) { - case BTM_CMD_STARTED: + case tBTM_STATUS::BTM_CMD_STARTED: // Completion callback will be executed when controller inquiry // timer pops or is cancelled by the user break; @@ -147,7 +148,8 @@ static void bta_dm_search_cancel() { /* If no Service Search going on then issue cancel remote name in case it is active */ else if (!bta_dm_search_cb.name_discover_done) { - if (get_btm_client_interface().peer.BTM_CancelRemoteDeviceName() != BTM_CMD_STARTED) { + if (get_btm_client_interface().peer.BTM_CancelRemoteDeviceName() != + tBTM_STATUS::BTM_CMD_STARTED) { log::warn("Unable to cancel RNR"); } /* bta_dm_search_cmpl is called when receiving the remote name cancel evt */ @@ -247,7 +249,7 @@ static void bta_dm_remname_cback(const tBTM_REMOTE_DEV_NAME* p_remote_name) { log::info( "Remote name request complete peer:{} btm_status:{} hci_status:{} " "name[0]:{:c} length:{}", - p_remote_name->bd_addr, btm_status_text(p_remote_name->status), + p_remote_name->bd_addr, btm_status_text(p_remote_name->btm_status), hci_error_code_text(p_remote_name->hci_status), p_remote_name->remote_bd_name[0], strnlen((const char*)p_remote_name->remote_bd_name, BD_NAME_LEN)); @@ -298,11 +300,11 @@ static bool bta_dm_read_remote_device_name(const RawAddress& bd_addr, tBT_TRANSP btm_status = get_btm_client_interface().peer.BTM_ReadRemoteDeviceName( bta_dm_search_cb.peer_bdaddr, bta_dm_remname_cback, transport); - if (btm_status == BTM_CMD_STARTED) { + if (btm_status == tBTM_STATUS::BTM_CMD_STARTED) { log::verbose("BTM_ReadRemoteDeviceName is started"); return true; - } else if (btm_status == BTM_BUSY) { + } else if (btm_status == tBTM_STATUS::BTM_BUSY) { log::verbose("BTM_ReadRemoteDeviceName is busy"); return true; @@ -433,7 +435,8 @@ static void bta_dm_search_cancel_notify() { case BTA_DM_SEARCH_ACTIVE: case BTA_DM_SEARCH_CANCELLING: if (!bta_dm_search_cb.name_discover_done) { - if (get_btm_client_interface().peer.BTM_CancelRemoteDeviceName() != BTM_CMD_STARTED) { + if (get_btm_client_interface().peer.BTM_CancelRemoteDeviceName() != + tBTM_STATUS::BTM_CMD_STARTED) { log::warn("Unable to cancel RNR"); } } @@ -707,7 +710,7 @@ static void bta_dm_start_scan(uint8_t duration_sec) { tBTM_STATUS status = get_btm_client_interface().ble.BTM_BleObserve( true, duration_sec, bta_dm_observe_results_cb, bta_dm_observe_cmpl_cb); - if (status != BTM_CMD_STARTED) { + if (status != tBTM_STATUS::BTM_CMD_STARTED) { log::warn("BTM_BleObserve failed. status {}", status); if (bta_dm_search_cb.p_csis_scan_cback) { tBTA_DM_SEARCH data{.observe_cmpl = {.num_resps = 0}}; @@ -718,7 +721,8 @@ static void bta_dm_start_scan(uint8_t duration_sec) { void bta_dm_ble_scan(bool start, uint8_t duration_sec) { if (!start) { - if (get_btm_client_interface().ble.BTM_BleObserve(false, 0, NULL, NULL) != BTM_CMD_STARTED) { + if (get_btm_client_interface().ble.BTM_BleObserve(false, 0, NULL, NULL) != + tBTM_STATUS::BTM_CMD_STARTED) { log::warn("Unable to start ble observe"); } return; diff --git a/system/bta/dm/bta_dm_disc.cc b/system/bta/dm/bta_dm_disc.cc index 3725ea8841..595cd15e04 100644 --- a/system/bta/dm/bta_dm_disc.cc +++ b/system/bta/dm/bta_dm_disc.cc @@ -32,7 +32,6 @@ #include "bta/dm/bta_dm_disc_int.h" #include "bta/dm/bta_dm_disc_legacy.h" #include "bta/include/bta_gatt_api.h" -#include "com_android_bluetooth_flags.h" #include "common/circular_buffer.h" #include "common/strings.h" #include "internal_include/bt_target.h" @@ -172,6 +171,10 @@ void bta_dm_disc_gatt_cancel_open(const RawAddress& bd_addr) { return; } get_gatt_interface().BTA_GATTC_CancelOpen(0, bd_addr, false); + if (com::android::bluetooth::flags::cancel_open_discovery_client() && + bta_dm_discovery_cb.client_if != BTA_GATTS_INVALID_IF) { + get_gatt_interface().BTA_GATTC_CancelOpen(bta_dm_discovery_cb.client_if, bd_addr, true); + } } void bta_dm_disc_gatt_refresh(const RawAddress& bd_addr) { @@ -189,7 +192,7 @@ void bta_dm_disc_remove_device(const RawAddress& bd_addr) { } if (bta_dm_discovery_cb.service_discovery_state == BTA_DM_DISCOVER_ACTIVE && bta_dm_discovery_cb.peer_bdaddr == bd_addr) { - log::info("Device removed while service discovery was pending, conclude the service disvovery"); + log::info("Device removed while service discovery was pending, conclude the service discovery"); bta_dm_gatt_disc_complete((uint16_t)GATT_INVALID_CONN_ID, (tGATT_STATUS)GATT_ERROR); } } @@ -536,7 +539,7 @@ static void bta_dm_gatt_disc_complete(uint16_t conn_id, tGATT_STATUS status) { if (com::android::bluetooth::flags::bta_dm_discover_both() && sdp_pending && !le_pending) { /* LE Service discovery finished, and services were reported, but SDP is not * finished yet. gatt_close_timer closed the connection, and we received - * this callback because of disconnnection */ + * this callback because of disconnection */ return; } @@ -575,9 +578,13 @@ static void bta_dm_gatt_disc_complete(uint16_t conn_id, tGATT_STATUS status) { bta_dm_disc_sm_execute(BTA_DM_DISC_CLOSE_TOUT_EVT, nullptr); } } else { - bta_dm_discovery_cb.conn_id = GATT_INVALID_CONN_ID; - log::info("Discovery complete for invalid conn ID. Will pick up next job"); + + if (com::android::bluetooth::flags::cancel_open_discovery_client()) { + bta_dm_close_gatt_conn(); + } else { + bta_dm_discovery_cb.conn_id = GATT_INVALID_CONN_ID; + } bta_dm_discovery_set_state(BTA_DM_DISCOVER_IDLE); bta_dm_execute_queued_discovery_request(); } diff --git a/system/bta/dm/bta_dm_disc_legacy.cc b/system/bta/dm/bta_dm_disc_legacy.cc index bac7945ed1..f1aa6b09a5 100644 --- a/system/bta/dm/bta_dm_disc_legacy.cc +++ b/system/bta/dm/bta_dm_disc_legacy.cc @@ -33,7 +33,6 @@ #include "bta/include/bta_gatt_api.h" #include "bta/include/bta_sdp_api.h" #include "btif/include/btif_config.h" -#include "com_android_bluetooth_flags.h" #include "common/circular_buffer.h" #include "common/strings.h" #include "device/include/interop.h" @@ -50,6 +49,7 @@ #include "stack/include/btm_client_interface.h" #include "stack/include/btm_inq.h" #include "stack/include/btm_log_history.h" +#include "stack/include/btm_status.h" #include "stack/include/gap_api.h" // GAP_BleReadPeerPrefConnParams #include "stack/include/hidh_api.h" #include "stack/include/main_thread.h" @@ -195,6 +195,10 @@ void bta_dm_disc_disable_search_and_disc() { bta_dm_disable_search_and_disc(); } void bta_dm_disc_gatt_cancel_open(const RawAddress& bd_addr) { get_gatt_interface().BTA_GATTC_CancelOpen(0, bd_addr, false); + if (com::android::bluetooth::flags::cancel_open_discovery_client() && + bta_dm_search_cb.client_if != BTA_GATTS_INVALID_IF) { + get_gatt_interface().BTA_GATTC_CancelOpen(bta_dm_search_cb.client_if, bd_addr, true); + } } void bta_dm_disc_gatt_refresh(const RawAddress& bd_addr) { @@ -203,7 +207,7 @@ void bta_dm_disc_gatt_refresh(const RawAddress& bd_addr) { void bta_dm_disc_remove_device(const RawAddress& bd_addr) { if (bta_dm_search_cb.state == BTA_DM_DISCOVER_ACTIVE && bta_dm_search_cb.peer_bdaddr == bd_addr) { - log::info("Device removed while service discovery was pending, conclude the service disvovery"); + log::info("Device removed while service discovery was pending, conclude the service discovery"); bta_dm_gatt_disc_complete((uint16_t)GATT_INVALID_CONN_ID, (tGATT_STATUS)GATT_ERROR); } } @@ -212,10 +216,6 @@ void bta_dm_disc_discover_next_device() { bta_dm_discover_next_device(); } void bta_dm_disc_gattc_register() { bta_dm_gattc_register(); } -static void bta_dm_observe_results_cb(tBTM_INQ_RESULTS* p_inq, const uint8_t* p_eir, - uint16_t eir_len); -static void bta_dm_observe_cmpl_cb(void* p_result); - const uint16_t bta_service_id_to_uuid_lkup_tbl[BTA_MAX_SERVICE_ID] = { UUID_SERVCLASS_PNP_INFORMATION, /* Reserved */ UUID_SERVCLASS_SERIAL_PORT, /* BTA_SPP_SERVICE_ID */ @@ -268,7 +268,7 @@ static tBTA_DM_STATE bta_dm_search_get_state() { return bta_dm_search_cb.state; static void bta_dm_search_start(tBTA_DM_API_SEARCH& search) { bta_dm_gattc_register(); - if (get_btm_client_interface().db.BTM_ClearInqDb(nullptr) != BTM_SUCCESS) { + if (get_btm_client_interface().db.BTM_ClearInqDb(nullptr) != tBTM_STATUS::BTM_SUCCESS) { log::warn("Unable to clear inquiry db for device discovery"); } @@ -277,7 +277,7 @@ static void bta_dm_search_start(tBTA_DM_API_SEARCH& search) { const tBTM_STATUS btm_status = BTM_StartInquiry(bta_dm_inq_results_cb, bta_dm_inq_cmpl_cb); switch (btm_status) { - case BTM_CMD_STARTED: + case tBTM_STATUS::BTM_CMD_STARTED: // Completion callback will be executed when controller inquiry // timer pops or is cancelled by the user break; @@ -309,7 +309,8 @@ static void bta_dm_search_cancel() { /* If no Service Search going on then issue cancel remote name in case it is active */ else if (!bta_dm_search_cb.name_discover_done) { - if (get_btm_client_interface().peer.BTM_CancelRemoteDeviceName() != BTM_CMD_STARTED) { + if (get_btm_client_interface().peer.BTM_CancelRemoteDeviceName() != + tBTM_STATUS::BTM_CMD_STARTED) { log::warn("Unable to cancel RNR"); } /* bta_dm_search_cmpl is called when receiving the remote name cancel evt */ @@ -394,11 +395,11 @@ static bool bta_dm_read_remote_device_name(const RawAddress& bd_addr, tBT_TRANSP btm_status = get_btm_client_interface().peer.BTM_ReadRemoteDeviceName( bta_dm_search_cb.peer_bdaddr, bta_dm_remname_cback, transport); - if (btm_status == BTM_CMD_STARTED) { + if (btm_status == tBTM_STATUS::BTM_CMD_STARTED) { log::verbose("BTM_ReadRemoteDeviceName is started"); return true; - } else if (btm_status == BTM_BUSY) { + } else if (btm_status == tBTM_STATUS::BTM_BUSY) { log::verbose("BTM_ReadRemoteDeviceName is busy"); /* Remote name discovery is on going now so BTM cannot notify through @@ -588,8 +589,9 @@ static void bta_dm_sdp_result(tBTA_DM_SDP_RESULT& sdp_event) { const tSDP_RESULT sdp_result = sdp_event.sdp_result; - if ((sdp_event.sdp_result == SDP_SUCCESS) || (sdp_event.sdp_result == SDP_NO_RECS_MATCH) || - (sdp_event.sdp_result == SDP_DB_FULL)) { + if ((sdp_event.sdp_result == tSDP_STATUS::SDP_SUCCESS) || + (sdp_event.sdp_result == tSDP_STATUS::SDP_NO_RECS_MATCH) || + (sdp_event.sdp_result == tSDP_STATUS::SDP_DB_FULL)) { log::verbose("sdp_result::0x{:x}", sdp_event.sdp_result); do { p_sdp_rec = NULL; @@ -680,7 +682,7 @@ static void bta_dm_sdp_result(tBTA_DM_SDP_RESULT& sdp_event) { #if TARGET_FLOSS tSDP_DI_GET_RECORD di_record; if (get_legacy_stack_sdp_api()->device_id.SDP_GetDiRecord( - 1, &di_record, bta_dm_search_cb.p_sdp_db) == SDP_SUCCESS) { + 1, &di_record, bta_dm_search_cb.p_sdp_db) == tSDP_STATUS::SDP_SUCCESS) { bta_dm_search_cb.service_search_cbacks.on_did_received( bta_dm_search_cb.peer_bdaddr, di_record.rec.vendor_id_source, di_record.rec.vendor, di_record.rec.product, di_record.rec.version); @@ -743,7 +745,7 @@ static void bta_dm_sdp_result(tBTA_DM_SDP_RESULT& sdp_event) { BTM_LogHistory(kBtmLogTag, bta_dm_search_cb.peer_bdaddr, "Discovery failed", base::StringPrintf("Result:%s", sdp_result_text(sdp_result).c_str())); log::error("SDP connection failed {}", sdp_status_text(sdp_result)); - if (sdp_event.sdp_result == SDP_CONN_FAILED) { + if (sdp_event.sdp_result == tSDP_STATUS::SDP_CONN_FAILED) { bta_dm_search_cb.wait_disc = false; } @@ -993,7 +995,8 @@ static void bta_dm_search_cancel_notify() { case BTA_DM_SEARCH_ACTIVE: case BTA_DM_SEARCH_CANCELLING: if (!bta_dm_search_cb.name_discover_done) { - if (get_btm_client_interface().peer.BTM_CancelRemoteDeviceName() != BTM_CMD_STARTED) { + if (get_btm_client_interface().peer.BTM_CancelRemoteDeviceName() != + tBTM_STATUS::BTM_CMD_STARTED) { log::warn("Unable to cancel RNR"); } } @@ -1383,17 +1386,17 @@ static void bta_dm_service_search_remname_cback(const RawAddress& bd_addr, DEV_C if (bta_dm_search_cb.peer_bdaddr == bd_addr) { rem_name.bd_addr = bd_addr; bd_name_copy(rem_name.remote_bd_name, bd_name); - rem_name.status = BTM_SUCCESS; + rem_name.btm_status = tBTM_STATUS::BTM_SUCCESS; rem_name.hci_status = HCI_SUCCESS; bta_dm_remname_cback(&rem_name); } else { /* get name of device */ btm_status = get_btm_client_interface().peer.BTM_ReadRemoteDeviceName( bta_dm_search_cb.peer_bdaddr, bta_dm_remname_cback, BT_TRANSPORT_BR_EDR); - if (btm_status == BTM_BUSY) { + if (btm_status == tBTM_STATUS::BTM_BUSY) { /* wait for next chance(notification of remote name discovery done) */ log::verbose("BTM_ReadRemoteDeviceName is busy"); - } else if (btm_status != BTM_CMD_STARTED) { + } else if (btm_status != tBTM_STATUS::BTM_CMD_STARTED) { /* if failed to start getting remote name then continue */ log::warn("BTM_ReadRemoteDeviceName returns 0x{:02X}", btm_status); @@ -1401,7 +1404,7 @@ static void bta_dm_service_search_remname_cback(const RawAddress& bd_addr, DEV_C // actual peer_bdaddr rem_name.bd_addr = bta_dm_search_cb.peer_bdaddr; rem_name.remote_bd_name[0] = 0; - rem_name.status = btm_status; + rem_name.btm_status = btm_status; rem_name.hci_status = HCI_SUCCESS; bta_dm_remname_cback(&rem_name); } @@ -1422,7 +1425,7 @@ static void bta_dm_remname_cback(const tBTM_REMOTE_DEV_NAME* p_remote_name) { log::info( "Remote name request complete peer:{} btm_status:{} hci_status:{} name[0]:{:c} length:{}", - p_remote_name->bd_addr, btm_status_text(p_remote_name->status), + p_remote_name->bd_addr, btm_status_text(p_remote_name->btm_status), hci_error_code_text(p_remote_name->hci_status), p_remote_name->remote_bd_name[0], strnlen((const char*)p_remote_name->remote_bd_name, BD_NAME_LEN)); @@ -1486,164 +1489,6 @@ const char* bta_dm_get_remname(void) { return p_name; } -/******************************************************************************* - * - * Function bta_dm_observe_results_cb - * - * Description Callback for BLE Observe result - * - * - * Returns void - * - ******************************************************************************/ -static void bta_dm_observe_results_cb(tBTM_INQ_RESULTS* p_inq, const uint8_t* p_eir, - uint16_t eir_len) { - tBTA_DM_SEARCH result; - tBTM_INQ_INFO* p_inq_info; - log::verbose("bta_dm_observe_results_cb"); - - result.inq_res.bd_addr = p_inq->remote_bd_addr; - result.inq_res.original_bda = p_inq->original_bda; - result.inq_res.rssi = p_inq->rssi; - result.inq_res.ble_addr_type = p_inq->ble_addr_type; - result.inq_res.inq_result_type = p_inq->inq_result_type; - result.inq_res.device_type = p_inq->device_type; - result.inq_res.flag = p_inq->flag; - result.inq_res.ble_evt_type = p_inq->ble_evt_type; - result.inq_res.ble_primary_phy = p_inq->ble_primary_phy; - result.inq_res.ble_secondary_phy = p_inq->ble_secondary_phy; - result.inq_res.ble_advertising_sid = p_inq->ble_advertising_sid; - result.inq_res.ble_tx_power = p_inq->ble_tx_power; - result.inq_res.ble_periodic_adv_int = p_inq->ble_periodic_adv_int; - - /* application will parse EIR to find out remote device name */ - result.inq_res.p_eir = const_cast<uint8_t*>(p_eir); - result.inq_res.eir_len = eir_len; - - p_inq_info = get_btm_client_interface().db.BTM_InqDbRead(p_inq->remote_bd_addr); - if (p_inq_info != NULL) { - /* initialize remt_name_not_required to false so that we get the name by - * default */ - result.inq_res.remt_name_not_required = false; - } - - if (p_inq_info) { - /* application indicates if it knows the remote name, inside the callback - copy that to the inquiry data base*/ - if (result.inq_res.remt_name_not_required) { - p_inq_info->appl_knows_rem_name = true; - } - } -} - -/******************************************************************************* - * - * Function bta_dm_opportunistic_observe_results_cb - * - * Description Callback for BLE Observe result - * - * - * Returns void - * - ******************************************************************************/ -static void bta_dm_opportunistic_observe_results_cb(tBTM_INQ_RESULTS* p_inq, const uint8_t* p_eir, - uint16_t eir_len) { - tBTA_DM_SEARCH result; - tBTM_INQ_INFO* p_inq_info; - - result.inq_res.bd_addr = p_inq->remote_bd_addr; - result.inq_res.rssi = p_inq->rssi; - result.inq_res.ble_addr_type = p_inq->ble_addr_type; - result.inq_res.inq_result_type = p_inq->inq_result_type; - result.inq_res.device_type = p_inq->device_type; - result.inq_res.flag = p_inq->flag; - result.inq_res.ble_evt_type = p_inq->ble_evt_type; - result.inq_res.ble_primary_phy = p_inq->ble_primary_phy; - result.inq_res.ble_secondary_phy = p_inq->ble_secondary_phy; - result.inq_res.ble_advertising_sid = p_inq->ble_advertising_sid; - result.inq_res.ble_tx_power = p_inq->ble_tx_power; - result.inq_res.ble_periodic_adv_int = p_inq->ble_periodic_adv_int; - - /* application will parse EIR to find out remote device name */ - result.inq_res.p_eir = const_cast<uint8_t*>(p_eir); - result.inq_res.eir_len = eir_len; - - p_inq_info = get_btm_client_interface().db.BTM_InqDbRead(p_inq->remote_bd_addr); - if (p_inq_info != NULL) { - /* initialize remt_name_not_required to false so that we get the name by - * default */ - result.inq_res.remt_name_not_required = false; - } - - if (bta_dm_search_cb.p_csis_scan_cback) { - bta_dm_search_cb.p_csis_scan_cback(BTA_DM_INQ_RES_EVT, &result); - } - - if (p_inq_info) { - /* application indicates if it knows the remote name, inside the callback - copy that to the inquiry data base*/ - if (result.inq_res.remt_name_not_required) { - p_inq_info->appl_knows_rem_name = true; - } - } -} - -/******************************************************************************* - * - * Function bta_dm_observe_cmpl_cb - * - * Description Callback for BLE Observe complete - * - * - * Returns void - * - ******************************************************************************/ -static void bta_dm_observe_cmpl_cb(void* p_result) { - log::verbose("bta_dm_observe_cmpl_cb"); - - if (bta_dm_search_cb.p_csis_scan_cback) { - auto num_resps = ((tBTM_INQUIRY_CMPL*)p_result)->num_resp; - tBTA_DM_SEARCH data{.observe_cmpl{.num_resps = num_resps}}; - bta_dm_search_cb.p_csis_scan_cback(BTA_DM_OBSERVE_CMPL_EVT, &data); - } -} - -static void bta_dm_start_scan(uint8_t duration_sec) { - tBTM_STATUS status = get_btm_client_interface().ble.BTM_BleObserve( - true, duration_sec, bta_dm_observe_results_cb, bta_dm_observe_cmpl_cb); - - if (status != BTM_CMD_STARTED) { - log::warn("BTM_BleObserve failed. status {}", status); - if (bta_dm_search_cb.p_csis_scan_cback) { - tBTA_DM_SEARCH data{.observe_cmpl = {.num_resps = 0}}; - bta_dm_search_cb.p_csis_scan_cback(BTA_DM_OBSERVE_CMPL_EVT, &data); - } - } -} - -void bta_dm_ble_scan(bool start, uint8_t duration_sec) { - if (!start) { - if (get_btm_client_interface().ble.BTM_BleObserve(false, 0, NULL, NULL) != BTM_CMD_STARTED) { - log::warn("Unable to stop ble observe"); - } - return; - } - - bta_dm_start_scan(duration_sec); -} - -void bta_dm_ble_csis_observe(bool observe, tBTA_DM_SEARCH_CBACK* p_cback) { - if (!observe) { - bta_dm_search_cb.p_csis_scan_cback = NULL; - BTM_BleOpportunisticObserve(false, NULL); - return; - } - - /* Save the callback to be called when a scan results are available */ - bta_dm_search_cb.p_csis_scan_cback = p_cback; - BTM_BleOpportunisticObserve(true, bta_dm_opportunistic_observe_results_cb); -} - #ifndef BTA_DM_GATT_CLOSE_DELAY_TOUT #define BTA_DM_GATT_CLOSE_DELAY_TOUT 1000 #endif @@ -1723,9 +1568,12 @@ static void bta_dm_gatt_disc_complete(uint16_t conn_id, tGATT_STATUS status) { bta_dm_search_sm_execute(BTA_DM_DISC_CLOSE_TOUT_EVT, nullptr); } } else { - bta_dm_search_cb.conn_id = GATT_INVALID_CONN_ID; - log::info("Discovery complete for invalid conn ID. Will pick up next job"); + if (com::android::bluetooth::flags::cancel_open_discovery_client()) { + bta_dm_close_gatt_conn(); + } else { + bta_dm_search_cb.conn_id = GATT_INVALID_CONN_ID; + } bta_dm_search_set_state(BTA_DM_SEARCH_IDLE); bta_dm_free_sdp_db(); bta_dm_execute_queued_request(); @@ -2214,16 +2062,7 @@ void bta_dm_find_services(const RawAddress& bd_addr) { } void bta_dm_inq_cmpl() { ::bta_dm_disc_legacy::bta_dm_inq_cmpl(); } void bta_dm_inq_cmpl_cb(void* p_result) { ::bta_dm_disc_legacy::bta_dm_inq_cmpl_cb(p_result); } -void bta_dm_observe_cmpl_cb(void* p_result) { - ::bta_dm_disc_legacy::bta_dm_observe_cmpl_cb(p_result); -} -void bta_dm_observe_results_cb(tBTM_INQ_RESULTS* p_inq, const uint8_t* p_eir, uint16_t eir_len) { - ::bta_dm_disc_legacy::bta_dm_observe_results_cb(p_inq, p_eir, eir_len); -} -void bta_dm_opportunistic_observe_results_cb(tBTM_INQ_RESULTS* p_inq, const uint8_t* p_eir, - uint16_t eir_len) { - ::bta_dm_disc_legacy::bta_dm_opportunistic_observe_results_cb(p_inq, p_eir, eir_len); -} + void bta_dm_queue_search(tBTA_DM_API_SEARCH& search) { ::bta_dm_disc_legacy::bta_dm_queue_search(search); } @@ -2232,10 +2071,6 @@ void bta_dm_service_search_remname_cback(const RawAddress& bd_addr, DEV_CLASS dc ::bta_dm_disc_legacy::bta_dm_service_search_remname_cback(bd_addr, dc, bd_name); } -void bta_dm_start_scan(uint8_t duration_sec) { - ::bta_dm_disc_legacy::bta_dm_start_scan(duration_sec); -} - void store_avrcp_profile_feature(tSDP_DISC_REC* sdp_rec) { ::bta_dm_disc_legacy::store_avrcp_profile_feature(sdp_rec); } diff --git a/system/bta/dm/bta_dm_disc_legacy.h b/system/bta/dm/bta_dm_disc_legacy.h index 354194abe7..724c7f94bd 100644 --- a/system/bta/dm/bta_dm_disc_legacy.h +++ b/system/bta/dm/bta_dm_disc_legacy.h @@ -46,10 +46,6 @@ void bta_dm_disc_acl_down(const RawAddress& bd_addr, tBT_TRANSPORT transport); // Return most recent remote name const char* bta_dm_get_remname(void); -// LE observe and scan interface -void bta_dm_ble_scan(bool start, uint8_t duration_sec); -void bta_dm_ble_csis_observe(bool observe, tBTA_DM_SEARCH_CBACK* p_cback); - // Checks if there is a device discovery request queued bool bta_dm_is_search_request_queued(); diff --git a/system/bta/dm/bta_dm_disc_sdp.cc b/system/bta/dm/bta_dm_disc_sdp.cc index f90bf99d98..bd3a62492e 100644 --- a/system/bta/dm/bta_dm_disc_sdp.cc +++ b/system/bta/dm/bta_dm_disc_sdp.cc @@ -163,8 +163,8 @@ void bta_dm_sdp_result(tSDP_STATUS sdp_result, tBTA_DM_SDP_STATE* sdp_state) { std::vector<Uuid> uuid_list; tSDP_DISCOVERY_DB* p_sdp_db = (tSDP_DISCOVERY_DB*)sdp_state->sdp_db_buffer; - if ((sdp_result == SDP_SUCCESS) || (sdp_result == SDP_NO_RECS_MATCH) || - (sdp_result == SDP_DB_FULL)) { + if ((sdp_result == tSDP_STATUS::SDP_SUCCESS) || (sdp_result == tSDP_STATUS::SDP_NO_RECS_MATCH) || + (sdp_result == tSDP_STATUS::SDP_DB_FULL)) { log::verbose("sdp_result::0x{:x}", sdp_result); std::vector<Uuid> gatt_uuids; do { @@ -241,7 +241,7 @@ void bta_dm_sdp_result(tSDP_STATUS sdp_result, tBTA_DM_SDP_STATE* sdp_state) { #if TARGET_FLOSS tSDP_DI_GET_RECORD di_record; if (get_legacy_stack_sdp_api()->device_id.SDP_GetDiRecord(1, &di_record, p_sdp_db) == - SDP_SUCCESS) { + tSDP_STATUS::SDP_SUCCESS) { bta_dm_sdp_received_di(sdp_state->bd_addr, di_record); } #endif diff --git a/system/bta/dm/bta_dm_pm.cc b/system/bta/dm/bta_dm_pm.cc index 90c0225eda..d43a141dd4 100644 --- a/system/bta/dm/bta_dm_pm.cc +++ b/system/bta/dm/bta_dm_pm.cc @@ -43,6 +43,7 @@ #include "osi/include/properties.h" #include "stack/include/acl_api.h" #include "stack/include/btm_client_interface.h" +#include "stack/include/btm_status.h" #include "stack/include/main_thread.h" #include "types/raw_address.h" @@ -99,7 +100,8 @@ void bta_dm_init_pm(void) { bta_sys_sniff_register(bta_dm_sniff_cback); if (get_btm_client_interface().lifecycle.BTM_PmRegister((BTM_PM_REG_SET), &bta_dm_cb.pm_id, - bta_dm_pm_btm_cback) != BTM_SUCCESS) { + bta_dm_pm_btm_cback) != + tBTM_STATUS::BTM_SUCCESS) { log::warn("Unable to initialize BTM power manager"); }; } @@ -123,8 +125,8 @@ void bta_dm_init_pm(void) { * ******************************************************************************/ void bta_dm_disable_pm(void) { - if (get_btm_client_interface().lifecycle.BTM_PmRegister(BTM_PM_DEREG, &bta_dm_cb.pm_id, - bta_dm_pm_btm_cback) != BTM_SUCCESS) { + if (get_btm_client_interface().lifecycle.BTM_PmRegister( + BTM_PM_DEREG, &bta_dm_cb.pm_id, bta_dm_pm_btm_cback) != tBTM_STATUS::BTM_SUCCESS) { log::warn("Unable to terminate BTM power manager"); } @@ -552,7 +554,7 @@ static void bta_dm_pm_cback(tBTA_SYS_CONN_STATUS status, const tBTA_SYS_ID id, u if (status == BTA_SYS_SCO_OPEN) { log::verbose("SCO inactive, reset SSR to zero"); if (get_btm_client_interface().link_policy.BTM_SetSsrParams(peer_addr, 0, 0, 0) != - BTM_SUCCESS) { + tBTM_STATUS::BTM_SUCCESS) { log::warn("Unable to set link into sniff mode peer:{}", peer_addr); } } else if (status == BTA_SYS_SCO_CLOSE) { @@ -761,7 +763,7 @@ static bool bta_dm_pm_park(const RawAddress& peer_addr) { if (mode != BTM_PM_MD_PARK) { tBTM_STATUS status = get_btm_client_interface().link_policy.BTM_SetPowerMode( bta_dm_cb.pm_id, peer_addr, &p_bta_dm_pm_md[BTA_DM_PM_PARK_IDX]); - if (status == BTM_CMD_STORED || status == BTM_CMD_STARTED) { + if (status == BTM_CMD_STORED || status == tBTM_STATUS::BTM_CMD_STARTED) { return true; } log::warn("Unable to set park power mode"); @@ -864,11 +866,11 @@ static void bta_dm_pm_sniff(tBTA_DM_PEER_DEVICE* p_peer_dev, uint8_t index) { } status = get_btm_client_interface().link_policy.BTM_SetPowerMode( bta_dm_cb.pm_id, p_peer_dev->peer_bdaddr, &pwr_md); - if (status == BTM_CMD_STORED || status == BTM_CMD_STARTED) { + if (status == BTM_CMD_STORED || status == tBTM_STATUS::BTM_CMD_STARTED) { p_peer_dev->reset_sniff_flags(); p_peer_dev->set_sniff_command_sent(); - } else if (status == BTM_SUCCESS) { - log::verbose("bta_dm_pm_sniff BTM_SetPowerMode() returns BTM_SUCCESS"); + } else if (status == tBTM_STATUS::BTM_SUCCESS) { + log::verbose("bta_dm_pm_sniff BTM_SetPowerMode() returns tBTM_STATUS::BTM_SUCCESS"); p_peer_dev->reset_sniff_flags(); } else { log::error("Unable to set power mode peer:{} status:{}", p_peer_dev->peer_bdaddr, @@ -954,7 +956,7 @@ static void bta_dm_pm_ssr(const RawAddress& peer_addr, const int ssr) { /* set the SSR parameters. */ if (get_btm_client_interface().link_policy.BTM_SetSsrParams( peer_addr, p_spec->max_lat, p_spec->min_rmt_to, p_spec->min_loc_to) != - BTM_SUCCESS) { + tBTM_STATUS::BTM_SUCCESS) { log::warn("Unable to set link into sniff mode peer:{}", peer_addr); } } @@ -981,10 +983,10 @@ void bta_dm_pm_active(const RawAddress& peer_addr) { case BTM_CMD_STORED: log::debug("Active power mode stored for execution later for remote:{}", peer_addr); break; - case BTM_CMD_STARTED: + case tBTM_STATUS::BTM_CMD_STARTED: log::debug("Active power mode started for remote:{}", peer_addr); break; - case BTM_SUCCESS: + case tBTM_STATUS::BTM_SUCCESS: log::debug("Active power mode already set for device:{}", peer_addr); break; default: diff --git a/system/bta/dm/bta_dm_sec.cc b/system/bta/dm/bta_dm_sec.cc index 6eae6b9935..1f6b150afe 100644 --- a/system/bta/dm/bta_dm_sec.cc +++ b/system/bta/dm/bta_dm_sec.cc @@ -39,13 +39,13 @@ using namespace bluetooth; static tBTM_STATUS bta_dm_sp_cback(tBTM_SP_EVT event, tBTM_SP_EVT_DATA* p_data); -static uint8_t bta_dm_ble_smp_cback(tBTM_LE_EVT event, const RawAddress& bda, - tBTM_LE_EVT_DATA* p_data); -static uint8_t bta_dm_new_link_key_cback(const RawAddress& bd_addr, DEV_CLASS dev_class, - BD_NAME bd_name, const LinkKey& key, uint8_t key_type, - bool is_ctkd); -static uint8_t bta_dm_pin_cback(const RawAddress& bd_addr, DEV_CLASS dev_class, - const BD_NAME bd_name, bool min_16_digit); +static tBTM_STATUS bta_dm_ble_smp_cback(tBTM_LE_EVT event, const RawAddress& bda, + tBTM_LE_EVT_DATA* p_data); +static tBTM_STATUS bta_dm_new_link_key_cback(const RawAddress& bd_addr, DEV_CLASS dev_class, + BD_NAME bd_name, const LinkKey& key, uint8_t key_type, + bool is_ctkd); +static tBTM_STATUS bta_dm_pin_cback(const RawAddress& bd_addr, DEV_CLASS dev_class, + const BD_NAME bd_name, bool min_16_digit); static tBTM_STATUS bta_dm_sirk_verifiction_cback(const RawAddress& bd_addr); static void bta_dm_authentication_complete_cback(const RawAddress& bd_addr, DEV_CLASS dev_class, BD_NAME bd_name, tHCI_REASON result); @@ -80,7 +80,7 @@ void bta_dm_ble_sirk_sec_cb_register(tBTA_DM_SEC_CBACK* p_cback) { void bta_dm_ble_sirk_confirm_device_reply(const RawAddress& bd_addr, bool accept) { log::debug("addr:{}", bd_addr); get_btm_client_interface().security.BTM_BleSirkConfirmDeviceReply( - bd_addr, accept ? BTM_SUCCESS : BTM_NOT_AUTHORIZED); + bd_addr, accept ? tBTM_STATUS::BTM_SUCCESS : BTM_NOT_AUTHORIZED); } void bta_dm_consolidate(const RawAddress& identity_addr, const RawAddress& rpa) { @@ -125,7 +125,7 @@ void bta_dm_bond(const RawAddress& bd_addr, tBLE_ADDR_TYPE addr_type, tBT_TRANSP tBTM_STATUS status = get_btm_client_interface().security.BTM_SecBond(bd_addr, addr_type, transport, device_type); - if (bta_dm_sec_cb.p_sec_cback && (status != BTM_CMD_STARTED)) { + if (bta_dm_sec_cb.p_sec_cback && (status != tBTM_STATUS::BTM_CMD_STARTED)) { memset(&sec_event, 0, sizeof(tBTA_DM_SEC)); sec_event.auth_cmpl.bd_addr = bd_addr; bd_name_from_char_pointer(sec_event.auth_cmpl.bd_name, @@ -136,7 +136,7 @@ void bta_dm_bond(const RawAddress& bd_addr, tBLE_ADDR_TYPE addr_type, tBT_TRANSP sec_event.auth_cmpl.success = false; */ sec_event.auth_cmpl.fail_reason = HCI_ERR_ILLEGAL_COMMAND; - if (status == BTM_SUCCESS) { + if (status == tBTM_STATUS::BTM_SUCCESS) { sec_event.auth_cmpl.success = true; } else { /* delete this device entry from Sec Dev DB */ @@ -155,7 +155,8 @@ void bta_dm_bond_cancel(const RawAddress& bd_addr) { status = get_btm_client_interface().security.BTM_SecBondCancel(bd_addr); - if (bta_dm_sec_cb.p_sec_cback && (status != BTM_CMD_STARTED && status != BTM_SUCCESS)) { + if (bta_dm_sec_cb.p_sec_cback && + (status != tBTM_STATUS::BTM_CMD_STARTED && status != tBTM_STATUS::BTM_SUCCESS)) { sec_event.bond_cancel_cmpl.result = BTA_FAILURE; bta_dm_sec_cb.p_sec_cback(BTA_DM_BOND_CANCEL_CMPL_EVT, &sec_event); @@ -165,8 +166,8 @@ void bta_dm_bond_cancel(const RawAddress& bd_addr) { /** Send the pin_reply to a request from BTM */ void bta_dm_pin_reply(std::unique_ptr<tBTA_DM_API_PIN_REPLY> msg) { if (msg->accept) { - get_btm_client_interface().security.BTM_PINCodeReply(msg->bd_addr, BTM_SUCCESS, msg->pin_len, - msg->p_pin); + get_btm_client_interface().security.BTM_PINCodeReply(msg->bd_addr, tBTM_STATUS::BTM_SUCCESS, + msg->pin_len, msg->p_pin); } else { get_btm_client_interface().security.BTM_PINCodeReply(msg->bd_addr, BTM_NOT_AUTHORIZED, 0, NULL); } @@ -175,13 +176,14 @@ void bta_dm_pin_reply(std::unique_ptr<tBTA_DM_API_PIN_REPLY> msg) { /** Send the user confirm request reply in response to a request from BTM */ void bta_dm_confirm(const RawAddress& bd_addr, bool accept) { get_btm_client_interface().security.BTM_SecConfirmReqReply( - accept ? BTM_SUCCESS : BTM_NOT_AUTHORIZED, BT_TRANSPORT_BR_EDR, bd_addr); + accept ? tBTM_STATUS::BTM_SUCCESS : BTM_NOT_AUTHORIZED, BT_TRANSPORT_BR_EDR, bd_addr); } /** respond to the OOB data request for the remote device from BTM */ void bta_dm_ci_rmt_oob_act(std::unique_ptr<tBTA_DM_CI_RMT_OOB> msg) { get_btm_client_interface().security.BTM_RemoteOobDataReply( - msg->accept ? BTM_SUCCESS : BTM_NOT_AUTHORIZED, msg->bd_addr, msg->c, msg->r); + msg->accept ? tBTM_STATUS::BTM_SUCCESS : BTM_NOT_AUTHORIZED, msg->bd_addr, msg->c, + msg->r); } /******************************************************************************* @@ -204,7 +206,7 @@ static void bta_dm_pinname_cback(const tBTM_REMOTE_DEV_NAME* p_data) { sec_event.cfm_req.dev_class = bta_dm_sec_cb.pin_dev_class; log::info("CoD: sec_event.cfm_req.dev_class = {}", dev_class_text(sec_event.cfm_req.dev_class)); - if (p_result && p_result->status == BTM_SUCCESS) { + if (p_result && p_result->btm_status == tBTM_STATUS::BTM_SUCCESS) { bd_name_copy(sec_event.cfm_req.bd_name, p_result->remote_bd_name); } else { /* No name found */ sec_event.cfm_req.bd_name[0] = 0; @@ -225,7 +227,7 @@ static void bta_dm_pinname_cback(const tBTM_REMOTE_DEV_NAME* p_data) { sec_event.pin_req.bd_addr = bta_dm_sec_cb.pin_bd_addr; sec_event.pin_req.dev_class = bta_dm_sec_cb.pin_dev_class; - if (p_result && p_result->status == BTM_SUCCESS) { + if (p_result && p_result->btm_status == tBTM_STATUS::BTM_SUCCESS) { bd_name_copy(sec_event.pin_req.bd_name, p_result->remote_bd_name); } else { /* No name found */ sec_event.pin_req.bd_name[0] = 0; @@ -249,8 +251,8 @@ static void bta_dm_pinname_cback(const tBTM_REMOTE_DEV_NAME* p_data) { * Returns void * ******************************************************************************/ -static uint8_t bta_dm_pin_cback(const RawAddress& bd_addr, DEV_CLASS dev_class, - const BD_NAME bd_name, bool min_16_digit) { +static tBTM_STATUS bta_dm_pin_cback(const RawAddress& bd_addr, DEV_CLASS dev_class, + const BD_NAME bd_name, bool min_16_digit) { if (!bta_dm_sec_cb.p_sec_cback) { return BTM_NOT_AUTHORIZED; } @@ -261,9 +263,10 @@ static uint8_t bta_dm_pin_cback(const RawAddress& bd_addr, DEV_CLASS dev_class, bta_dm_sec_cb.pin_evt = BTA_DM_PIN_REQ_EVT; bta_dm_sec_cb.pin_bd_addr = bd_addr; bta_dm_sec_cb.pin_dev_class = dev_class; - if ((get_btm_client_interface().peer.BTM_ReadRemoteDeviceName( - bd_addr, bta_dm_pinname_cback, BT_TRANSPORT_BR_EDR)) == BTM_CMD_STARTED) { - return BTM_CMD_STARTED; + if ((get_btm_client_interface().peer.BTM_ReadRemoteDeviceName(bd_addr, bta_dm_pinname_cback, + BT_TRANSPORT_BR_EDR)) == + tBTM_STATUS::BTM_CMD_STARTED) { + return tBTM_STATUS::BTM_CMD_STARTED; } log::warn("Failed to start Remote Name Request, addr:{}", bd_addr); @@ -278,7 +281,7 @@ static uint8_t bta_dm_pin_cback(const RawAddress& bd_addr, DEV_CLASS dev_class, bd_name_copy(sec_event.pin_req.bd_name, bd_name); bta_dm_sec_cb.p_sec_cback(BTA_DM_PIN_REQ_EVT, &sec_event); - return BTM_CMD_STARTED; + return tBTM_STATUS::BTM_CMD_STARTED; } /******************************************************************************* @@ -290,9 +293,9 @@ static uint8_t bta_dm_pin_cback(const RawAddress& bd_addr, DEV_CLASS dev_class, * Returns void * ******************************************************************************/ -static uint8_t bta_dm_new_link_key_cback(const RawAddress& bd_addr, DEV_CLASS /* dev_class */, - BD_NAME bd_name, const LinkKey& key, uint8_t key_type, - bool is_ctkd) { +static tBTM_STATUS bta_dm_new_link_key_cback(const RawAddress& bd_addr, DEV_CLASS /* dev_class */, + BD_NAME bd_name, const LinkKey& key, uint8_t key_type, + bool is_ctkd) { tBTA_DM_SEC sec_event; tBTA_DM_AUTH_CMPL* p_auth_cmpl; tBTA_DM_SEC_EVT event = BTA_DM_AUTH_CMPL_EVT; @@ -327,7 +330,7 @@ static uint8_t bta_dm_new_link_key_cback(const RawAddress& bd_addr, DEV_CLASS /* bta_dm_reset_sec_dev_pending(p_auth_cmpl->bd_addr); } - return BTM_CMD_STARTED; + return tBTM_STATUS::BTM_CMD_STARTED; } /******************************************************************************* @@ -386,7 +389,7 @@ static void bta_dm_authentication_complete_cback(const RawAddress& bd_addr, * ******************************************************************************/ static tBTM_STATUS bta_dm_sp_cback(tBTM_SP_EVT event, tBTM_SP_EVT_DATA* p_data) { - tBTM_STATUS status = BTM_CMD_STARTED; + tBTM_STATUS status = tBTM_STATUS::BTM_CMD_STARTED; tBTA_DM_SEC sec_event = {}; tBTA_DM_SEC_EVT pin_evt = BTA_DM_SP_KEY_NOTIF_EVT; @@ -452,7 +455,7 @@ static tBTM_STATUS bta_dm_sp_cback(tBTM_SP_EVT event, tBTM_SP_EVT_DATA* p_data) const tBTM_STATUS btm_status = get_btm_client_interface().peer.BTM_ReadRemoteDeviceName( p_data->cfm_req.bd_addr, bta_dm_pinname_cback, BT_TRANSPORT_BR_EDR); switch (btm_status) { - case BTM_CMD_STARTED: + case tBTM_STATUS::BTM_CMD_STARTED: return btm_status; default: // NOTE: This will issue callback on this failure path @@ -472,8 +475,8 @@ static tBTM_STATUS bta_dm_sp_cback(tBTM_SP_EVT event, tBTM_SP_EVT_DATA* p_data) bta_dm_sec_cb.pin_dev_class = p_data->key_notif.dev_class; if ((get_btm_client_interface().peer.BTM_ReadRemoteDeviceName( p_data->key_notif.bd_addr, bta_dm_pinname_cback, BT_TRANSPORT_BR_EDR)) == - BTM_CMD_STARTED) { - return BTM_CMD_STARTED; + tBTM_STATUS::BTM_CMD_STARTED) { + return tBTM_STATUS::BTM_CMD_STARTED; } log::warn("Failed to start Remote Name Request, addr:{}", p_data->key_notif.bd_addr); } else { @@ -490,7 +493,8 @@ static tBTM_STATUS bta_dm_sp_cback(tBTM_SP_EVT event, tBTM_SP_EVT_DATA* p_data) case BTM_SP_LOC_OOB_EVT: // BR/EDR OOB pairing is not supported with Secure Connections - btif_dm_proc_loc_oob(BT_TRANSPORT_BR_EDR, (bool)(p_data->loc_oob.status == BTM_SUCCESS), + btif_dm_proc_loc_oob(BT_TRANSPORT_BR_EDR, + (bool)(p_data->loc_oob.status == tBTM_STATUS::BTM_SUCCESS), p_data->loc_oob.c_192, p_data->loc_oob.r_192); break; @@ -582,7 +586,7 @@ static void bta_dm_remove_sec_dev_entry(const RawAddress& remote_bd_addr) { static void bta_dm_bond_cancel_complete_cback(tBTM_STATUS result) { tBTA_DM_SEC sec_event; - if (result == BTM_SUCCESS) { + if (result == tBTM_STATUS::BTM_SUCCESS) { sec_event.bond_cancel_cmpl.result = BTA_SUCCESS; } else { sec_event.bond_cancel_cmpl.result = BTA_FAILURE; @@ -648,9 +652,9 @@ static void ble_io_req(const RawAddress& bd_addr, tBTM_IO_CAP* p_io_cap, tBTM_OO * Returns void * ******************************************************************************/ -static uint8_t bta_dm_ble_smp_cback(tBTM_LE_EVT event, const RawAddress& bda, - tBTM_LE_EVT_DATA* p_data) { - tBTM_STATUS status = BTM_SUCCESS; +static tBTM_STATUS bta_dm_ble_smp_cback(tBTM_LE_EVT event, const RawAddress& bda, + tBTM_LE_EVT_DATA* p_data) { + tBTM_STATUS status = tBTM_STATUS::BTM_SUCCESS; tBTA_DM_SEC sec_event; log::debug("addr:{},event:{}", bda, ble_evt_to_text(event)); @@ -795,12 +799,12 @@ void bta_dm_encrypt_cback(RawAddress bd_addr, tBT_TRANSPORT transport, void* /* } log::debug("Encrypted:{:c}, peer:{} transport:{} status:{} callback:{:c}", - result == BTM_SUCCESS ? 'T' : 'F', bd_addr, bt_transport_text(transport), + result == tBTM_STATUS::BTM_SUCCESS ? 'T' : 'F', bd_addr, bt_transport_text(transport), btm_status_text(result), (p_callback) ? 'T' : 'F'); tBTA_STATUS bta_status = BTA_SUCCESS; switch (result) { - case BTM_SUCCESS: + case tBTM_STATUS::BTM_SUCCESS: break; case BTM_WRONG_MODE: bta_status = BTA_WRONG_MODE; @@ -808,7 +812,7 @@ void bta_dm_encrypt_cback(RawAddress bd_addr, tBT_TRANSPORT transport, void* /* case BTM_NO_RESOURCES: bta_status = BTA_NO_RESOURCES; break; - case BTM_BUSY: + case tBTM_STATUS::BTM_BUSY: bta_status = BTA_BUSY; break; default: @@ -843,8 +847,9 @@ void bta_dm_set_encryption(const RawAddress& bd_addr, tBT_TRANSPORT transport, return; } - if (get_btm_client_interface().security.BTM_SetEncryption( - bd_addr, transport, bta_dm_encrypt_cback, NULL, sec_act) == BTM_CMD_STARTED) { + if (get_btm_client_interface().security.BTM_SetEncryption(bd_addr, transport, + bta_dm_encrypt_cback, NULL, sec_act) == + tBTM_STATUS::BTM_CMD_STARTED) { device->p_encrypt_cback = p_callback; log::debug("Started encryption peer:{} transport:{}", bd_addr, bt_transport_text(transport)); } else { @@ -903,12 +908,12 @@ static tBTM_STATUS bta_dm_sirk_verifiction_cback(const RawAddress& bd_addr) { if (bta_dm_sec_cb.p_sec_sirk_cback) { log::debug("callback called"); bta_dm_sec_cb.p_sec_sirk_cback(BTA_DM_SIRK_VERIFICATION_REQ_EVT, &sec_event); - return BTM_CMD_STARTED; + return tBTM_STATUS::BTM_CMD_STARTED; } log::debug("no callback registered"); - return BTM_SUCCESS_NO_SECURITY; + return tBTM_STATUS::BTM_SUCCESS_NO_SECURITY; } /******************************************************************************* @@ -961,14 +966,14 @@ void bta_dm_add_ble_device(const RawAddress& bd_addr, tBLE_ADDR_TYPE addr_type, ******************************************************************************/ void bta_dm_ble_passkey_reply(const RawAddress& bd_addr, bool accept, uint32_t passkey) { get_btm_client_interface().security.BTM_BlePasskeyReply( - bd_addr, accept ? BTM_SUCCESS : BTM_NOT_AUTHORIZED, passkey); + bd_addr, accept ? tBTM_STATUS::BTM_SUCCESS : BTM_NOT_AUTHORIZED, passkey); } /** This is response to SM numeric comparison request submitted to application. */ void bta_dm_ble_confirm_reply(const RawAddress& bd_addr, bool accept) { get_btm_client_interface().security.BTM_SecConfirmReqReply( - accept ? BTM_SUCCESS : BTM_NOT_AUTHORIZED, BT_TRANSPORT_LE, bd_addr); + accept ? tBTM_STATUS::BTM_SUCCESS : BTM_NOT_AUTHORIZED, BT_TRANSPORT_LE, bd_addr); } /** This function set the local device LE privacy settings. */ diff --git a/system/bta/dm/bta_dm_sec_api.cc b/system/bta/dm/bta_dm_sec_api.cc index 3af6b7ad18..f46bd40197 100644 --- a/system/bta/dm/bta_dm_sec_api.cc +++ b/system/bta/dm/bta_dm_sec_api.cc @@ -31,6 +31,7 @@ #include "stack/include/bt_octets.h" #include "stack/include/btm_ble_sec_api.h" #include "stack/include/btm_client_interface.h" +#include "stack/include/btm_status.h" #include "stack/include/main_thread.h" #include "types/raw_address.h" @@ -214,7 +215,7 @@ void BTA_DmBleSecurityGrant(const RawAddress& bd_addr, tBTA_DM_BLE_SEC_GRANT res const tBTM_STATUS btm_status = [](const tBTA_DM_BLE_SEC_GRANT res) -> tBTM_STATUS { switch (res) { case tBTA_DM_BLE_SEC_GRANT::BTA_DM_SEC_GRANTED: - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; case tBTA_DM_BLE_SEC_GRANT::BTA_DM_SEC_PAIR_NOT_SPT: return static_cast<tBTM_STATUS>(BTA_DM_AUTH_FAIL_BASE + SMP_PAIR_NOT_SUPPORT); } diff --git a/system/bta/gatt/bta_gattc_cache.cc b/system/bta/gatt/bta_gattc_cache.cc index 286f2156dc..ba8cbebb20 100644 --- a/system/bta/gatt/bta_gattc_cache.cc +++ b/system/bta/gatt/bta_gattc_cache.cc @@ -345,7 +345,7 @@ void bta_gattc_sdp_callback(tBTA_GATTC_CB_DATA* cb_data, const RawAddress& /* bd return; } - if ((sdp_status != SDP_SUCCESS) && (sdp_status != SDP_DB_FULL)) { + if ((sdp_status != tSDP_STATUS::SDP_SUCCESS) && (sdp_status != tSDP_STATUS::SDP_DB_FULL)) { bta_gattc_explore_srvc_finished(cb_data->sdp_conn_id, p_srvc_cb); /* allocated in bta_gattc_sdp_service_disc */ diff --git a/system/bta/has/has_client.cc b/system/bta/has/has_client.cc index 94aeed448d..134158f1fc 100644 --- a/system/bta/has/has_client.cc +++ b/system/bta/has/has_client.cc @@ -1870,7 +1870,7 @@ private: return; } - int result = + tBTM_STATUS result = BTM_SetEncryption(device->addr, BT_TRANSPORT_LE, nullptr, nullptr, BTM_BLE_SEC_ENCRYPT); log::info("Encryption required for {}. Request result: 0x{:02x}", device->addr, result); diff --git a/system/bta/has/has_client_test.cc b/system/bta/has/has_client_test.cc index 10d4a2a676..19f0b1d1c3 100644 --- a/system/bta/has/has_client_test.cc +++ b/system/bta/has/has_client_test.cc @@ -38,6 +38,7 @@ #include "has_types.h" #include "mock_csis_client.h" #include "stack/include/bt_uuid16.h" +#include "stack/include/btm_status.h" #include "test/common/mock_functions.h" #include "types/bt_transport.h" @@ -634,7 +635,7 @@ protected: tBTM_SEC_CALLBACK* p_callback, void* p_ref_data, tBTM_BLE_SEC_ACT sec_act) -> tBTM_STATUS { InjectEncryptionEvent(bd_addr); - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; })); MockCsisClient::SetMockInstanceForTesting(&mock_csis_client_module_); @@ -1249,7 +1250,8 @@ TEST_F(HasClientTest, test_service_discovery_complete_before_encryption) { EXPECT_CALL(*callbacks, OnConnectionState(ConnectionState::CONNECTED, test_address)).Times(0); SetEncryptionResult(test_address, false); - ON_CALL(btm_interface, SetEncryption(_, _, _, _, _)).WillByDefault(Return(BTM_SUCCESS)); + ON_CALL(btm_interface, SetEncryption(_, _, _, _, _)) + .WillByDefault(Return(tBTM_STATUS::BTM_SUCCESS)); TestConnect(test_address); auto test_conn_id = GetTestConnId(test_address); diff --git a/system/bta/hearing_aid/hearing_aid.cc b/system/bta/hearing_aid/hearing_aid.cc index 7503f341f6..a9be65f301 100644 --- a/system/bta/hearing_aid/hearing_aid.cc +++ b/system/bta/hearing_aid/hearing_aid.cc @@ -48,6 +48,7 @@ #include "stack/include/bt_types.h" #include "stack/include/bt_uuid16.h" #include "stack/include/btm_client_interface.h" +#include "stack/include/btm_status.h" #include "stack/include/l2c_api.h" // L2CAP_MIN_OFFSET #include "stack/include/main_thread.h" #include "types/bluetooth/uuid.h" @@ -525,7 +526,10 @@ public: // Set data length // TODO(jpawlowski: for 16khz only 87 is required, optimize - BTM_SetBleDataLength(address, 167); + if (get_btm_client_interface().ble.BTM_SetBleDataLength(address, 167) != + tBTM_STATUS::BTM_SUCCESS) { + log::warn("Unable to set BLE data length peer:{} size:{}", address, 167); + } if (BTM_SecIsSecurityPending(address)) { /* if security collision happened, wait for encryption done @@ -1409,9 +1413,6 @@ public: } uint16_t l2cap_flush_threshold = 0; - if (com::android::bluetooth::flags::higher_l2cap_flush_threshold()) { - l2cap_flush_threshold = 1; - } // Skipping packets completely messes up the resampler context. // The condition for skipping packets seems to be easily triggered, @@ -1973,7 +1974,7 @@ private: device->num_intervals_since_last_rssi_read = 0; log::debug("bd_addr={}", device->address); if (get_btm_client_interface().link_controller.BTM_ReadRSSI( - device->address, read_rssi_callback) != BTM_SUCCESS) { + device->address, read_rssi_callback) != tBTM_STATUS::BTM_CMD_STARTED) { log::warn("Unable to read RSSI peer:{}", device->address); } } @@ -1988,7 +1989,7 @@ static void read_rssi_callback(void* p_void) { return; } - if ((instance) && (p_result->status == BTM_SUCCESS)) { + if ((instance) && (p_result->status == tBTM_STATUS::BTM_SUCCESS)) { instance->OnReadRssiComplete(p_result->rem_bda, p_result->rssi); } } @@ -2084,7 +2085,7 @@ static void hearingaid_gattc_callback(tBTA_GATTC_EVT event, tBTA_GATTC* p_data) static void encryption_callback(RawAddress address, tBT_TRANSPORT, void*, tBTM_STATUS status) { if (instance) { - instance->OnEncryptionComplete(address, status == BTM_SUCCESS ? true : false); + instance->OnEncryptionComplete(address, status == tBTM_STATUS::BTM_SUCCESS ? true : false); } } diff --git a/system/bta/hf_client/bta_hf_client_act.cc b/system/bta/hf_client/bta_hf_client_act.cc index eba754c6ea..9f75ca9eb9 100644 --- a/system/bta/hf_client/bta_hf_client_act.cc +++ b/system/bta/hf_client/bta_hf_client_act.cc @@ -330,7 +330,8 @@ void bta_hf_client_disc_int_res(tBTA_HF_CLIENT_DATA* p_data) { } /* if found service */ - if (p_data->disc_result.status == SDP_SUCCESS || p_data->disc_result.status == SDP_DB_FULL) { + if (p_data->disc_result.status == tSDP_STATUS::SDP_SUCCESS || + p_data->disc_result.status == tSDP_STATUS::SDP_DB_FULL) { /* get attributes */ if (bta_hf_client_sdp_find_attr(client_cb)) { event = BTA_HF_CLIENT_DISC_OK_EVT; @@ -362,7 +363,8 @@ void bta_hf_client_disc_acp_res(tBTA_HF_CLIENT_DATA* p_data) { } /* if found service */ - if (p_data->disc_result.status == SDP_SUCCESS || p_data->disc_result.status == SDP_DB_FULL) { + if (p_data->disc_result.status == tSDP_STATUS::SDP_SUCCESS || + p_data->disc_result.status == tSDP_STATUS::SDP_DB_FULL) { /* get attributes */ bta_hf_client_sdp_find_attr(client_cb); } diff --git a/system/bta/hf_client/bta_hf_client_sco.cc b/system/bta/hf_client/bta_hf_client_sco.cc index 63b1078796..05244a56b4 100644 --- a/system/bta/hf_client/bta_hf_client_sco.cc +++ b/system/bta/hf_client/bta_hf_client_sco.cc @@ -26,6 +26,7 @@ #include "stack/include/bt_hdr.h" #include "stack/include/btm_api.h" #include "stack/include/btm_client_interface.h" +#include "stack/include/btm_status.h" #define BTA_HF_CLIENT_NO_EDR_ESCO \ (ESCO_PKT_TYPES_MASK_NO_2_EV3 | ESCO_PKT_TYPES_MASK_NO_3_EV3 | ESCO_PKT_TYPES_MASK_NO_2_EV5 | \ @@ -58,15 +59,15 @@ static bool bta_hf_client_sco_remove(tBTA_HF_CLIENT_CB* client_cb) { log::verbose(""); if (client_cb->sco_idx != BTM_INVALID_SCO_INDEX) { - status = BTM_RemoveSco(client_cb->sco_idx); + status = get_btm_client_interface().sco.BTM_RemoveSco(client_cb->sco_idx); log::verbose("idx 0x{:04x}, status:0x{:x}", client_cb->sco_idx, status); - if (status == BTM_CMD_STARTED) { + if (status == tBTM_STATUS::BTM_CMD_STARTED) { removed_started = true; } /* If no connection reset the SCO handle */ - else if ((status == BTM_SUCCESS) || (status == BTM_UNKNOWN_ADDR)) { + else if ((status == tBTM_STATUS::BTM_SUCCESS) || (status == BTM_UNKNOWN_ADDR)) { client_cb->sco_idx = BTM_INVALID_SCO_INDEX; } } @@ -252,7 +253,7 @@ static void bta_hf_client_sco_create(tBTA_HF_CLIENT_CB* client_cb, bool is_orig) /* if initiating set current scb and peer bd addr */ if (is_orig) { - if (get_btm_client_interface().sco.BTM_SetEScoMode(¶ms) != BTM_SUCCESS) { + if (get_btm_client_interface().sco.BTM_SetEScoMode(¶ms) != tBTM_STATUS::BTM_SUCCESS) { log::warn("Unable to set ESCO mode"); } /* tell sys to stop av if any */ @@ -262,9 +263,9 @@ static void bta_hf_client_sco_create(tBTA_HF_CLIENT_CB* client_cb, bool is_orig) status = get_btm_client_interface().sco.BTM_CreateSco( &client_cb->peer_addr, is_orig, params.packet_types, &client_cb->sco_idx, bta_hf_client_sco_conn_cback, bta_hf_client_sco_disc_cback); - if (status == BTM_CMD_STARTED && !is_orig) { + if (status == tBTM_STATUS::BTM_CMD_STARTED && !is_orig) { if (get_btm_client_interface().sco.BTM_RegForEScoEvts( - client_cb->sco_idx, bta_hf_client_esco_connreq_cback) == BTM_SUCCESS) { + client_cb->sco_idx, bta_hf_client_esco_connreq_cback) == tBTM_STATUS::BTM_SUCCESS) { log::verbose("SCO registration success"); } } diff --git a/system/bta/hh/bta_hh_act.cc b/system/bta/hh/bta_hh_act.cc index 56d4de0ce3..c2ba60c279 100644 --- a/system/bta/hh/bta_hh_act.cc +++ b/system/bta/hh/bta_hh_act.cc @@ -34,17 +34,13 @@ #include "bta/include/bta_hh_api.h" #include "bta/include/bta_hh_co.h" #include "bta/sys/bta_sys.h" -#include "btif/include/btif_storage.h" -#include "os/log.h" #include "osi/include/allocator.h" -#include "stack/include/acl_api.h" #include "stack/include/bt_hdr.h" -#include "stack/include/bt_uuid16.h" +#include "stack/include/btm_client_interface.h" #include "stack/include/btm_log_history.h" #include "stack/include/hiddefs.h" #include "stack/include/hidh_api.h" #include "stack/include/sdp_api.h" -#include "types/bluetooth/uuid.h" #include "types/raw_address.h" using namespace bluetooth::legacy::stack::sdp; @@ -199,22 +195,30 @@ void bta_hh_disc_cmpl(void) { * Returns void * ******************************************************************************/ -static void bta_hh_sdp_cback(tSDP_STATUS result, uint16_t attr_mask, tHID_DEV_SDP_INFO* sdp_rec) { - tBTA_HH_DEV_CB* p_cb = bta_hh_cb.p_cur; - uint8_t hdl = 0; +static void bta_hh_sdp_cback(const RawAddress& bd_addr, tSDP_STATUS result, uint16_t attr_mask, + tHID_DEV_SDP_INFO* sdp_rec) { tBTA_HH_STATUS status = BTA_HH_ERR_SDP; + tAclLinkSpec link_spec = { + .addrt = {.type = BLE_ADDR_PUBLIC, .bda = bd_addr}, + .transport = BT_TRANSPORT_BR_EDR, + }; + tBTA_HH_DEV_CB* p_cb = bta_hh_find_cb(link_spec); + if (p_cb == nullptr) { + log::error("Unknown device {}", bd_addr); + return; + } - /* make sure sdp succeeded and hh has not been disabled */ - if ((result == SDP_SUCCESS) && (p_cb != NULL)) { + if (result == tSDP_STATUS::SDP_SUCCESS) { /* security is required for the connection, add attr_mask bit*/ attr_mask |= HID_SEC_REQUIRED; - log::verbose("p_cb:{} result:0x{:02x}, attr_mask:0x{:02x}, handle:0x{:x}", fmt::ptr(p_cb), - result, attr_mask, p_cb->hid_handle); + log::verbose("Device:{} result:0x{:02x}, attr_mask:0x{:02x}, handle:0x{:x}", bd_addr, result, + attr_mask, p_cb->hid_handle); /* check to see type of device is supported , and should not been added * before */ if (bta_hh_tod_spt(p_cb, sdp_rec->sub_class)) { + uint8_t hdl = 0; /* if not added before */ if (p_cb->hid_handle == BTA_HH_INVALID_HANDLE) { /* add device/update attr_mask information */ @@ -247,14 +251,12 @@ static void bta_hh_sdp_cback(tSDP_STATUS result, uint16_t attr_mask, tHID_DEV_SD } /* free disc_db when SDP is completed */ - osi_free_and_reset((void**)&bta_hh_cb.p_disc_db); + osi_free_and_reset((void**)&p_cb->p_disc_db); /* send SDP_CMPL_EVT into state machine */ tBTA_HH_DATA bta_hh_data; bta_hh_data.status = status; bta_hh_sm_execute(p_cb, BTA_HH_SDP_CMPL_EVT, &bta_hh_data); - - return; } /******************************************************************************* * @@ -265,12 +267,19 @@ static void bta_hh_sdp_cback(tSDP_STATUS result, uint16_t attr_mask, tHID_DEV_SD * Returns void * ******************************************************************************/ -static void bta_hh_di_sdp_cback(const RawAddress& /* bd_addr */, tSDP_RESULT result) { - tBTA_HH_DEV_CB* p_cb = bta_hh_cb.p_cur; +static void bta_hh_di_sdp_cback(const RawAddress& bd_addr, tSDP_RESULT result) { tBTA_HH_STATUS status = BTA_HH_ERR_SDP; - tSDP_DI_GET_RECORD di_rec; - tHID_STATUS ret; - log::verbose("p_cb:{} result:0x{:02x}", fmt::ptr(p_cb), result); + tAclLinkSpec link_spec = { + .addrt = {.type = BLE_ADDR_PUBLIC, .bda = bd_addr}, + .transport = BT_TRANSPORT_BR_EDR, + }; + tBTA_HH_DEV_CB* p_cb = bta_hh_find_cb(link_spec); + if (p_cb == nullptr) { + log::error("Unknown device {}", bd_addr); + return; + } + + log::verbose("device:{} result:0x{:02x}", bd_addr, result); /* if DI record does not exist on remote device, vendor_id in * tBTA_HH_DEV_DSCP_INFO will be set to 0xffff and we will allow the @@ -278,38 +287,38 @@ static void bta_hh_di_sdp_cback(const RawAddress& /* bd_addr */, tSDP_RESULT res * HID devices do not set this. So for IOP purposes, we allow the connection * to go through and update the DI record to invalid DI entry. */ - if (((result == SDP_SUCCESS) || (result == SDP_NO_RECS_MATCH)) && (p_cb != NULL)) { - if (result == SDP_SUCCESS && - get_legacy_stack_sdp_api()->device_id.SDP_GetNumDiRecords(bta_hh_cb.p_disc_db) != 0) { + if (result == tSDP_STATUS::SDP_SUCCESS || result == tSDP_STATUS::SDP_NO_RECS_MATCH) { + if (result == tSDP_STATUS::SDP_SUCCESS && + get_legacy_stack_sdp_api()->device_id.SDP_GetNumDiRecords(p_cb->p_disc_db) != 0) { + tSDP_DI_GET_RECORD di_rec; + /* always update information with primary DI record */ - if (get_legacy_stack_sdp_api()->device_id.SDP_GetDiRecord(1, &di_rec, bta_hh_cb.p_disc_db) == - SDP_SUCCESS) { + if (get_legacy_stack_sdp_api()->device_id.SDP_GetDiRecord(1, &di_rec, p_cb->p_disc_db) == + tSDP_STATUS::SDP_SUCCESS) { bta_hh_update_di_info(p_cb, di_rec.rec.vendor, di_rec.rec.product, di_rec.rec.version, 0, 0); } - } else /* no DI record available */ - { + } else /* no DI record available */ { bta_hh_update_di_info(p_cb, BTA_HH_VENDOR_ID_INVALID, 0, 0, 0, 0); } - ret = HID_HostGetSDPRecord(p_cb->link_spec.addrt.bda, bta_hh_cb.p_disc_db, - p_bta_hh_cfg->sdp_db_size, bta_hh_sdp_cback); + tHID_STATUS ret = HID_HostGetSDPRecord(p_cb->link_spec.addrt.bda, p_cb->p_disc_db, + p_bta_hh_cfg->sdp_db_size, bta_hh_sdp_cback); if (ret == HID_SUCCESS) { status = BTA_HH_OK; } else { - log::verbose("failure Status 0x{:2x}", ret); + log::warn("failure Status 0x{:2x}", ret); } } if (status != BTA_HH_OK) { - osi_free_and_reset((void**)&bta_hh_cb.p_disc_db); + osi_free_and_reset((void**)&p_cb->p_disc_db); /* send SDP_CMPL_EVT into state machine */ tBTA_HH_DATA bta_hh_data; bta_hh_data.status = status; bta_hh_sm_execute(p_cb, BTA_HH_SDP_CMPL_EVT, &bta_hh_data); } - return; } /******************************************************************************* @@ -324,27 +333,8 @@ static void bta_hh_di_sdp_cback(const RawAddress& /* bd_addr */, tSDP_RESULT res * Returns void * ******************************************************************************/ -static void bta_hh_start_sdp(tBTA_HH_DEV_CB* p_cb, const tBTA_HH_DATA* p_data) { - if (!bta_hh_cb.p_disc_db) { - bta_hh_cb.p_disc_db = (tSDP_DISCOVERY_DB*)osi_malloc(p_bta_hh_cfg->sdp_db_size); - - /* Do DI discovery first */ - if (get_legacy_stack_sdp_api()->device_id.SDP_DiDiscover( - p_data->api_conn.link_spec.addrt.bda, bta_hh_cb.p_disc_db, - p_bta_hh_cfg->sdp_db_size, bta_hh_di_sdp_cback) == SDP_SUCCESS) { - /* SDP search started successfully - * Connection will be triggered at the end of successful SDP search - */ - } else { - log::error("SDP_DiDiscover failed"); - - osi_free_and_reset((void**)&bta_hh_cb.p_disc_db); - - tBTA_HH_DATA bta_hh_data; - bta_hh_data.status = BTA_HH_ERR_SDP; - bta_hh_sm_execute(p_cb, BTA_HH_SDP_CMPL_EVT, &bta_hh_data); - } - } else if (bta_hh_cb.p_disc_db) { +static void bta_hh_start_sdp(tBTA_HH_DEV_CB* p_cb) { + if (p_cb->p_disc_db != nullptr) { /* Incoming/outgoing collision case. DUT initiated HID connection at the * same time as the remote connected HID control channel. * When flow reaches here due to remote initiated connection, DUT may be @@ -352,6 +342,25 @@ static void bta_hh_start_sdp(tBTA_HH_DEV_CB* p_cb, const tBTA_HH_DATA* p_data) { * or failure will handle this case. */ log::warn("Ignoring as SDP already in progress"); + return; + } + + p_cb->p_disc_db = (tSDP_DISCOVERY_DB*)osi_malloc(p_bta_hh_cfg->sdp_db_size); + + /* Do DI discovery first */ + if (get_legacy_stack_sdp_api()->device_id.SDP_DiDiscover( + p_cb->link_spec.addrt.bda, p_cb->p_disc_db, p_bta_hh_cfg->sdp_db_size, + bta_hh_di_sdp_cback) == tSDP_STATUS::SDP_SUCCESS) { + // SDP search started successfully. Connection will be triggered at the end of successful SDP + // search + } else { + log::error("SDP_DiDiscover failed"); + + osi_free_and_reset((void**)&p_cb->p_disc_db); + + tBTA_HH_DATA bta_hh_data; + bta_hh_data.status = BTA_HH_ERR_SDP; + bta_hh_sm_execute(p_cb, BTA_HH_SDP_CMPL_EVT, &bta_hh_data); } } @@ -447,12 +456,10 @@ void bta_hh_sdp_cmpl(tBTA_HH_DEV_CB* p_cb, const tBTA_HH_DATA* p_data) { * Returns void * ******************************************************************************/ -static void bta_hh_bredr_conn(tBTA_HH_DEV_CB* p_cb, const tBTA_HH_DATA* p_data) { - bta_hh_cb.p_cur = p_cb; - +static void bta_hh_bredr_conn(tBTA_HH_DEV_CB* p_cb) { /* If previously virtually cabled device */ if (p_cb->app_id) { - tBTA_HH_DATA bta_hh_data; + tBTA_HH_DATA bta_hh_data = {}; bta_hh_data.status = BTA_HH_OK; log::verbose("skip SDP for known devices"); @@ -461,7 +468,7 @@ static void bta_hh_bredr_conn(tBTA_HH_DEV_CB* p_cb, const tBTA_HH_DATA* p_data) uint8_t hdl; if (HID_HostAddDev(p_cb->link_spec.addrt.bda, p_cb->attr_mask, &hdl) == HID_SUCCESS) { /* update device CB with newly register device handle */ - bta_hh_add_device_to_list(p_cb, hdl, p_cb->attr_mask, NULL, p_cb->sub_class, + bta_hh_add_device_to_list(p_cb, hdl, p_cb->attr_mask, nullptr, p_cb->sub_class, p_cb->dscp_info.ssr_max_latency, p_cb->dscp_info.ssr_min_tout, p_cb->app_id); /* update cb_index[] map */ @@ -473,7 +480,7 @@ static void bta_hh_bredr_conn(tBTA_HH_DEV_CB* p_cb, const tBTA_HH_DATA* p_data) bta_hh_sm_execute(p_cb, BTA_HH_SDP_CMPL_EVT, &bta_hh_data); } else { /* First time connection, start SDP */ - bta_hh_start_sdp(p_cb, p_data); + bta_hh_start_sdp(p_cb); } } @@ -487,15 +494,13 @@ static void bta_hh_bredr_conn(tBTA_HH_DEV_CB* p_cb, const tBTA_HH_DATA* p_data) * ******************************************************************************/ void bta_hh_connect(tBTA_HH_DEV_CB* p_cb, const tBTA_HH_DATA* p_data) { - p_cb->link_spec = p_data->api_conn.link_spec; p_cb->mode = p_data->api_conn.mode; - bta_hh_cb.p_cur = p_cb; // Initiate HID host connection if (p_cb->link_spec.transport == BT_TRANSPORT_LE) { - bta_hh_le_open_conn(p_cb, p_data->api_conn.link_spec); + bta_hh_le_open_conn(p_cb); } else { - bta_hh_bredr_conn(p_cb, p_data); + bta_hh_bredr_conn(p_cb); } } @@ -601,8 +606,6 @@ void bta_hh_open_cmpl_act(tBTA_HH_DEV_CB* p_cb, const tBTA_HH_DATA* p_data) { * ******************************************************************************/ void bta_hh_open_act(tBTA_HH_DEV_CB* p_cb, const tBTA_HH_DATA* p_data) { - tBTA_HH_API_CONN conn_data; - uint8_t dev_handle = p_data ? (uint8_t)p_data->hid_cback.hdr.layer_specific : p_cb->hid_handle; log::verbose("Device[{}] connected", dev_handle); @@ -619,13 +622,8 @@ void bta_hh_open_act(tBTA_HH_DEV_CB* p_cb, const tBTA_HH_DATA* p_data) { /* store the handle here in case sdp fails - need to disconnect */ p_cb->incoming_hid_handle = dev_handle; - memset(&conn_data, 0, sizeof(tBTA_HH_API_CONN)); - conn_data.link_spec = p_cb->link_spec; - bta_hh_cb.p_cur = p_cb; - bta_hh_bredr_conn(p_cb, (tBTA_HH_DATA*)&conn_data); + bta_hh_bredr_conn(p_cb); } - - return; } /******************************************************************************* @@ -923,8 +921,10 @@ void bta_hh_maint_dev_act(tBTA_HH_DEV_CB* p_cb, const tBTA_HH_DATA* p_data) { if (p_cb->hid_handle == BTA_HH_INVALID_HANDLE) { tBT_TRANSPORT transport = p_data->api_maintdev.link_spec.transport; if (!com::android::bluetooth::flags::allow_switching_hid_and_hogp()) { - transport = BTM_UseLeLink(p_data->api_maintdev.link_spec.addrt.bda) ? BT_TRANSPORT_LE - : BT_TRANSPORT_BR_EDR; + transport = get_btm_client_interface().ble.BTM_UseLeLink( + p_data->api_maintdev.link_spec.addrt.bda) + ? BT_TRANSPORT_LE + : BT_TRANSPORT_BR_EDR; } if (transport == BT_TRANSPORT_LE) { p_cb->link_spec.transport = BT_TRANSPORT_LE; diff --git a/system/bta/hh/bta_hh_api.cc b/system/bta/hh/bta_hh_api.cc index ff1ef18e7c..10ca7f2d65 100644 --- a/system/bta/hh/bta_hh_api.cc +++ b/system/bta/hh/bta_hh_api.cc @@ -348,3 +348,14 @@ void BTA_HhRemoveDev(uint8_t dev_handle) { bta_sys_sendmsg(p_buf); } + +/******************************************************************************* + * + * Function BTA_HhDump + * + * Description Dump BTA HH control block + * + * Returns void + * + ******************************************************************************/ +void BTA_HhDump(int fd) { bta_hh_dump(fd); } diff --git a/system/bta/hh/bta_hh_int.h b/system/bta/hh/bta_hh_int.h index 7a011b8f51..1929153182 100644 --- a/system/bta/hh/bta_hh_int.h +++ b/system/bta/hh/bta_hh_int.h @@ -223,6 +223,8 @@ typedef struct { #define BTA_HH_LE_SCPS_NOTIFY_ENB 0x02 uint8_t scps_notify; /* scan refresh supported/notification enabled */ bool security_pending; + + tSDP_DISCOVERY_DB* p_disc_db; } tBTA_HH_DEV_CB; /****************************************************************************** @@ -230,15 +232,12 @@ typedef struct { ******************************************************************************/ typedef struct { tBTA_HH_DEV_CB kdev[BTA_HH_MAX_DEVICE]; /* device control block */ - tBTA_HH_DEV_CB* p_cur; /* current device control - block idx, used in sdp */ uint8_t cb_index[BTA_HH_MAX_KNOWN]; /* maintain a CB index map to dev handle */ uint8_t le_cb_index[BTA_HH_LE_MAX_KNOWN]; /* maintain a CB index map to LE dev handle */ tGATT_IF gatt_if; tBTA_HH_CBACK* p_cback; /* Application callbacks */ - tSDP_DISCOVERY_DB* p_disc_db; uint8_t cnt_num; /* connected device number */ bool w4_disable; /* w4 disable flag */ } tBTA_HH_CB; @@ -252,7 +251,7 @@ extern tBTA_HH_CFG* p_bta_hh_cfg; * Function prototypes ****************************************************************************/ bool bta_hh_hdl_event(const BT_HDR_RIGID* p_msg); -void bta_hh_sm_execute(tBTA_HH_DEV_CB* p_cb, uint16_t event, const tBTA_HH_DATA* p_data); +void bta_hh_sm_execute(tBTA_HH_DEV_CB* p_cb, tBTA_HH_INT_EVT event, const tBTA_HH_DATA* p_data); /* action functions */ void bta_hh_api_disc_act(tBTA_HH_DEV_CB* p_cb, const tBTA_HH_DATA* p_data); @@ -270,8 +269,9 @@ void bta_hh_open_cmpl_act(tBTA_HH_DEV_CB* p_cb, const tBTA_HH_DATA* p_data); void bta_hh_open_failure(tBTA_HH_DEV_CB* p_cb, const tBTA_HH_DATA* p_data); /* utility functions */ -uint8_t bta_hh_find_cb(const tAclLinkSpec& link_spec); +tBTA_HH_DEV_CB* bta_hh_find_cb(const tAclLinkSpec& link_spec); tBTA_HH_DEV_CB* bta_hh_get_cb(const tAclLinkSpec& link_spec); +tBTA_HH_DEV_CB* bta_hh_find_cb_by_handle(uint8_t hid_handle); bool bta_hh_tod_spt(tBTA_HH_DEV_CB* p_cb, uint8_t sub_class); void bta_hh_clean_up_kdev(tBTA_HH_DEV_CB* p_cb); @@ -282,8 +282,6 @@ void bta_hh_update_di_info(tBTA_HH_DEV_CB* p_cb, uint16_t vendor_id, uint16_t pr uint16_t version, uint8_t flag, uint8_t ctry_code); void bta_hh_cleanup_disable(tBTA_HH_STATUS status); -uint8_t bta_hh_dev_handle_to_cb_idx(uint8_t dev_handle); - /* action functions used outside state machine */ void bta_hh_api_enable(tBTA_HH_CBACK* p_cback, bool enable_hid, bool enable_hogp); void bta_hh_api_disable(void); @@ -295,7 +293,7 @@ tBTA_HH_STATUS bta_hh_read_ssr_param(const tAclLinkSpec& link_spec, uint16_t* p_ /* functions for LE HID */ void bta_hh_le_enable(void); void bta_hh_le_deregister(void); -void bta_hh_le_open_conn(tBTA_HH_DEV_CB* p_cb, const tAclLinkSpec& link_spec); +void bta_hh_le_open_conn(tBTA_HH_DEV_CB* p_cb); void bta_hh_le_api_disc_act(tBTA_HH_DEV_CB* p_cb); void bta_hh_le_get_dscp_act(tBTA_HH_DEV_CB* p_cb); void bta_hh_le_write_dev_act(tBTA_HH_DEV_CB* p_cb, const tBTA_HH_DATA* p_data); @@ -322,6 +320,8 @@ void bta_hh_headtracker_parse_service(tBTA_HH_DEV_CB* p_dev_cb, const gatt::Serv bool bta_hh_headtracker_supported(tBTA_HH_DEV_CB* p_dev_cb); uint16_t bta_hh_get_uuid16(tBTA_HH_DEV_CB* p_dev_cb, bluetooth::Uuid uuid); +void bta_hh_dump(int fd); + #if (BTA_HH_DEBUG == TRUE) void bta_hh_trace_dev_db(void); #endif diff --git a/system/bta/hh/bta_hh_le.cc b/system/bta/hh/bta_hh_le.cc index 542704edd2..4480b8c30e 100644 --- a/system/bta/hh/bta_hh_le.cc +++ b/system/bta/hh/bta_hh_le.cc @@ -39,6 +39,7 @@ #include "stack/include/bt_uuid16.h" #include "stack/include/btm_client_interface.h" #include "stack/include/btm_log_history.h" +#include "stack/include/btm_status.h" #include "stack/include/l2c_api.h" // L2CA_ #include "stack/include/main_thread.h" #include "stack/include/srvc_api.h" // tDIS_VALUE @@ -241,19 +242,16 @@ void bta_hh_le_deregister(void) { BTA_GATTC_AppDeregister(bta_hh_cb.gatt_if); } * ******************************************************************************/ static uint8_t bta_hh_le_get_le_dev_hdl(uint8_t cb_index) { - uint8_t i; - for (i = 0; i < ARRAY_SIZE(bta_hh_cb.le_cb_index); i++) { + uint8_t available_handle = BTA_HH_IDX_INVALID; + for (uint8_t i = 0; i < ARRAY_SIZE(bta_hh_cb.le_cb_index); i++) { if (bta_hh_cb.le_cb_index[i] == cb_index) { return BTA_HH_GET_LE_DEV_HDL(i); + } else if (available_handle == BTA_HH_IDX_INVALID && + bta_hh_cb.le_cb_index[i] == BTA_HH_IDX_INVALID) { + available_handle = BTA_HH_GET_LE_DEV_HDL(i); } } - - for (i = 0; i < ARRAY_SIZE(bta_hh_cb.le_cb_index); i++) { - if (bta_hh_cb.le_cb_index[i] == BTA_HH_IDX_INVALID) { - return BTA_HH_GET_LE_DEV_HDL(i); - } - } - return BTA_HH_IDX_INVALID; + return available_handle; } /******************************************************************************* @@ -265,21 +263,17 @@ static uint8_t bta_hh_le_get_le_dev_hdl(uint8_t cb_index) { * Parameters: * ******************************************************************************/ -void bta_hh_le_open_conn(tBTA_HH_DEV_CB* p_cb, const tAclLinkSpec& link_spec) { - tBTA_HH_STATUS status = BTA_HH_ERR_NO_RES; - - /* update cb_index[] map */ +void bta_hh_le_open_conn(tBTA_HH_DEV_CB* p_cb) { p_cb->hid_handle = bta_hh_le_get_le_dev_hdl(p_cb->index); if (p_cb->hid_handle == BTA_HH_IDX_INVALID) { + tBTA_HH_STATUS status = BTA_HH_ERR_NO_RES; bta_hh_sm_execute(p_cb, BTA_HH_SDP_CMPL_EVT, (tBTA_HH_DATA*)&status); return; } - p_cb->link_spec = link_spec; - bta_hh_cb.le_cb_index[BTA_HH_GET_LE_CB_IDX(p_cb->hid_handle)] = p_cb->index; - p_cb->in_use = true; + bta_hh_cb.le_cb_index[BTA_HH_GET_LE_CB_IDX(p_cb->hid_handle)] = p_cb->index; // Update index map - BTA_GATTC_Open(bta_hh_cb.gatt_if, link_spec.addrt.bda, BTM_BLE_DIRECT_CONNECTION, false); + BTA_GATTC_Open(bta_hh_cb.gatt_if, p_cb->link_spec.addrt.bda, BTM_BLE_DIRECT_CONNECTION, false); } /******************************************************************************* @@ -291,15 +285,13 @@ void bta_hh_le_open_conn(tBTA_HH_DEV_CB* p_cb, const tAclLinkSpec& link_spec) { * ******************************************************************************/ static tBTA_HH_DEV_CB* bta_hh_le_find_dev_cb_by_conn_id(uint16_t conn_id) { - uint8_t i; - tBTA_HH_DEV_CB* p_dev_cb = &bta_hh_cb.kdev[0]; - - for (i = 0; i < BTA_HH_MAX_DEVICE; i++, p_dev_cb++) { + for (uint8_t i = 0; i < BTA_HH_MAX_DEVICE; i++) { + tBTA_HH_DEV_CB* p_dev_cb = &bta_hh_cb.kdev[i]; if (p_dev_cb->in_use && p_dev_cb->conn_id == conn_id) { return p_dev_cb; } } - return NULL; + return nullptr; } /******************************************************************************* @@ -311,16 +303,14 @@ static tBTA_HH_DEV_CB* bta_hh_le_find_dev_cb_by_conn_id(uint16_t conn_id) { * ******************************************************************************/ static tBTA_HH_DEV_CB* bta_hh_le_find_dev_cb_by_bda(const tAclLinkSpec& link_spec) { - uint8_t i; - tBTA_HH_DEV_CB* p_dev_cb = &bta_hh_cb.kdev[0]; - - for (i = 0; i < BTA_HH_MAX_DEVICE; i++, p_dev_cb++) { + for (uint8_t i = 0; i < BTA_HH_MAX_DEVICE; i++) { + tBTA_HH_DEV_CB* p_dev_cb = &bta_hh_cb.kdev[i]; if (p_dev_cb->in_use && p_dev_cb->link_spec.addrt.bda == link_spec.addrt.bda && p_dev_cb->link_spec.transport == BT_TRANSPORT_LE) { return p_dev_cb; } } - return NULL; + return nullptr; } /******************************************************************************* @@ -968,14 +958,14 @@ static void bta_hh_le_encrypt_cback(RawAddress bd_addr, tBT_TRANSPORT transport, .transport = transport, }; - tBTA_HH_DEV_CB* p_dev_cb = bta_hh_get_cb(link_spec); + tBTA_HH_DEV_CB* p_dev_cb = bta_hh_find_cb(link_spec); if (p_dev_cb == nullptr) { - log::error("unexpected encryption callback, ignore"); + log::error("Unexpected encryption callback for {}", bd_addr); return; } // TODO Collapse the duplicated status values - p_dev_cb->status = (result == BTM_SUCCESS) ? BTA_HH_OK : BTA_HH_ERR_SEC; + p_dev_cb->status = (result == tBTM_STATUS::BTM_SUCCESS) ? BTA_HH_OK : BTA_HH_ERR_SEC; p_dev_cb->btm_status = result; bta_hh_sm_execute(p_dev_cb, BTA_HH_ENC_CMPL_EVT, NULL); @@ -1085,11 +1075,6 @@ static void bta_hh_clear_service_cache(tBTA_HH_DEV_CB* p_cb) { ******************************************************************************/ void bta_hh_start_security(tBTA_HH_DEV_CB* p_cb, const tBTA_HH_DATA* /* p_buf */) { log::verbose("addr:{}", p_cb->link_spec.addrt.bda); - if (BTM_SecIsSecurityPending(p_cb->link_spec.addrt.bda)) { - /* if security collision happened, wait for encryption done */ - p_cb->security_pending = true; - return; - } /* if link has been encrypted */ if (BTM_IsEncrypted(p_cb->link_spec.addrt.bda, BT_TRANSPORT_LE)) { @@ -1103,9 +1088,12 @@ void bta_hh_start_security(tBTA_HH_DEV_CB* p_cb, const tBTA_HH_DATA* /* p_buf */ p_cb->status = BTA_HH_ERR_AUTH_FAILED; BTM_SetEncryption(p_cb->link_spec.addrt.bda, BT_TRANSPORT_LE, bta_hh_le_encrypt_cback, NULL, BTM_BLE_SEC_ENCRYPT); - } - /* unbonded device, report security error here */ - else { + } else if (BTM_SecIsSecurityPending(p_cb->link_spec.addrt.bda)) { + /* if security collision happened, wait for encryption done */ + log::debug("addr:{} security collision", p_cb->link_spec.addrt.bda); + p_cb->security_pending = true; + } else { + /* unbonded device, report security error here */ log::debug("addr:{} not bonded", p_cb->link_spec.addrt.bda); p_cb->status = BTA_HH_ERR_AUTH_FAILED; bta_hh_clear_service_cache(p_cb); diff --git a/system/bta/hh/bta_hh_main.cc b/system/bta/hh/bta_hh_main.cc index 0b14004c65..e28f24341c 100644 --- a/system/bta/hh/bta_hh_main.cc +++ b/system/bta/hh/bta_hh_main.cc @@ -30,6 +30,7 @@ #include <cstdint> #include "bta/hh/bta_hh_int.h" +#include "main/shim/dumpsys.h" #include "os/log.h" #include "osi/include/allocator.h" #include "stack/include/bt_hdr.h" @@ -44,14 +45,132 @@ tBTA_HH_CB bta_hh_cb; /***************************************************************************** * Static functions ****************************************************************************/ -static const char* bta_hh_evt_code(tBTA_HH_INT_EVT evt_code); -static const char* bta_hh_state_code(tBTA_HH_STATE state_code); +/******************************************************************************* + * + * Function bta_hh_evt_code + * + * Description + * + * Returns void + * + ******************************************************************************/ +static const char* bta_hh_evt_code(tBTA_HH_INT_EVT evt_code) { + switch (evt_code) { + case BTA_HH_API_OPEN_EVT: + return "BTA_HH_API_OPEN_EVT"; + case BTA_HH_API_CLOSE_EVT: + return "BTA_HH_API_CLOSE_EVT"; + case BTA_HH_INT_OPEN_EVT: + return "BTA_HH_INT_OPEN_EVT"; + case BTA_HH_INT_CLOSE_EVT: + return "BTA_HH_INT_CLOSE_EVT"; + case BTA_HH_INT_HANDSK_EVT: + return "BTA_HH_INT_HANDSK_EVT"; + case BTA_HH_INT_DATA_EVT: + return "BTA_HH_INT_DATA_EVT"; + case BTA_HH_INT_CTRL_DATA: + return "BTA_HH_INT_CTRL_DATA"; + case BTA_HH_API_WRITE_DEV_EVT: + return "BTA_HH_API_WRITE_DEV_EVT"; + case BTA_HH_SDP_CMPL_EVT: + return "BTA_HH_SDP_CMPL_EVT"; + case BTA_HH_API_MAINT_DEV_EVT: + return "BTA_HH_API_MAINT_DEV_EVT"; + case BTA_HH_API_GET_DSCP_EVT: + return "BTA_HH_API_GET_DSCP_EVT"; + case BTA_HH_OPEN_CMPL_EVT: + return "BTA_HH_OPEN_CMPL_EVT"; + case BTA_HH_GATT_CLOSE_EVT: + return "BTA_HH_GATT_CLOSE_EVT"; + case BTA_HH_GATT_OPEN_EVT: + return "BTA_HH_GATT_OPEN_EVT"; + case BTA_HH_START_ENC_EVT: + return "BTA_HH_START_ENC_EVT"; + case BTA_HH_ENC_CMPL_EVT: + return "BTA_HH_ENC_CMPL_EVT"; + default: + return "unknown HID Host event code"; + } +} + +/******************************************************************************* + * + * Function bta_hh_state_code + * + * Description get string representation of HID host state code. + * + * Returns void + * + ******************************************************************************/ +static const char* bta_hh_state_code(tBTA_HH_STATE state_code) { + switch (state_code) { + case BTA_HH_NULL_ST: + return "BTA_HH_NULL_ST"; + case BTA_HH_IDLE_ST: + return "BTA_HH_IDLE_ST"; + case BTA_HH_W4_CONN_ST: + return "BTA_HH_W4_CONN_ST"; + case BTA_HH_CONN_ST: + return "BTA_HH_CONN_ST"; + case BTA_HH_W4_SEC: + return "BTA_HH_W4_SEC"; + default: + return "unknown HID Host state"; + } +} + +/* Finds the related control block, if any */ +static tBTA_HH_DEV_CB* bta_hh_find_cb_by_event(const BT_HDR_RIGID* p_msg) { + tBTA_HH_DEV_CB* p_cb = nullptr; -static void bta_hh_better_state_machine(tBTA_HH_DEV_CB* p_cb, uint16_t event, - const tBTA_HH_DATA* p_data) { - log::verbose("state:{}, event:{}", bta_hh_state_code(p_cb->state), - bta_hh_evt_code(static_cast<tBTA_HH_INT_EVT>(event))); - switch (p_cb->state) { + if (p_msg->event == BTA_HH_API_OPEN_EVT) { + // Connection requested, find or allocate the control block + p_cb = bta_hh_get_cb(((tBTA_HH_API_CONN*)p_msg)->link_spec); + } else if (p_msg->event == BTA_HH_API_MAINT_DEV_EVT) { + if (((tBTA_HH_MAINT_DEV*)p_msg)->sub_event == BTA_HH_ADD_DEV_EVT) { + // Device is being added, find or allocate the control block + p_cb = bta_hh_get_cb(((tBTA_HH_MAINT_DEV*)p_msg)->link_spec); + } else /* else remove device by handle */ { + p_cb = bta_hh_find_cb_by_handle((uint8_t)p_msg->layer_specific); + /* If BT disable is done while the HID device is connected and + * Link_Key uses unauthenticated combination + * then we can get into a situation where remove_bonding is called + * with the index set to 0 (without getting + * cleaned up). Only when VIRTUAL_UNPLUG is called do we cleanup the + * index and make it MAX_KNOWN. + * So if REMOVE_DEVICE is called and in_use is false then we should + * treat this as a NULL p_cb. Hence we + * force the index to be IDX_INVALID + */ + if (p_cb != nullptr && !p_cb->in_use) { + log::warn("Control block getting removed, device: {}, index: {}, handle: {}", + p_cb->link_spec, p_cb->index, p_cb->hid_handle); + p_cb = nullptr; + } + } + } else if (p_msg->event == BTA_HH_INT_OPEN_EVT) { + p_cb = bta_hh_get_cb(((tBTA_HH_CBACK_DATA*)p_msg)->link_spec); + } else { + p_cb = bta_hh_find_cb_by_handle((uint8_t)p_msg->layer_specific); + } + + return p_cb; +} + +/* Handles events related to connection control blocks */ +void bta_hh_sm_execute(tBTA_HH_DEV_CB* p_cb, tBTA_HH_INT_EVT event, const tBTA_HH_DATA* p_data) { + tBTA_HH_STATE in_state = p_cb->state; + if (p_cb->state == BTA_HH_NULL_ST || p_cb->state >= BTA_HH_INVALID_ST) { + log::error("Invalid state State:{}, Event:{} for {}", bta_hh_state_code(in_state), + bta_hh_evt_code(event), p_cb->link_spec); + return; + } + + bool unexpected_event = false; + log::verbose("State {}, Event {} for {}", bta_hh_state_code(in_state), bta_hh_evt_code(event), + p_cb->link_spec); + + switch (in_state) { case BTA_HH_IDLE_ST: switch (event) { case BTA_HH_API_OPEN_EVT: @@ -76,6 +195,9 @@ static void bta_hh_better_state_machine(tBTA_HH_DEV_CB* p_cb, uint16_t event, p_cb->state = BTA_HH_W4_CONN_ST; bta_hh_gatt_open(p_cb, p_data); break; + default: + unexpected_event = true; + break; } break; case BTA_HH_W4_CONN_ST: @@ -115,6 +237,9 @@ static void bta_hh_better_state_machine(tBTA_HH_DEV_CB* p_cb, uint16_t event, p_cb->state = BTA_HH_W4_SEC; bta_hh_start_security(p_cb, p_data); break; + default: + unexpected_event = true; + break; } break; case BTA_HH_CONN_ST: @@ -151,6 +276,9 @@ static void bta_hh_better_state_machine(tBTA_HH_DEV_CB* p_cb, uint16_t event, p_cb->state = BTA_HH_IDLE_ST; bta_hh_gatt_close(p_cb, p_data); break; + default: + unexpected_event = true; + break; } break; case BTA_HH_W4_SEC: @@ -176,117 +304,103 @@ static void bta_hh_better_state_machine(tBTA_HH_DEV_CB* p_cb, uint16_t event, case BTA_HH_GATT_ENC_CMPL_EVT: bta_hh_le_notify_enc_cmpl(p_cb, p_data); break; + default: + unexpected_event = true; + break; } break; } + + if (unexpected_event) { + log::warn("Unexpected event event {} in state {} for {}", bta_hh_evt_code(event), + bta_hh_state_code(in_state), p_cb->link_spec); + } else if (in_state != p_cb->state) { + log::debug("State Change: [{}] -> [{}] after Event [{}]", bta_hh_state_code(in_state), + bta_hh_state_code(p_cb->state), bta_hh_evt_code(event)); + } } /******************************************************************************* * - * Function bta_hh_sm_execute - * - * Description State machine event handling function for HID Host + * Function bta_hh_hdl_failure * + * Description Handler for state machine failures * * Returns void * ******************************************************************************/ -void bta_hh_sm_execute(tBTA_HH_DEV_CB* p_cb, uint16_t event, const tBTA_HH_DATA* p_data) { - tBTA_HH cback_data; - tBTA_HH_EVT cback_event = 0; - tBTA_HH_STATE in_state; - tBTA_HH_INT_EVT debug_event = static_cast<tBTA_HH_INT_EVT>(event); - - memset(&cback_data, 0, sizeof(tBTA_HH)); - - /* handle exception, no valid control block was found */ - if (!p_cb) { - log::verbose("Event:{}, bta_hh_cb.p_cback:{}", bta_hh_evt_code(debug_event), - fmt::ptr(bta_hh_cb.p_cback)); - /* BTA HH enabled already? otherwise ignore the event although it's bad*/ - if (bta_hh_cb.p_cback != NULL) { - switch (event) { - /* no control block available for new connection */ - case BTA_HH_API_OPEN_EVT: - cback_event = BTA_HH_OPEN_EVT; - /* build cback data */ - cback_data.conn.link_spec = ((tBTA_HH_API_CONN*)p_data)->link_spec; - cback_data.conn.status = BTA_HH_ERR_DB_FULL; - cback_data.conn.handle = BTA_HH_INVALID_HANDLE; - break; - /* DB full, BTA_HhAddDev */ - case BTA_HH_API_MAINT_DEV_EVT: - cback_event = p_data->api_maintdev.sub_event; - - if (p_data->api_maintdev.sub_event == BTA_HH_ADD_DEV_EVT) { - cback_data.dev_info.link_spec = p_data->api_maintdev.link_spec; - cback_data.dev_info.status = BTA_HH_ERR_DB_FULL; - cback_data.dev_info.handle = BTA_HH_INVALID_HANDLE; - } else { - cback_data.dev_info.status = BTA_HH_ERR_HDL; - cback_data.dev_info.handle = (uint8_t)p_data->api_maintdev.hdr.layer_specific; - } - break; - case BTA_HH_API_WRITE_DEV_EVT: - cback_event = (p_data->api_sndcmd.t_type - HID_TRANS_GET_REPORT) + BTA_HH_GET_RPT_EVT; - osi_free_and_reset((void**)&p_data->api_sndcmd.p_data); - if (p_data->api_sndcmd.t_type == HID_TRANS_SET_PROTOCOL || - p_data->api_sndcmd.t_type == HID_TRANS_SET_REPORT || - p_data->api_sndcmd.t_type == HID_TRANS_SET_IDLE) { - cback_data.dev_status.status = BTA_HH_ERR_HDL; - cback_data.dev_status.handle = (uint8_t)p_data->api_sndcmd.hdr.layer_specific; - } else if (p_data->api_sndcmd.t_type != HID_TRANS_DATA && - p_data->api_sndcmd.t_type != HID_TRANS_CONTROL) { - cback_data.hs_data.handle = (uint8_t)p_data->api_sndcmd.hdr.layer_specific; - cback_data.hs_data.status = BTA_HH_ERR_HDL; - /* hs_data.rsp_data will be all zero, which is not valid value */ - } else if (p_data->api_sndcmd.t_type == HID_TRANS_CONTROL && - p_data->api_sndcmd.param == BTA_HH_CTRL_VIRTUAL_CABLE_UNPLUG) { - cback_data.status = BTA_HH_ERR_HDL; - cback_event = BTA_HH_VC_UNPLUG_EVT; - } else { - cback_event = 0; - } - break; - - case BTA_HH_API_CLOSE_EVT: - cback_event = BTA_HH_CLOSE_EVT; +void bta_hh_hdl_failure(tBTA_HH_INT_EVT event, const tBTA_HH_DATA* p_data) { + if (bta_hh_cb.p_cback == nullptr) { + log::error("No callback handler"); + return; + } - cback_data.dev_status.status = BTA_HH_ERR_HDL; - cback_data.dev_status.handle = (uint8_t)p_data->api_sndcmd.hdr.layer_specific; - break; + log::verbose("Event:{}", bta_hh_evt_code(event)); + tBTA_HH cback_data = {}; + tBTA_HH_EVT cback_event = BTA_HH_EMPTY_EVT; + switch (event) { + /* no control block available for new connection */ + case BTA_HH_API_OPEN_EVT: + cback_event = BTA_HH_OPEN_EVT; + /* build cback data */ + cback_data.conn.link_spec = ((tBTA_HH_API_CONN*)p_data)->link_spec; + cback_data.conn.status = BTA_HH_ERR_DB_FULL; + cback_data.conn.handle = BTA_HH_INVALID_HANDLE; + break; + /* DB full, BTA_HhAddDev */ + case BTA_HH_API_MAINT_DEV_EVT: + cback_event = p_data->api_maintdev.sub_event; - default: - /* invalid handle, call bad API event */ - log::error("wrong device handle:{}", p_data->hdr.layer_specific); - /* Free the callback buffer now */ - if (p_data != NULL) { - osi_free_and_reset((void**)&p_data->hid_cback.p_data); - } - break; + if (p_data->api_maintdev.sub_event == BTA_HH_ADD_DEV_EVT) { + cback_data.dev_info.link_spec = p_data->api_maintdev.link_spec; + cback_data.dev_info.status = BTA_HH_ERR_DB_FULL; + cback_data.dev_info.handle = BTA_HH_INVALID_HANDLE; + } else { + cback_data.dev_info.status = BTA_HH_ERR_HDL; + cback_data.dev_info.handle = (uint8_t)p_data->api_maintdev.hdr.layer_specific; } - if (cback_event) { - (*bta_hh_cb.p_cback)(cback_event, &cback_data); + break; + case BTA_HH_API_WRITE_DEV_EVT: + cback_event = (p_data->api_sndcmd.t_type - HID_TRANS_GET_REPORT) + BTA_HH_GET_RPT_EVT; + osi_free_and_reset((void**)&p_data->api_sndcmd.p_data); + if (p_data->api_sndcmd.t_type == HID_TRANS_SET_PROTOCOL || + p_data->api_sndcmd.t_type == HID_TRANS_SET_REPORT || + p_data->api_sndcmd.t_type == HID_TRANS_SET_IDLE) { + cback_data.dev_status.status = BTA_HH_ERR_HDL; + cback_data.dev_status.handle = (uint8_t)p_data->api_sndcmd.hdr.layer_specific; + } else if (p_data->api_sndcmd.t_type != HID_TRANS_DATA && + p_data->api_sndcmd.t_type != HID_TRANS_CONTROL) { + cback_data.hs_data.handle = (uint8_t)p_data->api_sndcmd.hdr.layer_specific; + cback_data.hs_data.status = BTA_HH_ERR_HDL; + /* hs_data.rsp_data will be all zero, which is not valid value */ + } else if (p_data->api_sndcmd.t_type == HID_TRANS_CONTROL && + p_data->api_sndcmd.param == BTA_HH_CTRL_VIRTUAL_CABLE_UNPLUG) { + cback_data.status = BTA_HH_ERR_HDL; + cback_event = BTA_HH_VC_UNPLUG_EVT; + } else { + cback_event = 0; } - } - } - /* corresponding CB is found, go to state machine */ - else { - in_state = p_cb->state; - log::verbose("State 0x{:02x} [{}], Event [{}]", in_state, bta_hh_state_code(in_state), - bta_hh_evt_code(debug_event)); + break; - if ((p_cb->state == BTA_HH_NULL_ST) || (p_cb->state >= BTA_HH_INVALID_ST)) { - log::error("Invalid state State=0x{:x}, Event={}", p_cb->state, event); - return; - } + case BTA_HH_API_CLOSE_EVT: + cback_event = BTA_HH_CLOSE_EVT; + cback_data.dev_status.status = BTA_HH_ERR_HDL; + cback_data.dev_status.handle = (uint8_t)p_data->api_sndcmd.hdr.layer_specific; + break; - bta_hh_better_state_machine(p_cb, event, p_data); + default: + /* Likely an invalid handle, call bad API event */ + log::error("wrong device handle:{} in event:{}", p_data->hdr.layer_specific, + bta_hh_evt_code(event)); + /* Free the callback buffer now */ + if (p_data != nullptr) { + osi_free_and_reset((void**)&p_data->hid_cback.p_data); + } + break; + } - if (in_state != p_cb->state) { - log::debug("HHID State Change: [{}] -> [{}] after Event [{}]", bta_hh_state_code(in_state), - bta_hh_state_code(p_cb->state), bta_hh_evt_code(debug_event)); - } + if (cback_event) { + (*bta_hh_cb.p_cback)(cback_event, &cback_data); } } @@ -301,122 +415,26 @@ void bta_hh_sm_execute(tBTA_HH_DEV_CB* p_cb, uint16_t event, const tBTA_HH_DATA* * ******************************************************************************/ bool bta_hh_hdl_event(const BT_HDR_RIGID* p_msg) { - uint8_t index = BTA_HH_IDX_INVALID; - tBTA_HH_DEV_CB* p_cb = NULL; + tBTA_HH_DEV_CB* p_cb = bta_hh_find_cb_by_event(p_msg); + tBTA_HH_INT_EVT event = static_cast<tBTA_HH_INT_EVT>(p_msg->event); - /* all events processed in state machine need to find corresponding - CB before proceed */ - if (p_msg->event == BTA_HH_API_OPEN_EVT) { - index = bta_hh_find_cb(((tBTA_HH_API_CONN*)p_msg)->link_spec); - } else if (p_msg->event == BTA_HH_API_MAINT_DEV_EVT) { - /* if add device */ - if (((tBTA_HH_MAINT_DEV*)p_msg)->sub_event == BTA_HH_ADD_DEV_EVT) { - index = bta_hh_find_cb(((tBTA_HH_MAINT_DEV*)p_msg)->link_spec); - } else /* else remove device by handle */ { - index = bta_hh_dev_handle_to_cb_idx((uint8_t)p_msg->layer_specific); - /* If BT disable is done while the HID device is connected and - * Link_Key uses unauthenticated combination - * then we can get into a situation where remove_bonding is called - * with the index set to 0 (without getting - * cleaned up). Only when VIRTUAL_UNPLUG is called do we cleanup the - * index and make it MAX_KNOWN. - * So if REMOVE_DEVICE is called and in_use is false then we should - * treat this as a NULL p_cb. Hence we - * force the index to be IDX_INVALID - */ - if ((index != BTA_HH_IDX_INVALID) && (!bta_hh_cb.kdev[index].in_use)) { - index = BTA_HH_IDX_INVALID; - } - } - } else if (p_msg->event == BTA_HH_INT_OPEN_EVT) { - index = bta_hh_find_cb(((tBTA_HH_CBACK_DATA*)p_msg)->link_spec); + if (p_cb != nullptr) { + bta_hh_sm_execute(p_cb, event, (tBTA_HH_DATA*)p_msg); } else { - index = bta_hh_dev_handle_to_cb_idx((uint8_t)p_msg->layer_specific); + bta_hh_hdl_failure(event, (tBTA_HH_DATA*)p_msg); } - if (index != BTA_HH_IDX_INVALID) { - p_cb = &bta_hh_cb.kdev[index]; - } - - log::verbose("handle={} dev_cb[{}]", p_msg->layer_specific, index); - bta_hh_sm_execute(p_cb, p_msg->event, (tBTA_HH_DATA*)p_msg); - return true; } -/***************************************************************************** - * Debug Functions - ****************************************************************************/ -/******************************************************************************* - * - * Function bta_hh_evt_code - * - * Description - * - * Returns void - * - ******************************************************************************/ -static const char* bta_hh_evt_code(tBTA_HH_INT_EVT evt_code) { - switch (evt_code) { - case BTA_HH_API_OPEN_EVT: - return "BTA_HH_API_OPEN_EVT"; - case BTA_HH_API_CLOSE_EVT: - return "BTA_HH_API_CLOSE_EVT"; - case BTA_HH_INT_OPEN_EVT: - return "BTA_HH_INT_OPEN_EVT"; - case BTA_HH_INT_CLOSE_EVT: - return "BTA_HH_INT_CLOSE_EVT"; - case BTA_HH_INT_HANDSK_EVT: - return "BTA_HH_INT_HANDSK_EVT"; - case BTA_HH_INT_DATA_EVT: - return "BTA_HH_INT_DATA_EVT"; - case BTA_HH_INT_CTRL_DATA: - return "BTA_HH_INT_CTRL_DATA"; - case BTA_HH_API_WRITE_DEV_EVT: - return "BTA_HH_API_WRITE_DEV_EVT"; - case BTA_HH_SDP_CMPL_EVT: - return "BTA_HH_SDP_CMPL_EVT"; - case BTA_HH_API_MAINT_DEV_EVT: - return "BTA_HH_API_MAINT_DEV_EVT"; - case BTA_HH_API_GET_DSCP_EVT: - return "BTA_HH_API_GET_DSCP_EVT"; - case BTA_HH_OPEN_CMPL_EVT: - return "BTA_HH_OPEN_CMPL_EVT"; - case BTA_HH_GATT_CLOSE_EVT: - return "BTA_HH_GATT_CLOSE_EVT"; - case BTA_HH_GATT_OPEN_EVT: - return "BTA_HH_GATT_OPEN_EVT"; - case BTA_HH_START_ENC_EVT: - return "BTA_HH_START_ENC_EVT"; - case BTA_HH_ENC_CMPL_EVT: - return "BTA_HH_ENC_CMPL_EVT"; - default: - return "unknown HID Host event code"; - } -} - -/******************************************************************************* - * - * Function bta_hh_state_code - * - * Description get string representation of HID host state code. - * - * Returns void - * - ******************************************************************************/ -static const char* bta_hh_state_code(tBTA_HH_STATE state_code) { - switch (state_code) { - case BTA_HH_NULL_ST: - return "BTA_HH_NULL_ST"; - case BTA_HH_IDLE_ST: - return "BTA_HH_IDLE_ST"; - case BTA_HH_W4_CONN_ST: - return "BTA_HH_W4_CONN_ST"; - case BTA_HH_CONN_ST: - return "BTA_HH_CONN_ST"; - case BTA_HH_W4_SEC: - return "BTA_HH_W4_SEC"; - default: - return "unknown HID Host state"; +#define DUMPSYS_TAG "shim::legacy::hid" +void bta_hh_dump(int fd) { + for (auto dev : bta_hh_cb.kdev) { + if (dev.in_use) { + LOG_DUMPSYS(fd, "[%d] Device:%s, handle:%d, state:%s, sub class:%d, ", dev.index, + dev.link_spec.ToRedactedStringForLogging().c_str(), dev.hid_handle, + bta_hh_state_code(dev.state), dev.sub_class); + } } } +#undef DUMPSYS_TAG diff --git a/system/bta/hh/bta_hh_utils.cc b/system/bta/hh/bta_hh_utils.cc index 2191f0c056..c163c1e5ab 100644 --- a/system/bta/hh/bta_hh_utils.cc +++ b/system/bta/hh/bta_hh_utils.cc @@ -29,6 +29,7 @@ #include "os/log.h" #include "osi/include/allocator.h" #include "stack/include/btm_client_interface.h" +#include "stack/include/btm_status.h" #include "stack/include/sdp_api.h" #include "types/raw_address.h" @@ -51,59 +52,136 @@ constexpr uint16_t kSsrMaxLatency = 18; /* slots * 0.625ms */ /******************************************************************************* * - * Function bta_hh_find_cb + * Function bta_hh_get_cb_index + * + * Description Find suitable control block index for ACL link specification + * + * Returns void + * + ******************************************************************************/ +static uint8_t bta_hh_get_cb_index(const tAclLinkSpec& link_spec) { + if (link_spec.addrt.bda.IsEmpty()) { + return BTA_HH_IDX_INVALID; + } + + uint8_t available_handle = BTA_HH_IDX_INVALID; + for (uint8_t i = 0; i < BTA_HH_MAX_DEVICE; i++) { + /* Check if any active/known devices is a match */ + tBTA_HH_DEV_CB& dev = bta_hh_cb.kdev[i]; + if (link_spec == dev.link_spec) { + log::verbose("Reusing handle {} for {}, ", i, link_spec); + return i; + } else if (available_handle == BTA_HH_IDX_INVALID && !dev.in_use) { + available_handle = i; + } + } + + if (available_handle != BTA_HH_IDX_INVALID) { + log::verbose("Using unused handle {} for {}", available_handle, link_spec); + } + return available_handle; +} + +/******************************************************************************* * - * Description Find best available control block according to ACL link - * specification. + * Function bta_hh_get_cb * + * Description Find or allocate control block for ACL link specification * * Returns void * ******************************************************************************/ -uint8_t bta_hh_find_cb(const tAclLinkSpec& link_spec) { - uint8_t xx; +tBTA_HH_DEV_CB* bta_hh_get_cb(const tAclLinkSpec& link_spec) { + uint8_t idx = bta_hh_get_cb_index(link_spec); + if (idx == BTA_HH_IDX_INVALID) { + log::error("No handle available for {}", link_spec); + return nullptr; + } + + tBTA_HH_DEV_CB& dev = bta_hh_cb.kdev[idx]; + dev.link_spec = link_spec; + dev.in_use = true; + return &dev; +} + +/******************************************************************************* + * + * Function bta_hh_find_cb + * + * Description Find the existing control block for ACL link specification + * + * Returns void + * + ******************************************************************************/ +tBTA_HH_DEV_CB* bta_hh_find_cb(const tAclLinkSpec& link_spec) { + if (link_spec.addrt.bda.IsEmpty()) { + return nullptr; + } - /* See how many active devices there are. */ - for (xx = 0; xx < BTA_HH_MAX_DEVICE; xx++) { + for (uint8_t i = 0; i < BTA_HH_MAX_DEVICE; i++) { /* check if any active/known devices is a match */ - if (link_spec == bta_hh_cb.kdev[xx].link_spec && !link_spec.addrt.bda.IsEmpty()) { -#if (BTA_HH_DEBUG == TRUE) - log::verbose("found kdev_cb[{}] hid_handle={}", xx, bta_hh_cb.kdev[xx].hid_handle); -#endif - return xx; + if (link_spec == bta_hh_cb.kdev[i].link_spec) { + return &bta_hh_cb.kdev[i]; } -#if (BTA_HH_DEBUG == TRUE) - else - log::verbose("in_use ? [{}] kdev[{}].hid_handle={} state=[{}]", bta_hh_cb.kdev[xx].in_use, xx, - bta_hh_cb.kdev[xx].hid_handle, bta_hh_cb.kdev[xx].state); -#endif } + return nullptr; +} + +/******************************************************************************* + * + * Function bta_hh_dev_handle_to_cb_idx + * + * Description convert a HID device handle to the device control block + * index. + * + * + * Returns uint8_t: index of the device control block. + * + ******************************************************************************/ +static uint8_t bta_hh_dev_handle_to_cb_idx(uint8_t dev_handle) { + uint8_t index = BTA_HH_IDX_INVALID; - /* if no active device match, find a spot for it */ - for (xx = 0; xx < BTA_HH_MAX_DEVICE; xx++) { - if (!bta_hh_cb.kdev[xx].in_use) { - bta_hh_cb.kdev[xx].link_spec = link_spec; - break; + if (BTA_HH_IS_LE_DEV_HDL(dev_handle)) { + if (BTA_HH_IS_LE_DEV_HDL_VALID(dev_handle)) { + index = bta_hh_cb.le_cb_index[BTA_HH_GET_LE_CB_IDX(dev_handle)]; } - } -/* If device list full, report BTA_HH_IDX_INVALID */ -#if (BTA_HH_DEBUG == TRUE) - log::verbose("index={} while max={}", xx, BTA_HH_MAX_DEVICE); -#endif + } else + /* regular HID device checking */ + if (dev_handle < BTA_HH_MAX_KNOWN) { + index = bta_hh_cb.cb_index[dev_handle]; + } + + return index; +} - if (xx == BTA_HH_MAX_DEVICE) { - xx = BTA_HH_IDX_INVALID; +/******************************************************************************* + * + * Function bta_hh_find_cb + * + * Description Find the existing control block for handle + * + * Returns void + * + ******************************************************************************/ +tBTA_HH_DEV_CB* bta_hh_find_cb_by_handle(uint8_t hid_handle) { + uint8_t index = bta_hh_dev_handle_to_cb_idx(hid_handle); + if (index == BTA_HH_IDX_INVALID) { + return nullptr; } - return xx; + return &bta_hh_cb.kdev[index]; } -tBTA_HH_DEV_CB* bta_hh_get_cb(const tAclLinkSpec& link_spec) { - uint8_t idx = bta_hh_find_cb(link_spec); - if (idx == BTA_HH_IDX_INVALID) { - return nullptr; +static void bta_hh_reset_cb(tBTA_HH_DEV_CB* p_cb) { + // Free buffer for report descriptor info + osi_free_and_reset((void**)&p_cb->dscp_info.descriptor.dsc_list); + + // Cancel SDP if it had been started + if (p_cb->p_disc_db != nullptr) { + (void)get_legacy_stack_sdp_api()->service.SDP_CancelServiceSearch(p_cb->p_disc_db); + osi_free_and_reset((void**)&p_cb->p_disc_db); } - return &bta_hh_cb.kdev[idx]; + *p_cb = {}; } /******************************************************************************* @@ -117,8 +195,6 @@ tBTA_HH_DEV_CB* bta_hh_get_cb(const tAclLinkSpec& link_spec) { * ******************************************************************************/ void bta_hh_clean_up_kdev(tBTA_HH_DEV_CB* p_cb) { - uint8_t index; - if (p_cb->link_spec.transport == BT_TRANSPORT_LE) { uint8_t le_hid_handle = BTA_HH_GET_LE_CB_IDX(p_cb->hid_handle); if (le_hid_handle >= BTA_HH_LE_MAX_KNOWN) { @@ -134,14 +210,8 @@ void bta_hh_clean_up_kdev(tBTA_HH_DEV_CB* p_cb) { } } - /* reset device control block */ - index = p_cb->index; /* Preserve index for this control block */ - - /* Free buffer for report descriptor info */ - osi_free_and_reset((void**)&p_cb->dscp_info.descriptor.dsc_list); - - memset(p_cb, 0, sizeof(tBTA_HH_DEV_CB)); /* Reset control block */ - + uint8_t index = p_cb->index; // Preserve index for this control block + bta_hh_reset_cb(p_cb); // Reset control block p_cb->index = index; /* Restore index for this control block */ p_cb->state = BTA_HH_IDLE_ST; p_cb->hid_handle = BTA_HH_INVALID_HANDLE; @@ -244,7 +314,7 @@ bool bta_hh_tod_spt(tBTA_HH_DEV_CB* p_cb, uint8_t sub_class) { ******************************************************************************/ tBTA_HH_STATUS bta_hh_read_ssr_param(const tAclLinkSpec& link_spec, uint16_t* p_max_ssr_lat, uint16_t* p_min_ssr_tout) { - tBTA_HH_DEV_CB* p_cb = bta_hh_get_cb(link_spec); + tBTA_HH_DEV_CB* p_cb = bta_hh_find_cb(link_spec); if (p_cb == nullptr) { log::warn("Unable to find device:{}", link_spec); return BTA_HH_ERR; @@ -257,7 +327,7 @@ tBTA_HH_STATUS bta_hh_read_ssr_param(const tAclLinkSpec& link_spec, uint16_t* p_ uint16_t ssr_max_latency; if (get_btm_client_interface().link_controller.BTM_GetLinkSuperTout( - p_cb->link_spec.addrt.bda, &ssr_max_latency) != BTM_SUCCESS) { + p_cb->link_spec.addrt.bda, &ssr_max_latency) != tBTM_STATUS::BTM_SUCCESS) { log::warn("Unable to get supervision timeout for peer:{}", p_cb->link_spec); return BTA_HH_ERR; } @@ -305,16 +375,9 @@ tBTA_HH_STATUS bta_hh_read_ssr_param(const tAclLinkSpec& link_spec, uint16_t* p_ * ******************************************************************************/ void bta_hh_cleanup_disable(tBTA_HH_STATUS status) { - uint8_t xx; /* free buffer in CB holding report descriptors */ - for (xx = 0; xx < BTA_HH_MAX_DEVICE; xx++) { - osi_free_and_reset((void**)&bta_hh_cb.kdev[xx].dscp_info.descriptor.dsc_list); - } - - if (bta_hh_cb.p_disc_db) { - /* Cancel SDP if it had been started. */ - (void)get_legacy_stack_sdp_api()->service.SDP_CancelServiceSearch(bta_hh_cb.p_disc_db); - osi_free_and_reset((void**)&bta_hh_cb.p_disc_db); + for (uint8_t i = 0; i < BTA_HH_MAX_DEVICE; i++) { + bta_hh_reset_cb(&bta_hh_cb.kdev[i]); } if (bta_hh_cb.p_cback) { @@ -326,35 +389,6 @@ void bta_hh_cleanup_disable(tBTA_HH_STATUS status) { } } -/******************************************************************************* - * - * Function bta_hh_dev_handle_to_cb_idx - * - * Description convert a HID device handle to the device control block - * index. - * - * - * Returns uint8_t: index of the device control block. - * - ******************************************************************************/ -uint8_t bta_hh_dev_handle_to_cb_idx(uint8_t dev_handle) { - uint8_t index = BTA_HH_IDX_INVALID; - - if (BTA_HH_IS_LE_DEV_HDL(dev_handle)) { - if (BTA_HH_IS_LE_DEV_HDL_VALID(dev_handle)) { - index = bta_hh_cb.le_cb_index[BTA_HH_GET_LE_CB_IDX(dev_handle)]; - } -#if (BTA_HH_DEBUG == TRUE) - log::verbose("dev_handle={} index={}", dev_handle, index); -#endif - } else - /* regular HID device checking */ - if (dev_handle < BTA_HH_MAX_KNOWN) { - index = bta_hh_cb.cb_index[dev_handle]; - } - - return index; -} #if (BTA_HH_DEBUG == TRUE) /******************************************************************************* * @@ -366,17 +400,14 @@ uint8_t bta_hh_dev_handle_to_cb_idx(uint8_t dev_handle) { * ******************************************************************************/ void bta_hh_trace_dev_db(void) { - uint8_t xx; - - log::verbose("bta_hh_trace_dev_db:: Device DB list********************"); - - for (xx = 0; xx < BTA_HH_MAX_DEVICE; xx++) { - log::verbose("kdev[{}] in_use[{}] handle[{}]", xx, bta_hh_cb.kdev[xx].in_use, - bta_hh_cb.kdev[xx].hid_handle); - - log::verbose("\t\t\t attr_mask[{:04x}] state [{}] sub_class[{:02x}] index = {}", - bta_hh_cb.kdev[xx].attr_mask, bta_hh_cb.kdev[xx].state, - bta_hh_cb.kdev[xx].sub_class, bta_hh_cb.kdev[xx].index); + log::verbose("Device DB list*******************************************"); + for (auto dev : bta_hh_cb.kdev) { + if (dev.in_use) { + log::verbose( + "kdev[{:02x}] handle[{:02x}] attr_mask[{:04x}] sub_class[{:02x}] state [{}] " + "device[{}] ", + dev.index, dev.hid_handle, dev.attr_mask, dev.sub_class, dev.state, dev.link_spec); + } } log::verbose("*********************************************************"); } diff --git a/system/bta/include/bta_hh_api.h b/system/bta/include/bta_hh_api.h index 8864cf0e38..1de1fa2c85 100644 --- a/system/bta/include/bta_hh_api.h +++ b/system/bta/include/bta_hh_api.h @@ -551,6 +551,17 @@ void BTA_HhAddDev(const tAclLinkSpec& link_spec, tBTA_HH_ATTR_MASK attr_mask, ui ******************************************************************************/ void BTA_HhRemoveDev(uint8_t dev_handle); +/******************************************************************************* + * + * Function BTA_HhDump + * + * Description Dump BTA HH control block + * + * Returns void + * + ******************************************************************************/ +void BTA_HhDump(int fd); + namespace fmt { template <> struct formatter<tBTA_HH_STATUS> : enum_formatter<tBTA_HH_STATUS> {}; diff --git a/system/bta/include/bta_le_audio_api.h b/system/bta/include/bta_le_audio_api.h index e4df7660fa..de11131bae 100644 --- a/system/bta/include/bta_le_audio_api.h +++ b/system/bta/include/bta_le_audio_api.h @@ -61,6 +61,7 @@ public: virtual void SetCodecConfigPreference( int group_id, bluetooth::le_audio::btle_audio_codec_config_t input_codec_config, bluetooth::le_audio::btle_audio_codec_config_t output_codec_config) = 0; + virtual bool IsUsingPreferredCodecConfig(int group_id, int context_type) = 0; virtual void SetCcidInformation(int ccid, int context_type) = 0; virtual void SetInCall(bool in_call) = 0; virtual bool IsInCall() = 0; diff --git a/system/bta/jv/bta_jv_act.cc b/system/bta/jv/bta_jv_act.cc index 5b8eed6943..23738c17a8 100644 --- a/system/bta/jv/bta_jv_act.cc +++ b/system/bta/jv/bta_jv_act.cc @@ -820,7 +820,7 @@ static void bta_jv_start_discovery_cback(uint32_t rfcomm_slot_id, const RawAddre .scn = 0, }, }; - if (result == SDP_SUCCESS || result == SDP_DB_FULL) { + if (result == tSDP_STATUS::SDP_SUCCESS || result == tSDP_STATUS::SDP_DB_FULL) { log::info("Received service discovery callback success bd_addr:{} result:{}", bd_addr, sdp_result_text(result)); tSDP_PROTOCOL_ELEM pe; diff --git a/system/bta/le_audio/broadcaster/broadcaster_test.cc b/system/bta/le_audio/broadcaster/broadcaster_test.cc index a30d424ec7..e40385caa2 100644 --- a/system/bta/le_audio/broadcaster/broadcaster_test.cc +++ b/system/bta/le_audio/broadcaster/broadcaster_test.cc @@ -179,7 +179,7 @@ std::unique_ptr<LeAudioSourceAudioHalClient> LeAudioSourceAudioHalClient::Acquir std::unique_ptr<LeAudioSourceAudioHalClient> ptr( (LeAudioSourceAudioHalClient*)mock_audio_source_); is_audio_hal_acquired = true; - return std::move(ptr); + return ptr; } return nullptr; } diff --git a/system/bta/le_audio/client.cc b/system/bta/le_audio/client.cc index 2cc636cbdb..88aaa80123 100644 --- a/system/bta/le_audio/client.cc +++ b/system/bta/le_audio/client.cc @@ -47,6 +47,7 @@ #include "gatt_api.h" #include "hci/controller_interface.h" #include "internal_include/stack_config.h" +#include "le_audio/device_groups.h" #include "le_audio_health_status.h" #include "le_audio_set_configuration_provider.h" #include "le_audio_types.h" @@ -59,6 +60,7 @@ #include "stack/include/acl_api.h" #include "stack/include/bt_types.h" #include "stack/include/btm_client_interface.h" +#include "stack/include/btm_status.h" #include "stack/include/main_thread.h" #include "state_machine.h" #include "storage_helper.h" @@ -237,6 +239,7 @@ public: callbacks_(callbacks_), active_group_id_(bluetooth::groups::kGroupUnknown), configuration_context_type_(LeAudioContextType::UNINITIALIZED), + in_call_metadata_context_types_({.sink = AudioContexts(), .source = AudioContexts()}), local_metadata_context_types_({.sink = AudioContexts(), .source = AudioContexts()}), stream_setup_start_timestamp_(0), stream_setup_end_timestamp_(0), @@ -986,7 +989,45 @@ public: void SetCodecConfigPreference( int group_id, bluetooth::le_audio::btle_audio_codec_config_t input_codec_config, bluetooth::le_audio::btle_audio_codec_config_t output_codec_config) override { - // TODO Implement + if (!com::android::bluetooth::flags::leaudio_set_codec_config_preference()) { + log::debug("leaudio_set_codec_config_preference flag is not enabled"); + return; + } + + LeAudioDeviceGroup* group = aseGroups_.FindById(group_id); + + if (!group) { + log::error("Unknown group id: %d", group_id); + } + + if (group->SetPreferredAudioSetConfiguration(input_codec_config, output_codec_config)) { + log::info("group id: {}, setting preferred codec is successful.", group_id); + } else { + log::warn("group id: {}, setting preferred codec is failed.", group_id); + return; + } + + if (group_id != active_group_id_) { + log::warn("Selected group is not active."); + return; + } + + if (SetConfigurationAndStopStreamWhenNeeded(group, group->GetConfigurationContextType())) { + log::debug("Group id {} do the reconfiguration based on preferred codec config", group_id); + } else { + log::debug("Group id {} preferred codec config is not changed", group_id); + } + } + + bool IsUsingPreferredCodecConfig(int group_id, int context_type) { + LeAudioDeviceGroup* group = aseGroups_.FindById(group_id); + if (!group) { + log::error("Unknown group id: %d", group_id); + return false; + } + + return group->IsUsingPreferredAudioSetConfiguration( + static_cast<LeAudioContextType>(context_type)); } void SetCcidInformation(int ccid, int context_type) override { @@ -1006,6 +1047,11 @@ public: void SetInCall(bool in_call) override { log::debug("in_call: {}", in_call); + if (in_call == in_call_) { + log::verbose("no state change {}", in_call); + return; + } + in_call_ = in_call; if (!com::android::bluetooth::flags::leaudio_speed_up_reconfiguration_between_call()) { @@ -1014,17 +1060,25 @@ public: } if (active_group_id_ == bluetooth::groups::kGroupUnknown) { + log::debug("There is no active group"); return; } LeAudioDeviceGroup* group = aseGroups_.FindById(active_group_id_); if (!group || !group->IsStreaming()) { + log::debug("{} is not streaming", active_group_id_); return; } bool reconfigure = false; if (in_call_) { + in_call_metadata_context_types_ = local_metadata_context_types_; + + log::debug("in_call_metadata_context_types_ sink: {} source: {}", + in_call_metadata_context_types_.sink.to_string(), + in_call_metadata_context_types_.source.to_string()); + auto audio_set_conf = group->GetConfiguration(LeAudioContextType::CONVERSATIONAL); if (audio_set_conf && group->IsGroupConfiguredTo(*audio_set_conf)) { log::info("Call is coming, but CIG already set for a call"); @@ -1035,14 +1089,18 @@ public: } else { if (configuration_context_type_ == LeAudioContextType::CONVERSATIONAL) { log::info("Call is ended, speed up reconfiguration for media"); - local_metadata_context_types_.sink.unset(LeAudioContextType::CONVERSATIONAL); - local_metadata_context_types_.source.unset(LeAudioContextType::CONVERSATIONAL); + local_metadata_context_types_ = in_call_metadata_context_types_; + log::debug("restored local_metadata_context_types_ sink: {} source: {}", + local_metadata_context_types_.sink.to_string(), + local_metadata_context_types_.source.to_string()); + in_call_metadata_context_types_.sink.clear(); + in_call_metadata_context_types_.source.clear(); reconfigure = true; } } if (reconfigure) { - initReconfiguration(group, configuration_context_type_); + ReconfigureOrUpdateRemote(group, bluetooth::le_audio::types::kLeAudioDirectionSink); } } @@ -2093,11 +2151,12 @@ public: /* verify bond */ if (BTM_IsEncrypted(address, BT_TRANSPORT_LE)) { /* if link has been encrypted */ - OnEncryptionComplete(address, BTM_SUCCESS); + OnEncryptionComplete(address, tBTM_STATUS::BTM_SUCCESS); return; } - int result = BTM_SetEncryption(address, BT_TRANSPORT_LE, nullptr, nullptr, BTM_BLE_SEC_ENCRYPT); + tBTM_STATUS result = + BTM_SetEncryption(address, BT_TRANSPORT_LE, nullptr, nullptr, BTM_BLE_SEC_ENCRYPT); log::info("Encryption required for {}. Request result: 0x{:02x}", address, result); @@ -2174,7 +2233,7 @@ public: } } - void OnEncryptionComplete(const RawAddress& address, uint8_t status) { + void OnEncryptionComplete(const RawAddress& address, tBTM_STATUS status) { log::info("{} status 0x{:02x}", address, status); LeAudioDevice* leAudioDevice = leAudioDevices_.FindByAddress(address); if (leAudioDevice == NULL || (leAudioDevice->conn_id_ == GATT_INVALID_CONN_ID)) { @@ -2183,8 +2242,8 @@ public: return; } - if (status != BTM_SUCCESS) { - log::error("Encryption failed status: {}", int{status}); + if (status != tBTM_STATUS::BTM_SUCCESS) { + log::error("Encryption failed status: {}", btm_status_text(status)); if (leAudioDevice->GetConnectionState() == DeviceConnectState::CONNECTED_BY_USER_GETTING_READY) { callbacks_->OnConnectionState(ConnectionState::DISCONNECTED, address); @@ -4152,7 +4211,10 @@ public: inline bool IsDirectionAvailableForCurrentConfiguration(const LeAudioDeviceGroup* group, uint8_t direction) const { - auto current_config = group->GetCachedConfiguration(configuration_context_type_); + auto current_config = + group->IsUsingPreferredAudioSetConfiguration(configuration_context_type_) + ? group->GetCachedPreferredConfiguration(configuration_context_type_) + : group->GetCachedConfiguration(configuration_context_type_); if (current_config) { return current_config->confs.get(direction).size() != 0; } @@ -4752,28 +4814,33 @@ public: return remote_metadata; } + bool ReconfigureOrUpdateRemoteForPTS(LeAudioDeviceGroup* group, int remote_direction) { + log::info("{}", group->group_id_); + // Use common audio stream contexts exposed by the PTS + auto override_contexts = AudioContexts(0xFFFF); + for (auto device = group->GetFirstDevice(); device != nullptr; + device = group->GetNextDevice(device)) { + override_contexts &= device->GetAvailableContexts(); + } + if (override_contexts.value() == 0xFFFF) { + override_contexts = AudioContexts(LeAudioContextType::UNSPECIFIED); + } + log::warn("Overriding local_metadata_context_types_: {} with: {}", + local_metadata_context_types_.source.to_string(), override_contexts.to_string()); + + /* Choose the right configuration context */ + auto new_configuration_context = ChooseConfigurationContextType(override_contexts); + + log::debug("new_configuration_context= {}.", ToString(new_configuration_context)); + BidirectionalPair<AudioContexts> remote_contexts = {.sink = override_contexts, + .source = override_contexts}; + return GroupStream(active_group_id_, new_configuration_context, remote_contexts); + } + /* Return true if stream is started */ bool ReconfigureOrUpdateRemote(LeAudioDeviceGroup* group, int remote_direction) { if (stack_config_get_interface()->get_pts_force_le_audio_multiple_contexts_metadata()) { - // Use common audio stream contexts exposed by the PTS - auto override_contexts = AudioContexts(0xFFFF); - for (auto device = group->GetFirstDevice(); device != nullptr; - device = group->GetNextDevice(device)) { - override_contexts &= device->GetAvailableContexts(); - } - if (override_contexts.value() == 0xFFFF) { - override_contexts = AudioContexts(LeAudioContextType::UNSPECIFIED); - } - log::warn("Overriding local_metadata_context_types_: {} with: {}", - local_metadata_context_types_.source.to_string(), override_contexts.to_string()); - - /* Choose the right configuration context */ - auto new_configuration_context = ChooseConfigurationContextType(override_contexts); - - log::debug("new_configuration_context= {}.", ToString(new_configuration_context)); - BidirectionalPair<AudioContexts> remote_contexts = {.sink = override_contexts, - .source = override_contexts}; - return GroupStream(active_group_id_, new_configuration_context, remote_contexts); + return ReconfigureOrUpdateRemoteForPTS(group, remote_direction); } /* When the local sink and source update their metadata, we need to come up @@ -4803,7 +4870,7 @@ public: LeAudioContextType::NOTIFICATIONS | LeAudioContextType::SOUNDEFFECTS | LeAudioContextType::INSTRUCTIONAL | LeAudioContextType::ALERTS | LeAudioContextType::EMERGENCYALARM | LeAudioContextType::UNSPECIFIED; - if (group->IsStreaming() && config_context_candids.any() && + if (group->IsStreaming() && !group->IsReleasingOrIdle() && config_context_candids.any() && (config_context_candids & ~no_reconfigure_contexts).none() && (configuration_context_type_ != LeAudioContextType::UNINITIALIZED) && (configuration_context_type_ != LeAudioContextType::UNSPECIFIED) && @@ -5507,6 +5574,7 @@ private: LeAudioContextType configuration_context_type_; static constexpr char kAllowMultipleContextsInMetadata[] = "persist.bluetooth.leaudio.allow.multiple.contexts"; + BidirectionalPair<AudioContexts> in_call_metadata_context_types_; BidirectionalPair<AudioContexts> local_metadata_context_types_; uint64_t stream_setup_start_timestamp_; uint64_t stream_setup_end_timestamp_; @@ -5739,9 +5807,9 @@ void le_audio_gattc_callback(tBTA_GATTC_EVT event, tBTA_GATTC* p_data) { break; case BTA_GATTC_ENC_CMPL_CB_EVT: { - uint8_t encryption_status; + tBTM_STATUS encryption_status; if (BTM_IsEncrypted(p_data->enc_cmpl.remote_bda, BT_TRANSPORT_LE)) { - encryption_status = BTM_SUCCESS; + encryption_status = tBTM_STATUS::BTM_SUCCESS; } else { encryption_status = BTM_FAILED_ON_SECURITY; } diff --git a/system/bta/le_audio/device_groups.cc b/system/bta/le_audio/device_groups.cc index cfeb71d265..f1abc0ed49 100644 --- a/system/bta/le_audio/device_groups.cc +++ b/system/bta/le_audio/device_groups.cc @@ -26,6 +26,7 @@ #include "bta_csis_api.h" #include "btif/include/btif_profile_storage.h" #include "btm_iso_api.h" +#include "common/strings.h" #include "hci/controller_interface.h" #include "internal_include/bt_trace.h" #include "le_audio/codec_manager.h" @@ -868,6 +869,20 @@ LeAudioDeviceGroup::GetAudioSetConfigurationRequirements(types::LeAudioContextTy CodecManager::UnicastConfigurationRequirements::DeviceDirectionRequirements config_req; config_req.params.Add(codec_spec_conf::kLeAudioLtvTypeAudioChannelAllocation, (uint32_t)locations); + if (preferred_config_.get(direction) && + preferred_config_.get(direction)->codec_priority != -1) { + config_req.params.Add( + codec_spec_conf::kLeAudioLtvTypeSamplingFreq, + UINT8_TO_VEC_UINT8(codec_spec_conf::SingleSamplingFreqCapability2Config( + preferred_config_.get(direction)->sample_rate))); + config_req.params.Add( + codec_spec_conf::kLeAudioLtvTypeFrameDuration, + UINT8_TO_VEC_UINT8(codec_spec_conf::SingleFrameDurationCapability2Config( + preferred_config_.get(direction)->frame_duration))); + config_req.params.Add( + codec_spec_conf::kLeAudioLtvTypeOctetsPerCodecFrame, + UINT16_TO_VEC_UINT8(preferred_config_.get(direction)->octets_per_frame)); + } config_req.target_latency = utils::GetTargetLatencyForAudioContext(ctx_type); log::warn("Device {} pushes requirement, location: {}, direction: {}", device->address_, (int)locations, (int)direction); @@ -902,38 +917,87 @@ LeAudioDeviceGroup::GetAudioSetConfigurationRequirements(types::LeAudioContextTy return new_req; } -bool LeAudioDeviceGroup::UpdateAudioSetConfigurationCache(LeAudioContextType ctx_type) const { +bool LeAudioDeviceGroup::UpdateAudioSetConfigurationCache(LeAudioContextType ctx_type, + bool use_preference) const { auto requirements = GetAudioSetConfigurationRequirements(ctx_type); auto new_conf = CodecManager::GetInstance()->GetCodecConfig( requirements, std::bind(&LeAudioDeviceGroup::FindFirstSupportedConfiguration, this, - std::placeholders::_1, std::placeholders::_2)); + std::placeholders::_1, std::placeholders::_2, use_preference)); auto update_config = true; - if (context_to_configuration_cache_map.count(ctx_type) != 0) { - auto& [is_valid, existing_conf] = context_to_configuration_cache_map.at(ctx_type); + auto& cached_map = use_preference ? context_to_preferred_configuration_cache_map_ + : context_to_configuration_cache_map_; + + if (cached_map.count(ctx_type) != 0) { + auto& [is_valid, existing_conf] = cached_map.at(ctx_type); update_config = (new_conf.get() != existing_conf.get()); /* Just mark it as still valid */ if (!update_config && !is_valid) { - context_to_configuration_cache_map.at(ctx_type).first = true; + cached_map.at(ctx_type).first = true; return false; } } if (update_config) { - log::info("config: {} -> {}", ToHexString(ctx_type), - (new_conf ? new_conf->name.c_str() : "(none)")); - context_to_configuration_cache_map.erase(ctx_type); + log::info("config: {} -> {}, use_preference: {}", ToHexString(ctx_type), + (new_conf ? new_conf->name.c_str() : "(none)"), use_preference); + cached_map.erase(ctx_type); if (new_conf) { - context_to_configuration_cache_map.insert( - std::make_pair(ctx_type, std::make_pair(true, std::move(new_conf)))); + cached_map.insert(std::make_pair(ctx_type, std::make_pair(true, std::move(new_conf)))); } } + return update_config; } +bool LeAudioDeviceGroup::SetPreferredAudioSetConfiguration( + const bluetooth::le_audio::btle_audio_codec_config_t& input_codec_config, + const bluetooth::le_audio::btle_audio_codec_config_t& output_codec_config) const { + if (input_codec_config.codec_priority == -1 || output_codec_config.codec_priority == -1) { + log::info("Clear codec config"); + ResetPreferredAudioSetConfiguration(); + return true; + } + + preferred_config_.sink = std::make_unique<btle_audio_codec_config_t>(output_codec_config); + preferred_config_.source = std::make_unique<btle_audio_codec_config_t>(input_codec_config); + + bool is_updated = false; + + for (LeAudioContextType ctx_type : types::kLeAudioContextAllTypesArray) { + is_updated |= UpdateAudioSetConfigurationCache(ctx_type, true); + } + + return is_updated; +} + +bool LeAudioDeviceGroup::IsUsingPreferredAudioSetConfiguration( + const LeAudioContextType& context_type) const { + if (!preferred_config_.sink || !preferred_config_.source) { + log::assert_that(!preferred_config_.sink && !preferred_config_.source, + "Preferred config should be null for both direction"); + return false; + } + + if (preferred_config_.sink->codec_priority == -1 || + preferred_config_.source->codec_priority == -1) { + return false; + } + + return GetPreferredConfiguration(context_type).get(); +} + +void LeAudioDeviceGroup::ResetPreferredAudioSetConfiguration(void) const { + log::info("Reset preferred configuration cached for all cotexts."); + context_to_preferred_configuration_cache_map_.clear(); + preferred_config_.sink = nullptr; + preferred_config_.source = nullptr; +} + void LeAudioDeviceGroup::InvalidateCachedConfigurations(void) { log::info("Group id: {}", group_id_); - context_to_configuration_cache_map.clear(); + context_to_configuration_cache_map_.clear(); + ResetPreferredAudioSetConfiguration(); } types::BidirectionalPair<AudioContexts> LeAudioDeviceGroup::GetLatestAvailableContexts() const { @@ -1397,7 +1461,8 @@ bool CheckIfStrategySupported(types::LeAudioConfigurationStrategy strategy, */ bool LeAudioDeviceGroup::IsAudioSetConfigurationSupported( const CodecManager::UnicastConfigurationRequirements& requirements, - const set_configurations::AudioSetConfiguration* audio_set_conf) const { + const set_configurations::AudioSetConfiguration* audio_set_conf, + bool use_preference) const { /* TODO For now: set ase if matching with first pac. * 1) We assume as well that devices will match requirements in order * e.g. 1 Device - 1 Requirement, 2 Device - 2 Requirement etc. @@ -1432,6 +1497,22 @@ bool LeAudioDeviceGroup::IsAudioSetConfigurationSupported( } } + // Match with requirement first if we have + if (use_preference) { + auto& direction_req = (direction == types::kLeAudioDirectionSink) + ? requirements.sink_requirements + : requirements.source_requirements; + if (!direction_req.has_value() || !preferred_config_.get(direction)) { + return false; + } + if (!utils::IsAseConfigMatchedWithPreferredRequirements( + ase_confs, direction_req.value(), + codec_spec_conf::SingleChannelCountCapability2Config( + preferred_config_.get(direction)->channel_count))) { + return false; + } + } + // In some tests we expect the configuration to be there even when the // contexts are not supported. Then we might want to configure the device // but use UNSPECIFIED which is always supported (but can be unavailable) @@ -1640,15 +1721,25 @@ bool LeAudioDeviceGroup::ConfigureAses( std::shared_ptr<const set_configurations::AudioSetConfiguration> LeAudioDeviceGroup::GetCachedConfiguration(LeAudioContextType context_type) const { - if (context_to_configuration_cache_map.count(context_type) != 0) { - return context_to_configuration_cache_map.at(context_type).second; + if (context_to_configuration_cache_map_.count(context_type) != 0) { + return context_to_configuration_cache_map_.at(context_type).second; + } + return nullptr; +} + +std::shared_ptr<const set_configurations::AudioSetConfiguration> +LeAudioDeviceGroup::GetCachedPreferredConfiguration(LeAudioContextType context_type) const { + if (context_to_preferred_configuration_cache_map_.count(context_type) != 0) { + return context_to_preferred_configuration_cache_map_.at(context_type).second; } return nullptr; } std::shared_ptr<const set_configurations::AudioSetConfiguration> LeAudioDeviceGroup::GetActiveConfiguration(void) const { - return GetCachedConfiguration(configuration_context_type_); + return IsUsingPreferredAudioSetConfiguration(configuration_context_type_) + ? GetCachedPreferredConfiguration(configuration_context_type_) + : GetCachedConfiguration(configuration_context_type_); } std::shared_ptr<const set_configurations::AudioSetConfiguration> @@ -1657,12 +1748,17 @@ LeAudioDeviceGroup::GetConfiguration(LeAudioContextType context_type) const { return nullptr; } + if (IsUsingPreferredAudioSetConfiguration(context_type)) { + log::debug("Using preferred codec config: {}", common::ToString(context_type)); + return GetCachedPreferredConfiguration(context_type); + } + const set_configurations::AudioSetConfiguration* conf = nullptr; bool is_valid = false; /* Refresh the cache if there is no valid configuration */ - if (context_to_configuration_cache_map.count(context_type) != 0) { - auto& valid_config_pair = context_to_configuration_cache_map.at(context_type); + if (context_to_configuration_cache_map_.count(context_type) != 0) { + auto& valid_config_pair = context_to_configuration_cache_map_.at(context_type); is_valid = valid_config_pair.first; conf = valid_config_pair.second.get(); } @@ -1673,6 +1769,27 @@ LeAudioDeviceGroup::GetConfiguration(LeAudioContextType context_type) const { return GetCachedConfiguration(context_type); } +std::shared_ptr<const set_configurations::AudioSetConfiguration> +LeAudioDeviceGroup::GetPreferredConfiguration(LeAudioContextType context_type) const { + if (context_type == LeAudioContextType::UNINITIALIZED) { + return nullptr; + } + + const set_configurations::AudioSetConfiguration* conf = nullptr; + bool is_valid = false; + + if (context_to_preferred_configuration_cache_map_.count(context_type) != 0) { + auto& valid_config_pair = context_to_preferred_configuration_cache_map_.at(context_type); + is_valid = valid_config_pair.first; + conf = valid_config_pair.second.get(); + } + if (!is_valid || conf == nullptr) { + UpdateAudioSetConfigurationCache(context_type, true); + } + + return GetCachedPreferredConfiguration(context_type); +} + LeAudioCodecConfiguration LeAudioDeviceGroup::GetAudioSessionCodecConfigForDirection( LeAudioContextType context_type, uint8_t direction) const { auto audio_set_conf = GetConfiguration(context_type); @@ -1909,7 +2026,7 @@ bool LeAudioDeviceGroup::IsConfiguredForContext(LeAudioContextType context_type) std::unique_ptr<set_configurations::AudioSetConfiguration> LeAudioDeviceGroup::FindFirstSupportedConfiguration( const CodecManager::UnicastConfigurationRequirements& requirements, - const set_configurations::AudioSetConfigurations* confs) const { + const set_configurations::AudioSetConfigurations* confs, bool use_preference) const { log::assert_that(confs != nullptr, "confs should not be null"); log::debug("context type: {}, number of connected devices: {}", @@ -1918,7 +2035,7 @@ LeAudioDeviceGroup::FindFirstSupportedConfiguration( /* Filter out device set for each end every scenario */ for (const auto& conf : *confs) { log::assert_that(conf != nullptr, "confs should not be null"); - if (IsAudioSetConfigurationSupported(requirements, conf)) { + if (IsAudioSetConfigurationSupported(requirements, conf, use_preference)) { log::debug("found: {}", conf->name); return std::make_unique<set_configurations::AudioSetConfiguration>(*conf); } diff --git a/system/bta/le_audio/device_groups.h b/system/bta/le_audio/device_groups.h index 16c4240ca5..d543f1f1aa 100644 --- a/system/bta/le_audio/device_groups.h +++ b/system/bta/le_audio/device_groups.h @@ -31,6 +31,8 @@ #include <utility> // for std::pair #include <vector> +#include "hardware/bt_le_audio.h" + #ifdef __ANDROID__ #include <android/sysprop/BluetoothProperties.sysprop.h> #endif @@ -124,6 +126,7 @@ public: group_user_allowed_context_mask_( {.sink = types::AudioContexts(types::kLeAudioContextAllTypes), .source = types::AudioContexts(types::kLeAudioContextAllTypes)}), + preferred_config_({.sink = nullptr, .source = nullptr}), target_state_(types::AseState::BTA_LE_AUDIO_ASE_STATE_IDLE), current_state_(types::AseState::BTA_LE_AUDIO_ASE_STATE_IDLE), in_transition_(false) { @@ -204,9 +207,15 @@ public: bool GetPresentationDelay(uint32_t* delay, uint8_t direction) const; uint16_t GetRemoteDelay(uint8_t direction) const; bool UpdateAudioContextAvailability(void); - bool UpdateAudioSetConfigurationCache(types::LeAudioContextType ctx_type) const; + bool UpdateAudioSetConfigurationCache(types::LeAudioContextType ctx_type, + bool use_preferred = false) const; CodecManager::UnicastConfigurationRequirements GetAudioSetConfigurationRequirements( types::LeAudioContextType ctx_type) const; + bool SetPreferredAudioSetConfiguration( + const bluetooth::le_audio::btle_audio_codec_config_t& input_codec_config, + const bluetooth::le_audio::btle_audio_codec_config_t& output_codec_config) const; + bool IsUsingPreferredAudioSetConfiguration(const types::LeAudioContextType& context_type) const; + void ResetPreferredAudioSetConfiguration(void) const; bool ReloadAudioLocations(void); bool ReloadAudioDirections(void); std::shared_ptr<const set_configurations::AudioSetConfiguration> GetActiveConfiguration( @@ -214,8 +223,12 @@ public: bool IsPendingConfiguration(void) const; std::shared_ptr<const set_configurations::AudioSetConfiguration> GetConfiguration( types::LeAudioContextType ctx_type) const; + std::shared_ptr<const set_configurations::AudioSetConfiguration> GetPreferredConfiguration( + types::LeAudioContextType ctx_type) const; std::shared_ptr<const set_configurations::AudioSetConfiguration> GetCachedConfiguration( types::LeAudioContextType ctx_type) const; + std::shared_ptr<const set_configurations::AudioSetConfiguration> GetCachedPreferredConfiguration( + types::LeAudioContextType ctx_type) const; void InvalidateCachedConfigurations(void); void SetPendingConfiguration(void); void ClearPendingConfiguration(void); @@ -374,6 +387,16 @@ public: return dsa_modes_list; } + bool DsaReducedSduSizeSupported() { + bool reduced_sdu = false; + for (auto leAudioDevice : leAudioDevices_) { + if (!leAudioDevice.expired()) { + reduced_sdu |= leAudioDevice.lock()->DsaReducedSduSizeSupported(); + } + } + return reduced_sdu; + } + types::BidirectionalPair<types::AudioContexts> GetLatestAvailableContexts(void) const; bool IsInTransition(void) const; @@ -392,7 +415,7 @@ public: */ std::unique_ptr<set_configurations::AudioSetConfiguration> FindFirstSupportedConfiguration( const CodecManager::UnicastConfigurationRequirements& requirements, - const set_configurations::AudioSetConfigurations* confs) const; + const set_configurations::AudioSetConfigurations* confs, bool use_preferred) const; private: bool is_enabled_; @@ -406,7 +429,8 @@ private: const types::BidirectionalPair<std::vector<uint8_t>>& ccid_lists); bool IsAudioSetConfigurationSupported( const CodecManager::UnicastConfigurationRequirements& requirements, - const set_configurations::AudioSetConfiguration* audio_set_configuration) const; + const set_configurations::AudioSetConfiguration* audio_set_configuratio, + bool use_preferred = false) const; uint32_t GetTransportLatencyUs(uint8_t direction) const; bool IsCisPartOfCurrentStream(uint16_t cis_conn_hdl) const; @@ -438,7 +462,20 @@ private: mutable std::map< types::LeAudioContextType, std::pair<bool, const std::shared_ptr<set_configurations::AudioSetConfiguration>>> - context_to_configuration_cache_map; + context_to_configuration_cache_map_; + + /* Possible preferred configuration cache - refreshed on each group context + * availability change. Stored as a pair of (is_valid_cache, configuration*). + * `pair.first` being `false` means that the cached value should be refreshed. + */ + mutable std::map< + types::LeAudioContextType, + std::pair<bool, const std::shared_ptr<set_configurations::AudioSetConfiguration>>> + context_to_preferred_configuration_cache_map_; + + mutable types::BidirectionalPair< + std::unique_ptr<const bluetooth::le_audio::btle_audio_codec_config_t>> + preferred_config_; types::AseState target_state_; types::AseState current_state_; diff --git a/system/bta/le_audio/devices.cc b/system/bta/le_audio/devices.cc index 36ce7d1648..2677492ba6 100644 --- a/system/bta/le_audio/devices.cc +++ b/system/bta/le_audio/devices.cc @@ -486,6 +486,9 @@ void LeAudioDevice::ParseHeadtrackingCodec(const struct types::acs_ac_record& pa return; } + // Valid headtracker codec metadata available, so it must support reduced sdu size + dsa_.reduced_sdu = true; + uint8_t supported_transports = ltv[6]; DsaModes dsa_modes = {DsaMode::DISABLED}; @@ -1157,7 +1160,7 @@ std::vector<uint8_t> LeAudioDevice::GetMetadata(AudioContexts context_type, AppendMetadataLtvEntryForStreamingContext(metadata, context_type); AppendMetadataLtvEntryForCcidList(metadata, ccid_list); - return std::move(metadata); + return metadata; } bool LeAudioDevice::IsMetadataChanged(const BidirectionalPair<AudioContexts>& context_types, @@ -1205,6 +1208,8 @@ void LeAudioDevice::UpdateDeviceAllowlistFlag(void) { DsaModes LeAudioDevice::GetDsaModes(void) { return dsa_.modes; } +bool LeAudioDevice::DsaReducedSduSizeSupported() { return dsa_.reduced_sdu; } + types::DataPathState LeAudioDevice::GetDsaDataPathState(void) { return dsa_.state; } void LeAudioDevice::SetDsaDataPathState(types::DataPathState state) { dsa_.state = state; } diff --git a/system/bta/le_audio/devices.h b/system/bta/le_audio/devices.h index d34f10915f..b921f4e2f5 100644 --- a/system/bta/le_audio/devices.h +++ b/system/bta/le_audio/devices.h @@ -132,7 +132,7 @@ public: acl_asymmetric_(false), acl_phy_update_done_(false), link_quality_timer(nullptr), - dsa_({{DsaMode::DISABLED}, types::DataPathState::IDLE, GATT_INVALID_CONN_ID}) {} + dsa_({{DsaMode::DISABLED}, types::DataPathState::IDLE, GATT_INVALID_CONN_ID, false}) {} ~LeAudioDevice(void); void SetConnectionState(DeviceConnectState state); @@ -227,6 +227,7 @@ public: void GetDeviceModelName(void); void UpdateDeviceAllowlistFlag(void); DsaModes GetDsaModes(void); + bool DsaReducedSduSizeSupported(); types::DataPathState GetDsaDataPathState(void); void SetDsaDataPathState(types::DataPathState state); uint16_t GetDsaCisHandle(void); @@ -239,6 +240,7 @@ private: DsaModes modes; types::DataPathState state; uint16_t cis_handle; + bool reduced_sdu; // TODO: Remove when earbud implementations move to approved DSA 2.0 standard } dsa_; static constexpr char kLeAudioDeviceAllowListProp[] = "persist.bluetooth.leaudio.allow_list"; diff --git a/system/bta/le_audio/devices_test.cc b/system/bta/le_audio/devices_test.cc index ff2783502f..1b0a511065 100644 --- a/system/bta/le_audio/devices_test.cc +++ b/system/bta/le_audio/devices_test.cc @@ -847,6 +847,26 @@ protected: } } + const CodecConfigSetting PreparePreferredCodecConfig( + const CodecConfigSetting& audio_set_codec_conf, + const btle_audio_codec_config_t& preferred_config) { + constexpr uint8_t supported_codec_frames_per_sdu = 1; + return {.id = LeAudioCodecIdLc3, + .params = LeAudioLtvMap({ + {codec_spec_conf::kLeAudioLtvTypeSamplingFreq, + UINT8_TO_VEC_UINT8(codec_spec_conf::SingleSamplingFreqCapability2Config( + preferred_config.sample_rate))}, + {codec_spec_conf::kLeAudioLtvTypeFrameDuration, + UINT8_TO_VEC_UINT8(codec_spec_conf::SingleFrameDurationCapability2Config( + preferred_config.frame_duration))}, + {codec_spec_conf::kLeAudioLtvTypeOctetsPerCodecFrame, + UINT16_TO_VEC_UINT8(preferred_config.octets_per_frame)}, + {codec_spec_conf::kLeAudioLtvTypeCodecFrameBlocksPerSdu, + UINT8_TO_VEC_UINT8(supported_codec_frames_per_sdu)}, + }), + .channel_count_per_iso_stream = audio_set_codec_conf.GetChannelCountPerIsoStream()}; + } + void TestSingleAseConfiguration(LeAudioContextType context_type, TestGroupAseConfigurationData* data, uint8_t data_size, const AudioSetConfiguration* audio_set_conf, @@ -939,7 +959,9 @@ protected: void TestGroupAseConfiguration(LeAudioContextType context_type, TestGroupAseConfigurationData* data, uint8_t data_size, uint8_t directions_to_verify = kLeAudioDirectionSink | - kLeAudioDirectionSource) { + kLeAudioDirectionSource, + btle_audio_codec_config_t* preferred_codec_config = nullptr, + bool should_use_preferred_codec = false) { if (codec_coding_format_ != kLeAudioCodingFormatLC3) { return TestGroupAseVendorConfiguration(context_type, data, data_size, directions_to_verify); } @@ -996,6 +1018,11 @@ protected: for (const auto& entry : ase_confs) { num_of_ase.get(direction)++; pac_builder.Add(entry.codec, data_channel_counts); + if (preferred_codec_config && should_use_preferred_codec) { + const auto customized_codec_config = + PreparePreferredCodecConfig(entry.codec, *preferred_codec_config); + pac_builder.Add(customized_codec_config, data_channel_counts); + } dest_pacs = pac_builder.Get(); } num_of_ase.get(direction) /= data_size; @@ -1014,6 +1041,11 @@ protected: BidirectionalPair<AudioContexts> group_audio_locations = { .sink = AudioContexts(context_type), .source = AudioContexts(context_type)}; + /* Set preferred codec*/ + if (preferred_codec_config) { + group_->SetPreferredAudioSetConfiguration(*preferred_codec_config, *preferred_codec_config); + } + /* Stimulate update of available context map */ group_->UpdateAudioContextAvailability(); group_->UpdateAudioSetConfigurationCache(context_type); @@ -1024,7 +1056,10 @@ protected: * activated verify, ASEs are actually active */ if (interesting_configuration && (directions_to_verify == configuration_directions)) { ASSERT_TRUE(configuration_result); - + ASSERT_EQ(group_->GetPreferredConfiguration(context_type) != nullptr, + should_use_preferred_codec); + ASSERT_EQ(group_->IsUsingPreferredAudioSetConfiguration(context_type), + should_use_preferred_codec); bool matching_conf = true; /* Check if each of the devices has activated ASEs as expected */ for (int i = 0; i < data_size; i++) { @@ -1881,6 +1916,138 @@ TEST_P(LeAudioAseConfigurationTest, test_lc3_config_media) { TestLc3CodecConfig(LeAudioContextType::MEDIA); } +TEST_P(LeAudioAseConfigurationTest, test_use_codec_preference_earbuds_media) { + com::android::bluetooth::flags::provider_->leaudio_set_codec_config_preference(true); + + LeAudioDevice* left = AddTestDevice(1, 1); + LeAudioDevice* right = AddTestDevice(1, 1); + TestGroupAseConfigurationData data[] = {{left, kLeAudioCodecChannelCountSingleChannel, + kLeAudioCodecChannelCountSingleChannel, 1, 0}, + {right, kLeAudioCodecChannelCountSingleChannel, + kLeAudioCodecChannelCountSingleChannel, 1, 0}}; + + /* Change location as by default it is stereo */ + left->snk_audio_locations_ = ::bluetooth::le_audio::codec_spec_conf::kLeAudioLocationFrontLeft; + left->src_audio_locations_ = ::bluetooth::le_audio::codec_spec_conf::kLeAudioLocationFrontLeft; + right->snk_audio_locations_ = ::bluetooth::le_audio::codec_spec_conf::kLeAudioLocationFrontRight; + right->src_audio_locations_ = ::bluetooth::le_audio::codec_spec_conf::kLeAudioLocationFrontRight; + group_->ReloadAudioLocations(); + + // this would be also built into pac record + btle_audio_codec_config_t preferred_codec_config = { + .codec_type = LE_AUDIO_CODEC_INDEX_SOURCE_LC3, + .sample_rate = LE_AUDIO_SAMPLE_RATE_INDEX_16000HZ, + .bits_per_sample = LE_AUDIO_BITS_PER_SAMPLE_INDEX_16, + .channel_count = LE_AUDIO_CHANNEL_COUNT_INDEX_1, + .frame_duration = LE_AUDIO_FRAME_DURATION_INDEX_10000US, + .octets_per_frame = 40}; + + uint8_t directions_to_verify = kLeAudioDirectionSink; + bool should_use_preferred_codec = true; + + TestGroupAseConfiguration(LeAudioContextType::MEDIA, data, 2, directions_to_verify, + &preferred_codec_config, should_use_preferred_codec); +} + +TEST_P(LeAudioAseConfigurationTest, test_not_use_codec_preference_earbuds_media) { + com::android::bluetooth::flags::provider_->leaudio_set_codec_config_preference(true); + + LeAudioDevice* left = AddTestDevice(1, 1); + LeAudioDevice* right = AddTestDevice(1, 1); + TestGroupAseConfigurationData data[] = {{left, kLeAudioCodecChannelCountSingleChannel, + kLeAudioCodecChannelCountSingleChannel, 1, 0}, + {right, kLeAudioCodecChannelCountSingleChannel, + kLeAudioCodecChannelCountSingleChannel, 1, 0}}; + + /* Change location as by default it is stereo */ + left->snk_audio_locations_ = ::bluetooth::le_audio::codec_spec_conf::kLeAudioLocationFrontLeft; + left->src_audio_locations_ = ::bluetooth::le_audio::codec_spec_conf::kLeAudioLocationFrontLeft; + right->snk_audio_locations_ = ::bluetooth::le_audio::codec_spec_conf::kLeAudioLocationFrontRight; + right->src_audio_locations_ = ::bluetooth::le_audio::codec_spec_conf::kLeAudioLocationFrontRight; + group_->ReloadAudioLocations(); + + // this would be also built into pac record + btle_audio_codec_config_t preferred_codec_config = { + .codec_type = LE_AUDIO_CODEC_INDEX_SOURCE_LC3, + .sample_rate = LE_AUDIO_SAMPLE_RATE_INDEX_16000HZ, + .bits_per_sample = LE_AUDIO_BITS_PER_SAMPLE_INDEX_16, + .channel_count = LE_AUDIO_CHANNEL_COUNT_INDEX_1, + .frame_duration = LE_AUDIO_FRAME_DURATION_INDEX_10000US, + .octets_per_frame = 70}; + + uint8_t directions_to_verify = kLeAudioDirectionSink; + bool should_use_preferred_codec = false; + + TestGroupAseConfiguration(LeAudioContextType::MEDIA, data, 2, directions_to_verify, + &preferred_codec_config, should_use_preferred_codec); +} + +TEST_P(LeAudioAseConfigurationTest, test_use_codec_preference_earbuds_conv) { + com::android::bluetooth::flags::provider_->leaudio_set_codec_config_preference(true); + + LeAudioDevice* left = AddTestDevice(1, 1); + LeAudioDevice* right = AddTestDevice(1, 1); + TestGroupAseConfigurationData data[] = {{left, kLeAudioCodecChannelCountSingleChannel, + kLeAudioCodecChannelCountSingleChannel, 1, 1}, + {right, kLeAudioCodecChannelCountSingleChannel, + kLeAudioCodecChannelCountSingleChannel, 1, 1}}; + + /* Change location as by default it is stereo */ + left->snk_audio_locations_ = ::bluetooth::le_audio::codec_spec_conf::kLeAudioLocationFrontLeft; + left->src_audio_locations_ = ::bluetooth::le_audio::codec_spec_conf::kLeAudioLocationFrontLeft; + right->snk_audio_locations_ = ::bluetooth::le_audio::codec_spec_conf::kLeAudioLocationFrontRight; + right->src_audio_locations_ = ::bluetooth::le_audio::codec_spec_conf::kLeAudioLocationFrontRight; + group_->ReloadAudioLocations(); + + // this would be also built into pac record + btle_audio_codec_config_t preferred_codec_config = { + .codec_type = LE_AUDIO_CODEC_INDEX_SOURCE_LC3, + .sample_rate = LE_AUDIO_SAMPLE_RATE_INDEX_32000HZ, + .bits_per_sample = LE_AUDIO_BITS_PER_SAMPLE_INDEX_16, + .channel_count = LE_AUDIO_CHANNEL_COUNT_INDEX_1, + .frame_duration = LE_AUDIO_FRAME_DURATION_INDEX_10000US, + .octets_per_frame = 80}; + + uint8_t directions_to_verify = kLeAudioDirectionBoth; + bool should_use_preferred_codec = true; + + TestGroupAseConfiguration(LeAudioContextType::CONVERSATIONAL, data, 2, directions_to_verify, + &preferred_codec_config, should_use_preferred_codec); +} + +TEST_P(LeAudioAseConfigurationTest, test_not_use_codec_preference_earbuds_conv) { + com::android::bluetooth::flags::provider_->leaudio_set_codec_config_preference(true); + + LeAudioDevice* left = AddTestDevice(1, 1); + LeAudioDevice* right = AddTestDevice(1, 1); + TestGroupAseConfigurationData data[] = {{left, kLeAudioCodecChannelCountSingleChannel, + kLeAudioCodecChannelCountSingleChannel, 1, 1}, + {right, kLeAudioCodecChannelCountSingleChannel, + kLeAudioCodecChannelCountSingleChannel, 1, 1}}; + + /* Change location as by default it is stereo */ + left->snk_audio_locations_ = ::bluetooth::le_audio::codec_spec_conf::kLeAudioLocationFrontLeft; + left->src_audio_locations_ = ::bluetooth::le_audio::codec_spec_conf::kLeAudioLocationFrontLeft; + right->snk_audio_locations_ = ::bluetooth::le_audio::codec_spec_conf::kLeAudioLocationFrontRight; + right->src_audio_locations_ = ::bluetooth::le_audio::codec_spec_conf::kLeAudioLocationFrontRight; + group_->ReloadAudioLocations(); + + // this would be also built into pac record + btle_audio_codec_config_t preferred_codec_config = { + .codec_type = LE_AUDIO_CODEC_INDEX_SOURCE_LC3, + .sample_rate = LE_AUDIO_SAMPLE_RATE_INDEX_16000HZ, + .bits_per_sample = LE_AUDIO_BITS_PER_SAMPLE_INDEX_16, + .channel_count = LE_AUDIO_CHANNEL_COUNT_INDEX_1, + .frame_duration = LE_AUDIO_FRAME_DURATION_INDEX_10000US, + .octets_per_frame = 10}; + + uint8_t directions_to_verify = kLeAudioDirectionBoth; + bool should_use_preferred_codec = false; + + TestGroupAseConfiguration(LeAudioContextType::CONVERSATIONAL, data, 2, directions_to_verify, + &preferred_codec_config, should_use_preferred_codec); +} + TEST_P(LeAudioAseConfigurationTest, test_lc3_config_media_codec_extensibility_fb2) { if (codec_coding_format_ != kLeAudioCodingFormatLC3) { GTEST_SKIP(); diff --git a/system/bta/le_audio/le_audio_client_test.cc b/system/bta/le_audio/le_audio_client_test.cc index 49bd009db1..755282749c 100644 --- a/system/bta/le_audio/le_audio_client_test.cc +++ b/system/bta/le_audio/le_audio_client_test.cc @@ -39,6 +39,7 @@ #include "gatt/database_builder.h" #include "gmock/gmock.h" #include "hardware/bt_gatt_types.h" +#include "hardware/bt_le_audio.h" #include "hci/controller_interface_mock.h" #include "internal_include/stack_config.h" #include "le_audio/codec_manager.h" @@ -50,6 +51,7 @@ #include "mock_csis_client.h" #include "mock_device_groups.h" #include "mock_state_machine.h" +#include "stack/include/btm_status.h" #include "test/common/mock_functions.h" #include "test/mock/mock_main_shim_entry.h" #include "test/mock/mock_stack_btm_iso.h" @@ -232,6 +234,12 @@ std::unique_ptr<LeAudioSinkAudioHalClient> LeAudioSinkAudioHalClient::AcquireUni void LeAudioSinkAudioHalClient::DebugDump(int fd) {} +RawAddress GetTestAddress(uint8_t index) { + EXPECT_LT(index, UINT8_MAX); + RawAddress result = {{0xC0, 0xDE, 0xC0, 0xDE, 0x00, index}}; + return result; +} + class MockAudioHalClientCallbacks : public bluetooth::le_audio::LeAudioClientCallbacks { public: MOCK_METHOD((void), OnInitialized, (), (override)); @@ -675,49 +683,47 @@ protected: // default Characteristic read handler dispatches requests to service mocks ON_CALL(mock_gatt_queue_, ReadCharacteristic(_, _, _, _)) - .WillByDefault(Invoke( - [&](uint16_t conn_id, uint16_t handle, GATT_READ_OP_CB cb, void* cb_data) { - do_in_main_thread(base::BindOnce( - [](std::map<uint16_t, std::unique_ptr<NiceMock<MockDeviceWrapper>>>* - peer_devices, - uint16_t conn_id, uint16_t handle, GATT_READ_OP_CB cb, - void* cb_data) -> void { - if (peer_devices->count(conn_id)) { - auto& device = peer_devices->at(conn_id); - auto svc = std::find_if(device->services.begin(), - device->services.end(), - [handle](const gatt::Service& svc) { - return (handle >= svc.handle) && - (handle <= svc.end_handle); - }); - if (svc == device->services.end()) { - return; - } + .WillByDefault(Invoke([&](uint16_t conn_id, uint16_t handle, GATT_READ_OP_CB cb, + void* cb_data) { + do_in_main_thread(base::BindOnce( + [](std::map<uint16_t, std::unique_ptr<NiceMock<MockDeviceWrapper>>>* + peer_devices, + uint16_t conn_id, uint16_t handle, GATT_READ_OP_CB cb, + void* cb_data) -> void { + if (peer_devices->count(conn_id)) { + auto& device = peer_devices->at(conn_id); + auto svc = std::find_if(device->services.begin(), device->services.end(), + [handle](const gatt::Service& svc) { + return (handle >= svc.handle) && + (handle <= svc.end_handle); + }); + if (svc == device->services.end()) { + return; + } - GattStatus status; - std::vector<uint8_t> value; - // Dispatch to mockable handler functions - if (svc->handle == device->csis->start) { - std::tie(status, value) = - device->csis->OnGetCharacteristicValue(handle); - } else if (svc->handle == device->cas->start) { - std::tie(status, value) = - device->cas->OnGetCharacteristicValue(handle); - } else if (svc->handle == device->ascs->start) { - std::tie(status, value) = - device->ascs->OnGetCharacteristicValue(handle); - } else if (svc->handle == device->pacs->start) { - std::tie(status, value) = - device->pacs->OnGetCharacteristicValue(handle); - } else { - return; - } + GattStatus status; + std::vector<uint8_t> value; + // Dispatch to mockable handler functions + if (svc->handle == device->csis->start) { + std::tie(status, value) = + device->csis->OnGetCharacteristicValue(handle); + } else if (svc->handle == device->cas->start) { + std::tie(status, value) = device->cas->OnGetCharacteristicValue(handle); + } else if (svc->handle == device->ascs->start) { + std::tie(status, value) = + device->ascs->OnGetCharacteristicValue(handle); + } else if (svc->handle == device->pacs->start) { + std::tie(status, value) = + device->pacs->OnGetCharacteristicValue(handle); + } else { + return; + } - cb(conn_id, status, handle, value.size(), value.data(), cb_data); - } - }, - &peer_devices, conn_id, handle, cb, cb_data)); - })); + cb(conn_id, status, handle, value.size(), value.data(), cb_data); + } + }, + &peer_devices, conn_id, handle, cb, cb_data)); + })); // default multiple Characteristic read handler dispatches requests to service mocks ON_CALL(mock_gatt_queue_, ReadMultiCharacteristic(_, _, _, _)) @@ -989,10 +995,15 @@ protected: types::BidirectionalPair<types::AudioContexts> metadata_context_types, types::BidirectionalPair<std::vector<uint8_t>> ccid_lists) { + auto group_state = group->GetState(); + log::info("group {} state {}, context type {}", group->group_id_, + bluetooth::common::ToString(group_state), + bluetooth::common::ToString(context_type)); + /* Do nothing if already streaming - the implementation would * probably update the metadata. */ - if (group->GetState() == types::AseState::BTA_LE_AUDIO_ASE_STATE_STREAMING) { + if (group_state == types::AseState::BTA_LE_AUDIO_ASE_STATE_STREAMING) { return true; } @@ -1012,7 +1023,8 @@ protected: return false; } - if (group->GetState() == types::AseState::BTA_LE_AUDIO_ASE_STATE_IDLE) { + if (group_state == types::AseState::BTA_LE_AUDIO_ASE_STATE_IDLE || + group_state == types::AseState::BTA_LE_AUDIO_ASE_STATE_CODEC_CONFIGURED) { group->cig.GenerateCisIds(context_type); std::vector<uint16_t> conn_handles; @@ -1738,7 +1750,7 @@ protected: uint8_t rank, bool connect_through_csis = false, bool new_device = true) { SetSampleDatabaseEarbudsValid(conn_id, addr, sink_audio_allocation, source_audio_allocation, default_channel_cnt, default_channel_cnt, - 0x0004, /* source sample freq 16khz */ + 0x0034, /* source sample freq 16/24k/32hz */ true, /*add_csis*/ true, /*add_cas*/ true, /*add_pacs*/ @@ -2729,6 +2741,127 @@ protected: groups.clear(); UnicastTestNoInit::TearDown(); } + + void TestSetupRemoteDevices(int group_id) { + uint8_t group_size = 2; + + // Report working CSIS + ON_CALL(mock_csis_client_module_, IsCsisClientRunning()).WillByDefault(Return(true)); + + // First earbud + const RawAddress test_address0 = GetTestAddress(0); + EXPECT_CALL(mock_btif_storage_, AddLeaudioAutoconnect(test_address0, true)).Times(1); + ConnectCsisDevice(test_address0, 1 /*conn_id*/, codec_spec_conf::kLeAudioLocationFrontLeft, + codec_spec_conf::kLeAudioLocationFrontLeft, group_size, group_id, + 1 /* rank*/); + + // Second earbud + const RawAddress test_address1 = GetTestAddress(1); + EXPECT_CALL(mock_btif_storage_, AddLeaudioAutoconnect(test_address1, true)).Times(1); + ConnectCsisDevice(test_address1, 2 /*conn_id*/, codec_spec_conf::kLeAudioLocationFrontRight, + codec_spec_conf::kLeAudioLocationFrontRight, group_size, group_id, + 2 /* rank*/, true /*connect_through_csis*/); + + constexpr int gmcs_ccid = 1; + constexpr int gtbs_ccid = 2; + EXPECT_CALL(*mock_le_audio_source_hal_client_, Start(_, _, _)).Times(1); + EXPECT_CALL(*mock_le_audio_sink_hal_client_, Start(_, _, _)).Times(1); + LeAudioClient::Get()->SetCcidInformation(gmcs_ccid, + static_cast<int>(LeAudioContextType::MEDIA)); + LeAudioClient::Get()->SetCcidInformation(gtbs_ccid, + static_cast<int>(LeAudioContextType::CONVERSATIONAL)); + LeAudioClient::Get()->GroupSetActive(group_id); + } + + void TestSetCodecPreference( + const btle_audio_codec_config_t* preferred_codec_config_before_streaming, + const btle_audio_codec_config_t* preferred_codec_config_during_streaming, + LeAudioContextType context_type, int group_id, bool set_before_streaming, + bool set_while_streaming, bool is_using_set_before_streaming_codec_during_streaming, + bool is_using_set_while_streaming_codec_during_streaming, bool is_reconfig) { + auto config_before_streaming_str = preferred_codec_config_before_streaming + ? preferred_codec_config_before_streaming->ToString() + : "null"; + auto config_during_streaming_str = preferred_codec_config_during_streaming + ? preferred_codec_config_during_streaming->ToString() + : "null"; + log::debug( + "preferred_codec_config_before_streaming: {}, " + "preferred_codec_config_during_streaming: {}, context_type: {}, " + "group_id: {}, set_before_streaming: {}, " + "set_while_streaming: {}, " + "is_using_set_before_streaming_codec_during_streaming: " + "{},is_using_set_while_streaming_codec_during_streaming:{}, " + "is_reconfig: {}", + config_before_streaming_str, config_during_streaming_str, + bluetooth::common::ToString(context_type), group_id, set_before_streaming, + set_while_streaming, is_using_set_before_streaming_codec_during_streaming, + is_using_set_while_streaming_codec_during_streaming, is_reconfig); + + if (context_type != LeAudioContextType::MEDIA && + context_type != LeAudioContextType::CONVERSATIONAL) { + return; + } + + if (set_before_streaming) { + do_in_main_thread(base::BindOnce(&LeAudioClient::SetCodecConfigPreference, + base::Unretained(LeAudioClient::Get()), group_id, + *preferred_codec_config_before_streaming, + *preferred_codec_config_before_streaming)); + SyncOnMainLoop(); + } + + types::BidirectionalPair<std::vector<uint8_t>> ccids; + constexpr int gmcs_ccid = 1; + constexpr int gtbs_ccid = 2; + if (context_type == LeAudioContextType::MEDIA) { + ccids = types::BidirectionalPair<std::vector<uint8_t>>{{gmcs_ccid}, {}}; + EXPECT_CALL(mock_state_machine_, StartStream(_, _, _, ccids)).Times(1); + StartStreaming(AUDIO_USAGE_MEDIA, AUDIO_CONTENT_TYPE_MUSIC, group_id); + } else { + ccids = types::BidirectionalPair<std::vector<uint8_t>>{{gtbs_ccid}, {gtbs_ccid}}; + EXPECT_CALL(mock_state_machine_, StartStream(_, _, _, ccids)).Times(1); + StartStreaming(AUDIO_USAGE_VOICE_COMMUNICATION, AUDIO_CONTENT_TYPE_SPEECH, group_id); + } + Mock::VerifyAndClearExpectations(&mock_audio_hal_client_callbacks_); + Mock::VerifyAndClearExpectations(mock_le_audio_source_hal_client_); + + ASSERT_EQ(LeAudioClient::Get()->IsUsingPreferredCodecConfig(group_id, + static_cast<int>(context_type)), + is_using_set_before_streaming_codec_during_streaming); + + uint8_t cis_count_out = 2; + uint8_t cis_count_in = context_type == LeAudioContextType::MEDIA ? 0 : 2; + TestAudioDataTransfer(group_id, cis_count_out, cis_count_in, 1920); + + if (set_while_streaming) { + EXPECT_CALL(mock_state_machine_, StopStream(_)).Times(is_reconfig); + EXPECT_CALL(*mock_le_audio_source_hal_client_, ReconfigurationComplete()).Times(is_reconfig); + + do_in_main_thread(base::BindOnce(&LeAudioClient::SetCodecConfigPreference, + base::Unretained(LeAudioClient::Get()), group_id, + *preferred_codec_config_during_streaming, + *preferred_codec_config_during_streaming)); + SyncOnMainLoop(); + ASSERT_EQ(LeAudioClient::Get()->IsUsingPreferredCodecConfig(group_id, + static_cast<int>(context_type)), + is_using_set_while_streaming_codec_during_streaming); + + if (context_type == LeAudioContextType::MEDIA) { + ccids = types::BidirectionalPair<std::vector<uint8_t>>{{gmcs_ccid}, {}}; + EXPECT_CALL(mock_state_machine_, StartStream(_, _, _, ccids)).Times(1); + StartStreaming(AUDIO_USAGE_MEDIA, AUDIO_CONTENT_TYPE_MUSIC, group_id); + } else { + ccids = types::BidirectionalPair<std::vector<uint8_t>>{{gtbs_ccid}, {gtbs_ccid}}; + EXPECT_CALL(mock_state_machine_, StartStream(_, _, _, ccids)).Times(1); + StartStreaming(AUDIO_USAGE_VOICE_COMMUNICATION, AUDIO_CONTENT_TYPE_SPEECH, group_id); + } + } + + StopStreaming(group_id, context_type == LeAudioContextType::CONVERSATIONAL); + Mock::VerifyAndClearExpectations(&mock_audio_hal_client_callbacks_); + Mock::VerifyAndClearExpectations(&mock_state_machine_); + } }; class UnicastTestHealthStatus : public UnicastTest { @@ -2764,12 +2897,6 @@ protected: LeAudioDeviceGroup* group_ = nullptr; }; -RawAddress GetTestAddress(uint8_t index) { - EXPECT_LT(index, UINT8_MAX); - RawAddress result = {{0xC0, 0xDE, 0xC0, 0xDE, 0x00, index}}; - return result; -} - TEST_F(UnicastTest, Initialize) { ASSERT_NE(LeAudioClient::Get(), nullptr); ASSERT_TRUE(LeAudioClient::IsLeAudioClientRunning()); @@ -4143,7 +4270,7 @@ TEST_F(UnicastTestNoInit, LoadStoredEarbudsCsisGroupedDifferently) { ON_CALL(mock_btm_interface_, BTM_IsEncrypted(test_address0, _)) .WillByDefault(DoAll(Return(false))); ON_CALL(mock_btm_interface_, SetEncryption(test_address0, _, _, _, _)) - .WillByDefault(Return(BTM_SUCCESS)); + .WillByDefault(Return(tBTM_STATUS::BTM_SUCCESS)); /* For background connect, test needs to Inject Connected Event */ InjectConnectedEvent(test_address0, 1); @@ -6028,11 +6155,11 @@ TEST_F(UnicastTest, TwoEarbudsStreaming) { /* Make sure configurations are non empty */ btle_audio_codec_config_t call_config = {.codec_type = LE_AUDIO_CODEC_INDEX_SOURCE_LC3, - .sample_rate = LE_AUDIO_SAMPLE_RATE_INDEX_16000HZ, + .sample_rate = LE_AUDIO_SAMPLE_RATE_INDEX_32000HZ, .bits_per_sample = LE_AUDIO_BITS_PER_SAMPLE_INDEX_16, .channel_count = LE_AUDIO_CHANNEL_COUNT_INDEX_1, .frame_duration = LE_AUDIO_FRAME_DURATION_INDEX_10000US, - .octets_per_frame = 40}; + .octets_per_frame = 80}; EXPECT_CALL(mock_audio_hal_client_callbacks_, OnAudioGroupCurrentCodecConf(group_id, call_config, call_config)) @@ -6095,6 +6222,1313 @@ TEST_F(UnicastTest, TwoEarbudsStreaming) { .size()); } +TEST_F(UnicastTest, TestSetValidSingleOutputPreferredCodecConfig) { + com::android::bluetooth::flags::provider_->leaudio_set_codec_config_preference(true); + + btle_audio_codec_config_t preferred_output_codec_config = { + .codec_type = LE_AUDIO_CODEC_INDEX_SOURCE_LC3, + .sample_rate = LE_AUDIO_SAMPLE_RATE_INDEX_24000HZ, + .bits_per_sample = LE_AUDIO_BITS_PER_SAMPLE_INDEX_16, + .channel_count = LE_AUDIO_CHANNEL_COUNT_INDEX_1, + .frame_duration = LE_AUDIO_FRAME_DURATION_INDEX_10000US, + .octets_per_frame = 60}; + // We did not set input preferred codec config + btle_audio_codec_config_t empty_input_codec_config; + + int group_id = 2; + TestSetupRemoteDevices(group_id); + StartStreaming(AUDIO_USAGE_MEDIA, AUDIO_CONTENT_TYPE_MUSIC, group_id); + Mock::VerifyAndClearExpectations(&mock_audio_hal_client_callbacks_); + Mock::VerifyAndClearExpectations(mock_le_audio_source_hal_client_); + + ASSERT_EQ(LeAudioClient::Get()->IsUsingPreferredCodecConfig( + group_id, static_cast<int>(types::LeAudioContextType::MEDIA)), + false); + do_in_main_thread(base::BindOnce(&LeAudioClient::SetCodecConfigPreference, + base::Unretained(LeAudioClient::Get()), group_id, + empty_input_codec_config, preferred_output_codec_config)); + SyncOnMainLoop(); + ASSERT_EQ(LeAudioClient::Get()->IsUsingPreferredCodecConfig( + group_id, static_cast<int>(types::LeAudioContextType::MEDIA)), + true); + // We only set output preferred codec config so bidirectional context would + // use default config + ASSERT_EQ(LeAudioClient::Get()->IsUsingPreferredCodecConfig( + group_id, static_cast<int>(types::LeAudioContextType::CONVERSATIONAL)), + false); +} + +TEST_F(UnicastTest, TestSetPreferredCodecConfigToNonActiveGroup) { + com::android::bluetooth::flags::provider_->leaudio_set_codec_config_preference(true); + + int group_id = 2; + TestSetupRemoteDevices(group_id); + StartStreaming(AUDIO_USAGE_MEDIA, AUDIO_CONTENT_TYPE_MUSIC, group_id); + ASSERT_EQ(LeAudioClient::Get()->IsUsingPreferredCodecConfig( + group_id, static_cast<int>(types::LeAudioContextType::MEDIA)), + false); + + // Inactivate group 2 + LeAudioClient::Get()->GroupSetActive(bluetooth::groups::kGroupUnknown); + + btle_audio_codec_config_t preferred_codec_config = { + .codec_type = LE_AUDIO_CODEC_INDEX_SOURCE_LC3, + .sample_rate = LE_AUDIO_SAMPLE_RATE_INDEX_16000HZ, + .bits_per_sample = LE_AUDIO_BITS_PER_SAMPLE_INDEX_16, + .channel_count = LE_AUDIO_CHANNEL_COUNT_INDEX_1, + .frame_duration = LE_AUDIO_FRAME_DURATION_INDEX_10000US, + .octets_per_frame = 40}; + + // Re-initialize mock for destroyed hal client + RegisterSourceHalClientMock(); + RegisterSinkHalClientMock(); + + // Reconfiguration not needed as set preferred config to non active group + EXPECT_CALL(mock_state_machine_, StopStream(_)).Times(0); + EXPECT_CALL(*mock_le_audio_source_hal_client_, ReconfigurationComplete()).Times(0); + + do_in_main_thread(base::BindOnce(&LeAudioClient::SetCodecConfigPreference, + base::Unretained(LeAudioClient::Get()), group_id, + preferred_codec_config, preferred_codec_config)); + SyncOnMainLoop(); + + ASSERT_EQ(LeAudioClient::Get()->IsUsingPreferredCodecConfig( + group_id, static_cast<int>(types::LeAudioContextType::MEDIA)), + true); + Mock::VerifyAndClearExpectations(&mock_state_machine_); + Mock::VerifyAndClearExpectations(mock_le_audio_source_hal_client_); + + // Activate group 2 again + do_in_main_thread(base::BindOnce(&LeAudioClient::GroupSetActive, + base::Unretained(LeAudioClient::Get()), group_id)); + SyncOnMainLoop(); + + StartStreaming(AUDIO_USAGE_MEDIA, AUDIO_CONTENT_TYPE_MUSIC, group_id); + ASSERT_EQ(LeAudioClient::Get()->IsUsingPreferredCodecConfig( + group_id, static_cast<int>(types::LeAudioContextType::MEDIA)), + true); +} + +TEST_F(UnicastTest, TwoEarbudsClearPreferenceBeforeMedia) { + com::android::bluetooth::flags::provider_->leaudio_set_codec_config_preference(true); + + int group_id = 2; + TestSetupRemoteDevices(group_id); + + btle_audio_codec_config_t preferred_codec_config_before_media = {.codec_priority = -1}; + + bool set_before_media = true; + bool set_while_media = false; + bool is_using_set_before_media_codec_during_media = false; + bool is_using_set_while_media_codec_during_media = false; + // Use legacy codec and should not reconfig while streaming + bool is_reconfig = false; + TestSetCodecPreference(&preferred_codec_config_before_media, nullptr, LeAudioContextType::MEDIA, + group_id, set_before_media, set_while_media, + is_using_set_before_media_codec_during_media, + is_using_set_while_media_codec_during_media, is_reconfig); +} + +TEST_F(UnicastTest, TwoEarbudsSetPreferenceSuccessBeforeMedia) { + com::android::bluetooth::flags::provider_->leaudio_set_codec_config_preference(true); + + int group_id = 2; + TestSetupRemoteDevices(group_id); + + // This codec can be used by media + btle_audio_codec_config_t preferred_codec_config_before_media = { + .codec_type = LE_AUDIO_CODEC_INDEX_SOURCE_LC3, + .sample_rate = LE_AUDIO_SAMPLE_RATE_INDEX_16000HZ, + .bits_per_sample = LE_AUDIO_BITS_PER_SAMPLE_INDEX_16, + .channel_count = LE_AUDIO_CHANNEL_COUNT_INDEX_1, + .frame_duration = LE_AUDIO_FRAME_DURATION_INDEX_10000US, + .octets_per_frame = 40}; + + bool set_before_media = true; + bool set_while_media = false; + bool is_using_set_before_media_codec_during_media = true; + bool is_using_set_while_media_codec_during_media = false; + // Use preferred codec and should not reconfig while streaming + bool is_reconfig = false; + TestSetCodecPreference(&preferred_codec_config_before_media, nullptr, LeAudioContextType::MEDIA, + group_id, set_before_media, set_while_media, + is_using_set_before_media_codec_during_media, + is_using_set_while_media_codec_during_media, is_reconfig); +} + +TEST_F(UnicastTest, TwoEarbudsSetPreferenceFailBeforeMedia) { + com::android::bluetooth::flags::provider_->leaudio_set_codec_config_preference(true); + + int group_id = 2; + TestSetupRemoteDevices(group_id); + + // This codec can not be used by media + btle_audio_codec_config_t preferred_codec_config_before_media = { + .codec_type = LE_AUDIO_CODEC_INDEX_SOURCE_LC3, + .sample_rate = LE_AUDIO_SAMPLE_RATE_INDEX_16000HZ, + .bits_per_sample = LE_AUDIO_BITS_PER_SAMPLE_INDEX_16, + .channel_count = LE_AUDIO_CHANNEL_COUNT_INDEX_1, + .frame_duration = LE_AUDIO_FRAME_DURATION_INDEX_10000US, + .octets_per_frame = 70}; + + bool set_before_media = true; + bool set_while_media = false; + bool is_using_set_before_media_codec_during_media = false; + bool is_using_set_while_media_codec_during_media = false; + // Use legacy codec and should not reconfig while streaming + bool is_reconfig = false; + TestSetCodecPreference(&preferred_codec_config_before_media, nullptr, LeAudioContextType::MEDIA, + group_id, set_before_media, set_while_media, + is_using_set_before_media_codec_during_media, + is_using_set_while_media_codec_during_media, is_reconfig); +} + +TEST_F(UnicastTest, TwoEarbudsSetPreferenceSuccessDuringMediaWithReconfig) { + com::android::bluetooth::flags::provider_->leaudio_set_codec_config_preference(true); + + int group_id = 2; + TestSetupRemoteDevices(group_id); + + // This codec can be used by media + btle_audio_codec_config_t preferred_codec_config_during_media = { + .codec_type = LE_AUDIO_CODEC_INDEX_SOURCE_LC3, + .sample_rate = LE_AUDIO_SAMPLE_RATE_INDEX_24000HZ, + .bits_per_sample = LE_AUDIO_BITS_PER_SAMPLE_INDEX_16, + .channel_count = LE_AUDIO_CHANNEL_COUNT_INDEX_1, + .frame_duration = LE_AUDIO_FRAME_DURATION_INDEX_10000US, + .octets_per_frame = 60}; + + bool set_before_media = false; + bool set_while_media = true; + bool is_using_set_before_media_codec_during_media = false; + bool is_using_set_while_media_codec_during_media = true; + // Should reconfig and use preferred codec while streaming + bool is_reconfig = true; + TestSetCodecPreference(nullptr, &preferred_codec_config_during_media, LeAudioContextType::MEDIA, + group_id, set_before_media, set_while_media, + is_using_set_before_media_codec_during_media, + is_using_set_while_media_codec_during_media, is_reconfig); +} + +TEST_F(UnicastTest, TwoEarbudsSetPreferenceSuccessDuringMediaWithoutReconfig) { + com::android::bluetooth::flags::provider_->leaudio_set_codec_config_preference(true); + + int group_id = 2; + TestSetupRemoteDevices(group_id); + + // This codec can be used by media + btle_audio_codec_config_t preferred_codec_config_during_media = { + .codec_type = LE_AUDIO_CODEC_INDEX_SOURCE_LC3, + .sample_rate = LE_AUDIO_SAMPLE_RATE_INDEX_48000HZ, + .bits_per_sample = LE_AUDIO_BITS_PER_SAMPLE_INDEX_16, + .channel_count = LE_AUDIO_CHANNEL_COUNT_INDEX_1, + .frame_duration = LE_AUDIO_FRAME_DURATION_INDEX_10000US, + .octets_per_frame = 120}; + + bool set_before_media = false; + bool set_while_media = true; + bool is_using_set_before_media_codec_during_media = false; + bool is_using_set_while_media_codec_during_media = true; + // Use preferred codec but not reconfig while streaming since same codec with + // original + bool is_reconfig = false; + TestSetCodecPreference(nullptr, &preferred_codec_config_during_media, LeAudioContextType::MEDIA, + group_id, set_before_media, set_while_media, + is_using_set_before_media_codec_during_media, + is_using_set_while_media_codec_during_media, is_reconfig); +} + +TEST_F(UnicastTest, TwoEarbudsSetPreferenceFailDuringMediaWithoutReconfig) { + com::android::bluetooth::flags::provider_->leaudio_set_codec_config_preference(true); + + int group_id = 2; + TestSetupRemoteDevices(group_id); + + // This codec can not be used by media + btle_audio_codec_config_t preferred_codec_config_during_media = { + .codec_type = LE_AUDIO_CODEC_INDEX_SOURCE_LC3, + .sample_rate = LE_AUDIO_SAMPLE_RATE_INDEX_16000HZ, + .bits_per_sample = LE_AUDIO_BITS_PER_SAMPLE_INDEX_16, + .channel_count = LE_AUDIO_CHANNEL_COUNT_INDEX_1, + .frame_duration = LE_AUDIO_FRAME_DURATION_INDEX_10000US, + .octets_per_frame = 70}; + + bool set_before_media = false; + bool set_while_media = true; + bool is_using_set_before_media_codec_during_media = false; + bool is_using_set_while_media_codec_during_media = false; + // Use original codec and should not reconfig while streaming + bool is_reconfig = false; + TestSetCodecPreference(nullptr, &preferred_codec_config_during_media, LeAudioContextType::MEDIA, + group_id, set_before_media, set_while_media, + is_using_set_before_media_codec_during_media, + is_using_set_while_media_codec_during_media, is_reconfig); +} + +TEST_F(UnicastTest, + TwoEarbudsSetPreferenceSucessBeforeMediaClearPreferenceDuringMediaWithReconfig) { + com::android::bluetooth::flags::provider_->leaudio_set_codec_config_preference(true); + + int group_id = 2; + TestSetupRemoteDevices(group_id); + + // This codec can be used by media + btle_audio_codec_config_t preferred_codec_config_before_media = { + .codec_type = LE_AUDIO_CODEC_INDEX_SOURCE_LC3, + .sample_rate = LE_AUDIO_SAMPLE_RATE_INDEX_16000HZ, + .bits_per_sample = LE_AUDIO_BITS_PER_SAMPLE_INDEX_16, + .channel_count = LE_AUDIO_CHANNEL_COUNT_INDEX_1, + .frame_duration = LE_AUDIO_FRAME_DURATION_INDEX_10000US, + .octets_per_frame = 40}; + btle_audio_codec_config_t preferred_codec_config_during_media = {.codec_priority = -1}; + + bool set_before_media = true; + bool set_while_media = true; + bool is_using_set_before_media_codec_during_media = true; + bool is_using_set_while_media_codec_during_media = false; + // Should reconfig to legacy codec while streaming as we clear preferred codec + bool is_reconfig = true; + TestSetCodecPreference(&preferred_codec_config_before_media, &preferred_codec_config_during_media, + LeAudioContextType::MEDIA, group_id, set_before_media, set_while_media, + is_using_set_before_media_codec_during_media, + is_using_set_while_media_codec_during_media, is_reconfig); +} + +TEST_F(UnicastTest, + TwoEarbudsSetPreferenceSucessBeforeMediaSetPreferenceSuccessDuringMediaWithReconfig) { + com::android::bluetooth::flags::provider_->leaudio_set_codec_config_preference(true); + + int group_id = 2; + TestSetupRemoteDevices(group_id); + + // This codec can be used by media + btle_audio_codec_config_t preferred_codec_config_before_media = { + .codec_type = LE_AUDIO_CODEC_INDEX_SOURCE_LC3, + .sample_rate = LE_AUDIO_SAMPLE_RATE_INDEX_16000HZ, + .bits_per_sample = LE_AUDIO_BITS_PER_SAMPLE_INDEX_16, + .channel_count = LE_AUDIO_CHANNEL_COUNT_INDEX_1, + .frame_duration = LE_AUDIO_FRAME_DURATION_INDEX_10000US, + .octets_per_frame = 40}; + // This codec can be used by media + btle_audio_codec_config_t preferred_codec_config_during_media = { + .codec_type = LE_AUDIO_CODEC_INDEX_SOURCE_LC3, + .sample_rate = LE_AUDIO_SAMPLE_RATE_INDEX_24000HZ, + .bits_per_sample = LE_AUDIO_BITS_PER_SAMPLE_INDEX_16, + .channel_count = LE_AUDIO_CHANNEL_COUNT_INDEX_1, + .frame_duration = LE_AUDIO_FRAME_DURATION_INDEX_10000US, + .octets_per_frame = 60}; + + bool set_before_media = true; + bool set_while_media = true; + bool is_using_set_before_media_codec_during_media = true; + bool is_using_set_while_media_codec_during_media = true; + // Should reconfig to new preferred codec from old preferred codec while streaming + bool is_reconfig = true; + TestSetCodecPreference(&preferred_codec_config_before_media, &preferred_codec_config_during_media, + LeAudioContextType::MEDIA, group_id, set_before_media, set_while_media, + is_using_set_before_media_codec_during_media, + is_using_set_while_media_codec_during_media, is_reconfig); +} + +TEST_F(UnicastTest, + TwoEarbudsSetPreferenceSucessBeforeMediaSetPreferenceSuccessDuringMediaWithoutReconfig) { + com::android::bluetooth::flags::provider_->leaudio_set_codec_config_preference(true); + + int group_id = 2; + TestSetupRemoteDevices(group_id); + + // This codec can be used by media + btle_audio_codec_config_t preferred_codec_config_before_media = { + .codec_type = LE_AUDIO_CODEC_INDEX_SOURCE_LC3, + .sample_rate = LE_AUDIO_SAMPLE_RATE_INDEX_16000HZ, + .bits_per_sample = LE_AUDIO_BITS_PER_SAMPLE_INDEX_16, + .channel_count = LE_AUDIO_CHANNEL_COUNT_INDEX_1, + .frame_duration = LE_AUDIO_FRAME_DURATION_INDEX_10000US, + .octets_per_frame = 40}; + // This codec can be used by media + btle_audio_codec_config_t preferred_codec_config_during_media = { + .codec_type = LE_AUDIO_CODEC_INDEX_SOURCE_LC3, + .sample_rate = LE_AUDIO_SAMPLE_RATE_INDEX_16000HZ, + .bits_per_sample = LE_AUDIO_BITS_PER_SAMPLE_INDEX_16, + .channel_count = LE_AUDIO_CHANNEL_COUNT_INDEX_1, + .frame_duration = LE_AUDIO_FRAME_DURATION_INDEX_10000US, + .octets_per_frame = 40}; + + bool set_before_media = true; + bool set_while_media = true; + bool is_using_set_before_media_codec_during_media = true; + bool is_using_set_while_media_codec_during_media = true; + // Should not reconfig while streaming because same as previous preferred codec + bool is_reconfig = false; + TestSetCodecPreference(&preferred_codec_config_before_media, &preferred_codec_config_during_media, + LeAudioContextType::MEDIA, group_id, set_before_media, set_while_media, + is_using_set_before_media_codec_during_media, + is_using_set_while_media_codec_during_media, is_reconfig); +} + +TEST_F(UnicastTest, + TwoEarbudsSetPreferenceSucessBeforeMediaSetPreferenceFailDuringMediaWithReconfig) { + com::android::bluetooth::flags::provider_->leaudio_set_codec_config_preference(true); + + int group_id = 2; + TestSetupRemoteDevices(group_id); + + // This codec can be used by media + btle_audio_codec_config_t preferred_codec_config_before_media = { + .codec_type = LE_AUDIO_CODEC_INDEX_SOURCE_LC3, + .sample_rate = LE_AUDIO_SAMPLE_RATE_INDEX_16000HZ, + .bits_per_sample = LE_AUDIO_BITS_PER_SAMPLE_INDEX_16, + .channel_count = LE_AUDIO_CHANNEL_COUNT_INDEX_1, + .frame_duration = LE_AUDIO_FRAME_DURATION_INDEX_10000US, + .octets_per_frame = 40}; + // This codec can not be used by media + btle_audio_codec_config_t preferred_codec_config_during_media = { + .codec_type = LE_AUDIO_CODEC_INDEX_SOURCE_LC3, + .sample_rate = LE_AUDIO_SAMPLE_RATE_INDEX_16000HZ, + .bits_per_sample = LE_AUDIO_BITS_PER_SAMPLE_INDEX_16, + .channel_count = LE_AUDIO_CHANNEL_COUNT_INDEX_1, + .frame_duration = LE_AUDIO_FRAME_DURATION_INDEX_10000US, + .octets_per_frame = 70}; + + bool set_before_media = true; + bool set_while_media = true; + bool is_using_set_before_media_codec_during_media = true; + bool is_using_set_while_media_codec_during_media = false; + // Should reconfig to legacy codec while streaming because invalid preferred codec + bool is_reconfig = true; + TestSetCodecPreference(&preferred_codec_config_before_media, &preferred_codec_config_during_media, + LeAudioContextType::MEDIA, group_id, set_before_media, set_while_media, + is_using_set_before_media_codec_during_media, + is_using_set_while_media_codec_during_media, is_reconfig); +} + +TEST_F(UnicastTest, TwoEarbudsClearPreferenceBeforeConv) { + com::android::bluetooth::flags::provider_->leaudio_set_codec_config_preference(true); + + int group_id = 2; + TestSetupRemoteDevices(group_id); + + btle_audio_codec_config_t preferred_codec_config_before_conv = {.codec_priority = -1}; + + // SetInCall is used by GTBS - and only then we can expect CCID to be set. + LeAudioClient::Get()->SetInCall(true); + + bool set_before_conv = true; + bool set_while_conv = false; + bool is_using_set_before_conv_codec_during_conv = false; + bool is_using_set_while_conv_codec_during_conv = false; + // Use legacy codec and should not reconfig while streaming + bool is_reconfig = false; + TestSetCodecPreference(&preferred_codec_config_before_conv, nullptr, + LeAudioContextType::CONVERSATIONAL, group_id, set_before_conv, + set_while_conv, is_using_set_before_conv_codec_during_conv, + is_using_set_while_conv_codec_during_conv, is_reconfig); + LeAudioClient::Get()->SetInCall(false); +} + +TEST_F(UnicastTest, TwoEarbudsSetPreferenceSuccessBeforeConv) { + com::android::bluetooth::flags::provider_->leaudio_set_codec_config_preference(true); + + int group_id = 2; + TestSetupRemoteDevices(group_id); + + // This codec can be used by conv + btle_audio_codec_config_t preferred_codec_config_before_conv = { + .codec_type = LE_AUDIO_CODEC_INDEX_SOURCE_LC3, + .sample_rate = LE_AUDIO_SAMPLE_RATE_INDEX_16000HZ, + .bits_per_sample = LE_AUDIO_BITS_PER_SAMPLE_INDEX_16, + .channel_count = LE_AUDIO_CHANNEL_COUNT_INDEX_1, + .frame_duration = LE_AUDIO_FRAME_DURATION_INDEX_10000US, + .octets_per_frame = 40}; + + // SetInCall is used by GTBS - and only then we can expect CCID to be set. + LeAudioClient::Get()->SetInCall(true); + + bool set_before_conv = true; + bool set_while_conv = false; + bool is_using_set_before_conv_codec_during_conv = true; + bool is_using_set_while_conv_codec_during_conv = false; + // Use preferred codec and should not reconfig while streaming + bool is_reconfig = false; + TestSetCodecPreference(&preferred_codec_config_before_conv, nullptr, + LeAudioContextType::CONVERSATIONAL, group_id, set_before_conv, + set_while_conv, is_using_set_before_conv_codec_during_conv, + is_using_set_while_conv_codec_during_conv, is_reconfig); + LeAudioClient::Get()->SetInCall(false); +} + +TEST_F(UnicastTest, TwoEarbudsSetPreferenceFailBeforeConv) { + com::android::bluetooth::flags::provider_->leaudio_set_codec_config_preference(true); + + int group_id = 2; + TestSetupRemoteDevices(group_id); + + // This codec can not be used by conv + btle_audio_codec_config_t preferred_codec_config_before_conv = { + .codec_type = LE_AUDIO_CODEC_INDEX_SOURCE_LC3, + .sample_rate = LE_AUDIO_SAMPLE_RATE_INDEX_16000HZ, + .bits_per_sample = LE_AUDIO_BITS_PER_SAMPLE_INDEX_16, + .channel_count = LE_AUDIO_CHANNEL_COUNT_INDEX_1, + .frame_duration = LE_AUDIO_FRAME_DURATION_INDEX_10000US, + .octets_per_frame = 70}; + + // SetInCall is used by GTBS - and only then we can expect CCID to be set. + LeAudioClient::Get()->SetInCall(true); + + bool set_before_conv = true; + bool set_while_conv = false; + bool is_using_set_before_conv_codec_during_conv = false; + bool is_using_set_while_conv_codec_during_conv = false; + // Use legacy codec and should not reconfig while streaming + bool is_reconfig = false; + TestSetCodecPreference(&preferred_codec_config_before_conv, nullptr, + LeAudioContextType::CONVERSATIONAL, group_id, set_before_conv, + set_while_conv, is_using_set_before_conv_codec_during_conv, + is_using_set_while_conv_codec_during_conv, is_reconfig); + LeAudioClient::Get()->SetInCall(false); +} + +TEST_F(UnicastTest, TwoEarbudsSetPreferenceSuccessDuringConvWithReconfig) { + com::android::bluetooth::flags::provider_->leaudio_set_codec_config_preference(true); + + int group_id = 2; + TestSetupRemoteDevices(group_id); + + // This codec can be used by conv + btle_audio_codec_config_t preferred_codec_config_during_conv = { + .codec_type = LE_AUDIO_CODEC_INDEX_SOURCE_LC3, + .sample_rate = LE_AUDIO_SAMPLE_RATE_INDEX_16000HZ, + .bits_per_sample = LE_AUDIO_BITS_PER_SAMPLE_INDEX_16, + .channel_count = LE_AUDIO_CHANNEL_COUNT_INDEX_1, + .frame_duration = LE_AUDIO_FRAME_DURATION_INDEX_10000US, + .octets_per_frame = 40}; + + // SetInCall is used by GTBS - and only then we can expect CCID to be set. + LeAudioClient::Get()->SetInCall(true); + + bool set_before_conv = false; + bool set_while_conv = true; + bool is_using_set_before_conv_codec_during_conv = false; + bool is_using_set_while_conv_codec_during_conv = true; + // Should reconfig and use preferred codec while streaming + bool is_reconfig = true; + TestSetCodecPreference(nullptr, &preferred_codec_config_during_conv, + LeAudioContextType::CONVERSATIONAL, group_id, set_before_conv, + set_while_conv, is_using_set_before_conv_codec_during_conv, + is_using_set_while_conv_codec_during_conv, is_reconfig); + LeAudioClient::Get()->SetInCall(false); +} + +TEST_F(UnicastTest, TwoEarbudsSetPreferenceSuccessDuringConvWithoutReconfig) { + com::android::bluetooth::flags::provider_->leaudio_set_codec_config_preference(true); + + int group_id = 2; + TestSetupRemoteDevices(group_id); + + // This codec can be used by conv + btle_audio_codec_config_t preferred_codec_config_during_conv = { + .codec_type = LE_AUDIO_CODEC_INDEX_SOURCE_LC3, + .sample_rate = LE_AUDIO_SAMPLE_RATE_INDEX_32000HZ, + .bits_per_sample = LE_AUDIO_BITS_PER_SAMPLE_INDEX_16, + .channel_count = LE_AUDIO_CHANNEL_COUNT_INDEX_1, + .frame_duration = LE_AUDIO_FRAME_DURATION_INDEX_10000US, + .octets_per_frame = 80}; + + // SetInCall is used by GTBS - and only then we can expect CCID to be set. + LeAudioClient::Get()->SetInCall(true); + + bool set_before_conv = false; + bool set_while_conv = true; + bool is_using_set_before_conv_codec_during_conv = false; + bool is_using_set_while_conv_codec_during_conv = true; + // Use preferred codec but not reconfig while streaming since same codec with + // original + bool is_reconfig = false; + TestSetCodecPreference(nullptr, &preferred_codec_config_during_conv, + LeAudioContextType::CONVERSATIONAL, group_id, set_before_conv, + set_while_conv, is_using_set_before_conv_codec_during_conv, + is_using_set_while_conv_codec_during_conv, is_reconfig); + LeAudioClient::Get()->SetInCall(false); +} + +TEST_F(UnicastTest, TwoEarbudsSetPreferenceFailDuringConvWithoutReconfig) { + com::android::bluetooth::flags::provider_->leaudio_set_codec_config_preference(true); + + int group_id = 2; + TestSetupRemoteDevices(group_id); + + // This codec can not be used by conv + btle_audio_codec_config_t preferred_codec_config_during_conv = { + .codec_type = LE_AUDIO_CODEC_INDEX_SOURCE_LC3, + .sample_rate = LE_AUDIO_SAMPLE_RATE_INDEX_16000HZ, + .bits_per_sample = LE_AUDIO_BITS_PER_SAMPLE_INDEX_16, + .channel_count = LE_AUDIO_CHANNEL_COUNT_INDEX_1, + .frame_duration = LE_AUDIO_FRAME_DURATION_INDEX_10000US, + .octets_per_frame = 70}; + + // SetInCall is used by GTBS - and only then we can expect CCID to be set. + LeAudioClient::Get()->SetInCall(true); + + bool set_before_conv = false; + bool set_while_conv = true; + bool is_using_set_before_conv_codec_during_conv = false; + bool is_using_set_while_conv_codec_during_conv = false; + // Use original codec and should not reconfig while streaming + bool is_reconfig = false; + TestSetCodecPreference(nullptr, &preferred_codec_config_during_conv, + LeAudioContextType::CONVERSATIONAL, group_id, set_before_conv, + set_while_conv, is_using_set_before_conv_codec_during_conv, + is_using_set_while_conv_codec_during_conv, is_reconfig); + LeAudioClient::Get()->SetInCall(false); +} + +TEST_F(UnicastTest, TwoEarbudsSetPreferenceSucessBeforeConvClearPreferenceDuringConvWithReconfig) { + com::android::bluetooth::flags::provider_->leaudio_set_codec_config_preference(true); + + int group_id = 2; + TestSetupRemoteDevices(group_id); + + // This codec can be used by conv + btle_audio_codec_config_t preferred_codec_config_before_conv = { + .codec_type = LE_AUDIO_CODEC_INDEX_SOURCE_LC3, + .sample_rate = LE_AUDIO_SAMPLE_RATE_INDEX_16000HZ, + .bits_per_sample = LE_AUDIO_BITS_PER_SAMPLE_INDEX_16, + .channel_count = LE_AUDIO_CHANNEL_COUNT_INDEX_1, + .frame_duration = LE_AUDIO_FRAME_DURATION_INDEX_10000US, + .octets_per_frame = 40}; + btle_audio_codec_config_t preferred_codec_config_during_conv = {.codec_priority = -1}; + + // SetInCall is used by GTBS - and only then we can expect CCID to be set. + LeAudioClient::Get()->SetInCall(true); + + bool set_before_conv = true; + bool set_while_conv = true; + bool is_using_set_before_conv_codec_during_conv = true; + bool is_using_set_while_conv_codec_during_conv = false; + // Should reconfig to legacy codec while streaming as we clear preferred codec + bool is_reconfig = true; + TestSetCodecPreference(&preferred_codec_config_before_conv, &preferred_codec_config_during_conv, + LeAudioContextType::CONVERSATIONAL, group_id, set_before_conv, + set_while_conv, is_using_set_before_conv_codec_during_conv, + is_using_set_while_conv_codec_during_conv, is_reconfig); + LeAudioClient::Get()->SetInCall(false); +} + +TEST_F(UnicastTest, + TwoEarbudsSetPreferenceSucessBeforeConvSetPreferenceSuccessDuringConvWithReconfig) { + com::android::bluetooth::flags::provider_->leaudio_set_codec_config_preference(true); + + int group_id = 2; + TestSetupRemoteDevices(group_id); + + // This codec can be used by conv + btle_audio_codec_config_t preferred_codec_config_before_conv = { + .codec_type = LE_AUDIO_CODEC_INDEX_SOURCE_LC3, + .sample_rate = LE_AUDIO_SAMPLE_RATE_INDEX_16000HZ, + .bits_per_sample = LE_AUDIO_BITS_PER_SAMPLE_INDEX_16, + .channel_count = LE_AUDIO_CHANNEL_COUNT_INDEX_1, + .frame_duration = LE_AUDIO_FRAME_DURATION_INDEX_10000US, + .octets_per_frame = 40}; + // This codec can be used by conv + btle_audio_codec_config_t preferred_codec_config_during_conv = { + .codec_type = LE_AUDIO_CODEC_INDEX_SOURCE_LC3, + .sample_rate = LE_AUDIO_SAMPLE_RATE_INDEX_32000HZ, + .bits_per_sample = LE_AUDIO_BITS_PER_SAMPLE_INDEX_16, + .channel_count = LE_AUDIO_CHANNEL_COUNT_INDEX_1, + .frame_duration = LE_AUDIO_FRAME_DURATION_INDEX_10000US, + .octets_per_frame = 80}; + + // SetInCall is used by GTBS - and only then we can expect CCID to be set. + LeAudioClient::Get()->SetInCall(true); + + bool set_before_conv = true; + bool set_while_conv = true; + bool is_using_set_before_conv_codec_during_conv = true; + bool is_using_set_while_conv_codec_during_conv = true; + // Should reconfig to new preferred codec from old preferred codec while + // streaming + bool is_reconfig = true; + TestSetCodecPreference(&preferred_codec_config_before_conv, &preferred_codec_config_during_conv, + LeAudioContextType::CONVERSATIONAL, group_id, set_before_conv, + set_while_conv, is_using_set_before_conv_codec_during_conv, + is_using_set_while_conv_codec_during_conv, is_reconfig); + LeAudioClient::Get()->SetInCall(false); +} + +TEST_F(UnicastTest, + TwoEarbudsSetPreferenceSucessBeforeConvSetPreferenceSuccessDuringConvWithoutReconfig) { + com::android::bluetooth::flags::provider_->leaudio_set_codec_config_preference(true); + + int group_id = 2; + TestSetupRemoteDevices(group_id); + + // This codec can be used by conv + btle_audio_codec_config_t preferred_codec_config_before_conv = { + .codec_type = LE_AUDIO_CODEC_INDEX_SOURCE_LC3, + .sample_rate = LE_AUDIO_SAMPLE_RATE_INDEX_16000HZ, + .bits_per_sample = LE_AUDIO_BITS_PER_SAMPLE_INDEX_16, + .channel_count = LE_AUDIO_CHANNEL_COUNT_INDEX_1, + .frame_duration = LE_AUDIO_FRAME_DURATION_INDEX_10000US, + .octets_per_frame = 40}; + // This codec can be used by conv + btle_audio_codec_config_t preferred_codec_config_during_conv = { + .codec_type = LE_AUDIO_CODEC_INDEX_SOURCE_LC3, + .sample_rate = LE_AUDIO_SAMPLE_RATE_INDEX_16000HZ, + .bits_per_sample = LE_AUDIO_BITS_PER_SAMPLE_INDEX_16, + .channel_count = LE_AUDIO_CHANNEL_COUNT_INDEX_1, + .frame_duration = LE_AUDIO_FRAME_DURATION_INDEX_10000US, + .octets_per_frame = 40}; + + // SetInCall is used by GTBS - and only then we can expect CCID to be set. + LeAudioClient::Get()->SetInCall(true); + + bool set_before_conv = true; + bool set_while_conv = true; + bool is_using_set_before_conv_codec_during_conv = true; + bool is_using_set_while_conv_codec_during_conv = true; + // Should not reconfig while streaming because same as previous preferred + // codec + bool is_reconfig = false; + TestSetCodecPreference(&preferred_codec_config_before_conv, &preferred_codec_config_during_conv, + LeAudioContextType::CONVERSATIONAL, group_id, set_before_conv, + set_while_conv, is_using_set_before_conv_codec_during_conv, + is_using_set_while_conv_codec_during_conv, is_reconfig); + LeAudioClient::Get()->SetInCall(false); +} + +TEST_F(UnicastTest, + TwoEarbudsSetPreferenceSucessBeforeConvSetPreferenceFailDuringConvWithReconfig) { + com::android::bluetooth::flags::provider_->leaudio_set_codec_config_preference(true); + + int group_id = 2; + TestSetupRemoteDevices(group_id); + + // This codec can be used by conv + btle_audio_codec_config_t preferred_codec_config_before_conv = { + .codec_type = LE_AUDIO_CODEC_INDEX_SOURCE_LC3, + .sample_rate = LE_AUDIO_SAMPLE_RATE_INDEX_16000HZ, + .bits_per_sample = LE_AUDIO_BITS_PER_SAMPLE_INDEX_16, + .channel_count = LE_AUDIO_CHANNEL_COUNT_INDEX_1, + .frame_duration = LE_AUDIO_FRAME_DURATION_INDEX_10000US, + .octets_per_frame = 40}; + // This codec can not be used by conv + btle_audio_codec_config_t preferred_codec_config_during_conv = { + .codec_type = LE_AUDIO_CODEC_INDEX_SOURCE_LC3, + .sample_rate = LE_AUDIO_SAMPLE_RATE_INDEX_16000HZ, + .bits_per_sample = LE_AUDIO_BITS_PER_SAMPLE_INDEX_16, + .channel_count = LE_AUDIO_CHANNEL_COUNT_INDEX_1, + .frame_duration = LE_AUDIO_FRAME_DURATION_INDEX_10000US, + .octets_per_frame = 70}; + + // SetInCall is used by GTBS - and only then we can expect CCID to be set. + LeAudioClient::Get()->SetInCall(true); + + bool set_before_conv = true; + bool set_while_conv = true; + bool is_using_set_before_conv_codec_during_conv = true; + bool is_using_set_while_conv_codec_during_conv = false; + // Should reconfig to legacy codec while streaming because invalid preferred + // codec + bool is_reconfig = true; + TestSetCodecPreference(&preferred_codec_config_before_conv, &preferred_codec_config_during_conv, + LeAudioContextType::CONVERSATIONAL, group_id, set_before_conv, + set_while_conv, is_using_set_before_conv_codec_during_conv, + is_using_set_while_conv_codec_during_conv, is_reconfig); + LeAudioClient::Get()->SetInCall(false); +} + +TEST_F(UnicastTest, TwoEarbudsSetPreferenceWhenIdleForBothMediaAndConv) { + com::android::bluetooth::flags::provider_->leaudio_set_codec_config_preference(true); + + int group_id = 2; + TestSetupRemoteDevices(group_id); + + // This codec can be used by media and conv + btle_audio_codec_config_t preferred_codec_config_before_media = { + .codec_type = LE_AUDIO_CODEC_INDEX_SOURCE_LC3, + .sample_rate = LE_AUDIO_SAMPLE_RATE_INDEX_16000HZ, + .bits_per_sample = LE_AUDIO_BITS_PER_SAMPLE_INDEX_16, + .channel_count = LE_AUDIO_CHANNEL_COUNT_INDEX_1, + .frame_duration = LE_AUDIO_FRAME_DURATION_INDEX_10000US, + .octets_per_frame = 40}; + + bool set_before_media = true; + bool set_while_media = false; + bool is_using_set_before_media_codec_during_media = true; + bool is_using_set_while_media_codec_during_media = false; + bool is_reconfig = false; + TestSetCodecPreference(&preferred_codec_config_before_media, nullptr, LeAudioContextType::MEDIA, + group_id, set_before_media, set_while_media, + is_using_set_before_media_codec_during_media, + is_using_set_while_media_codec_during_media, is_reconfig); + + // simulate suspend timeout passed, alarm executing + fake_osi_alarm_set_on_mloop_.cb(fake_osi_alarm_set_on_mloop_.data); + SyncOnMainLoop(); + + // SetInCall is used by GTBS - and only then we can expect CCID to be set. + LeAudioClient::Get()->SetInCall(true); + + bool set_before_conv = false; + bool set_while_conv = false; + bool is_using_set_before_conv_codec_during_conv = true; + bool is_using_set_while_conv_codec_during_conv = false; + is_reconfig = false; + TestSetCodecPreference(nullptr, nullptr, LeAudioContextType::CONVERSATIONAL, group_id, + set_before_conv, set_while_conv, + is_using_set_before_conv_codec_during_conv, + is_using_set_while_conv_codec_during_conv, is_reconfig); + LeAudioClient::Get()->SetInCall(false); + + // should use preferred codec when switching back to media + ASSERT_EQ(LeAudioClient::Get()->IsUsingPreferredCodecConfig( + group_id, static_cast<int>(types::LeAudioContextType::MEDIA)), + true); +} + +TEST_F(UnicastTest, TwoEarbudsSetPreferenceWhenIdleForMediaNotForConv) { + com::android::bluetooth::flags::provider_->leaudio_set_codec_config_preference(true); + + int group_id = 2; + TestSetupRemoteDevices(group_id); + + // This codec can be used by media but not by conv + btle_audio_codec_config_t preferred_codec_config_before_media = { + .codec_type = LE_AUDIO_CODEC_INDEX_SOURCE_LC3, + .sample_rate = LE_AUDIO_SAMPLE_RATE_INDEX_24000HZ, + .bits_per_sample = LE_AUDIO_BITS_PER_SAMPLE_INDEX_16, + .channel_count = LE_AUDIO_CHANNEL_COUNT_INDEX_1, + .frame_duration = LE_AUDIO_FRAME_DURATION_INDEX_10000US, + .octets_per_frame = 60}; + + bool set_before_media = true; + bool set_while_media = false; + bool is_using_set_before_media_codec_during_media = true; + bool is_using_set_while_media_codec_during_media = false; + bool is_reconfig = false; + TestSetCodecPreference(&preferred_codec_config_before_media, nullptr, LeAudioContextType::MEDIA, + group_id, set_before_media, set_while_media, + is_using_set_before_media_codec_during_media, + is_using_set_while_media_codec_during_media, is_reconfig); + + // simulate suspend timeout passed, alarm executing + fake_osi_alarm_set_on_mloop_.cb(fake_osi_alarm_set_on_mloop_.data); + SyncOnMainLoop(); + + // SetInCall is used by GTBS - and only then we can expect CCID to be set. + LeAudioClient::Get()->SetInCall(true); + + bool set_before_conv = false; + bool set_while_conv = false; + bool is_using_set_before_conv_codec_during_conv = false; + bool is_using_set_while_conv_codec_during_conv = false; + is_reconfig = false; + TestSetCodecPreference(nullptr, nullptr, LeAudioContextType::CONVERSATIONAL, group_id, + set_before_conv, set_while_conv, + is_using_set_before_conv_codec_during_conv, + is_using_set_while_conv_codec_during_conv, is_reconfig); + LeAudioClient::Get()->SetInCall(false); + + // should use preferred codec when switching back to media + ASSERT_EQ(LeAudioClient::Get()->IsUsingPreferredCodecConfig( + group_id, static_cast<int>(types::LeAudioContextType::MEDIA)), + true); +} + +TEST_F(UnicastTest, TwoEarbudsSetPreferenceWhenIdleNotForMediaForConv) { + com::android::bluetooth::flags::provider_->leaudio_set_codec_config_preference(true); + + int group_id = 2; + TestSetupRemoteDevices(group_id); + + // This codec can not be used by media but by conv + btle_audio_codec_config_t preferred_codec_config_before_media = { + .codec_type = LE_AUDIO_CODEC_INDEX_SOURCE_LC3, + .sample_rate = LE_AUDIO_SAMPLE_RATE_INDEX_32000HZ, + .bits_per_sample = LE_AUDIO_BITS_PER_SAMPLE_INDEX_16, + .channel_count = LE_AUDIO_CHANNEL_COUNT_INDEX_1, + .frame_duration = LE_AUDIO_FRAME_DURATION_INDEX_10000US, + .octets_per_frame = 80}; + + bool set_before_media = true; + bool set_while_media = false; + bool is_using_set_before_media_codec_during_media = false; + bool is_using_set_while_media_codec_during_media = false; + bool is_reconfig = false; + TestSetCodecPreference(&preferred_codec_config_before_media, nullptr, LeAudioContextType::MEDIA, + group_id, set_before_media, set_while_media, + is_using_set_before_media_codec_during_media, + is_using_set_while_media_codec_during_media, is_reconfig); + + // simulate suspend timeout passed, alarm executing + fake_osi_alarm_set_on_mloop_.cb(fake_osi_alarm_set_on_mloop_.data); + SyncOnMainLoop(); + + // SetInCall is used by GTBS - and only then we can expect CCID to be set. + LeAudioClient::Get()->SetInCall(true); + + bool set_before_conv = false; + bool set_while_conv = false; + bool is_using_set_before_conv_codec_during_conv = true; + bool is_using_set_while_conv_codec_during_conv = false; + is_reconfig = false; + TestSetCodecPreference(nullptr, nullptr, LeAudioContextType::CONVERSATIONAL, group_id, + set_before_conv, set_while_conv, + is_using_set_before_conv_codec_during_conv, + is_using_set_while_conv_codec_during_conv, is_reconfig); + LeAudioClient::Get()->SetInCall(false); + + // should use legacy codec when switching back to media + ASSERT_EQ(LeAudioClient::Get()->IsUsingPreferredCodecConfig( + group_id, static_cast<int>(types::LeAudioContextType::MEDIA)), + false); +} + +TEST_F(UnicastTest, TwoEarbudsSetPreferenceWhenIdleNotForBothMediaAndConv) { + com::android::bluetooth::flags::provider_->leaudio_set_codec_config_preference(true); + + int group_id = 2; + TestSetupRemoteDevices(group_id); + + // This codec can not be used by media and conv + btle_audio_codec_config_t preferred_codec_config_before_media = { + .codec_type = LE_AUDIO_CODEC_INDEX_SOURCE_LC3, + .sample_rate = LE_AUDIO_SAMPLE_RATE_INDEX_24000HZ, + .bits_per_sample = LE_AUDIO_BITS_PER_SAMPLE_INDEX_16, + .channel_count = LE_AUDIO_CHANNEL_COUNT_INDEX_1, + .frame_duration = LE_AUDIO_FRAME_DURATION_INDEX_10000US, + .octets_per_frame = 10}; + + bool set_before_media = true; + bool set_while_media = false; + bool is_using_set_before_media_codec_during_media = false; + bool is_using_set_while_media_codec_during_media = false; + bool is_reconfig = false; + TestSetCodecPreference(&preferred_codec_config_before_media, nullptr, LeAudioContextType::MEDIA, + group_id, set_before_media, set_while_media, + is_using_set_before_media_codec_during_media, + is_using_set_while_media_codec_during_media, is_reconfig); + + // simulate suspend timeout passed, alarm executing + fake_osi_alarm_set_on_mloop_.cb(fake_osi_alarm_set_on_mloop_.data); + SyncOnMainLoop(); + + // SetInCall is used by GTBS - and only then we can expect CCID to be set. + LeAudioClient::Get()->SetInCall(true); + + bool set_before_conv = false; + bool set_while_conv = false; + bool is_using_set_before_conv_codec_during_conv = false; + bool is_using_set_while_conv_codec_during_conv = false; + is_reconfig = false; + TestSetCodecPreference(nullptr, nullptr, LeAudioContextType::CONVERSATIONAL, group_id, + set_before_conv, set_while_conv, + is_using_set_before_conv_codec_during_conv, + is_using_set_while_conv_codec_during_conv, is_reconfig); + LeAudioClient::Get()->SetInCall(false); + + // should use legacy codec when switching back to media + ASSERT_EQ(LeAudioClient::Get()->IsUsingPreferredCodecConfig( + group_id, static_cast<int>(types::LeAudioContextType::MEDIA)), + false); +} + +TEST_F(UnicastTest, TwoEarbudsSetPreferenceWhenMediaForBothMediaAndConv) { + com::android::bluetooth::flags::provider_->leaudio_set_codec_config_preference(true); + + int group_id = 2; + TestSetupRemoteDevices(group_id); + + // This codec can be used by media and conv + btle_audio_codec_config_t preferred_codec_config_during_media = { + .codec_type = LE_AUDIO_CODEC_INDEX_SOURCE_LC3, + .sample_rate = LE_AUDIO_SAMPLE_RATE_INDEX_16000HZ, + .bits_per_sample = LE_AUDIO_BITS_PER_SAMPLE_INDEX_16, + .channel_count = LE_AUDIO_CHANNEL_COUNT_INDEX_1, + .frame_duration = LE_AUDIO_FRAME_DURATION_INDEX_10000US, + .octets_per_frame = 40}; + + bool set_before_media = false; + bool set_while_media = true; + bool is_using_set_before_media_codec_during_media = false; + bool is_using_set_while_media_codec_during_media = true; + // should use preferred codec and reconfig + bool is_reconfig = true; + TestSetCodecPreference(nullptr, &preferred_codec_config_during_media, LeAudioContextType::MEDIA, + group_id, set_before_media, set_while_media, + is_using_set_before_media_codec_during_media, + is_using_set_while_media_codec_during_media, is_reconfig); + + // simulate suspend timeout passed, alarm executing + fake_osi_alarm_set_on_mloop_.cb(fake_osi_alarm_set_on_mloop_.data); + SyncOnMainLoop(); + + // SetInCall is used by GTBS - and only then we can expect CCID to be set. + LeAudioClient::Get()->SetInCall(true); + + bool set_before_conv = false; + bool set_while_conv = false; + bool is_using_set_before_conv_codec_during_conv = true; + bool is_using_set_while_conv_codec_during_conv = false; + is_reconfig = false; + TestSetCodecPreference(nullptr, nullptr, LeAudioContextType::CONVERSATIONAL, group_id, + set_before_conv, set_while_conv, + is_using_set_before_conv_codec_during_conv, + is_using_set_while_conv_codec_during_conv, is_reconfig); + LeAudioClient::Get()->SetInCall(false); + + // should use preferred codec when switching back to media + ASSERT_EQ(LeAudioClient::Get()->IsUsingPreferredCodecConfig( + group_id, static_cast<int>(types::LeAudioContextType::MEDIA)), + true); +} + +TEST_F(UnicastTest, TwoEarbudsSetPreferenceWhenMediaForMediaNotForConv) { + com::android::bluetooth::flags::provider_->leaudio_set_codec_config_preference(true); + + int group_id = 2; + TestSetupRemoteDevices(group_id); + + // This codec can be used by media but not by conv + btle_audio_codec_config_t preferred_codec_config_during_media = { + .codec_type = LE_AUDIO_CODEC_INDEX_SOURCE_LC3, + .sample_rate = LE_AUDIO_SAMPLE_RATE_INDEX_24000HZ, + .bits_per_sample = LE_AUDIO_BITS_PER_SAMPLE_INDEX_16, + .channel_count = LE_AUDIO_CHANNEL_COUNT_INDEX_1, + .frame_duration = LE_AUDIO_FRAME_DURATION_INDEX_10000US, + .octets_per_frame = 60}; + + bool set_before_media = false; + bool set_while_media = true; + bool is_using_set_before_media_codec_during_media = false; + bool is_using_set_while_media_codec_during_media = true; + // should use preferred codec and reconfig + bool is_reconfig = true; + TestSetCodecPreference(nullptr, &preferred_codec_config_during_media, LeAudioContextType::MEDIA, + group_id, set_before_media, set_while_media, + is_using_set_before_media_codec_during_media, + is_using_set_while_media_codec_during_media, is_reconfig); + + // simulate suspend timeout passed, alarm executing + fake_osi_alarm_set_on_mloop_.cb(fake_osi_alarm_set_on_mloop_.data); + SyncOnMainLoop(); + + // SetInCall is used by GTBS - and only then we can expect CCID to be set. + LeAudioClient::Get()->SetInCall(true); + + bool set_before_conv = false; + bool set_while_conv = false; + bool is_using_set_before_conv_codec_during_conv = false; + bool is_using_set_while_conv_codec_during_conv = false; + is_reconfig = false; + TestSetCodecPreference(nullptr, nullptr, LeAudioContextType::CONVERSATIONAL, group_id, + set_before_conv, set_while_conv, + is_using_set_before_conv_codec_during_conv, + is_using_set_while_conv_codec_during_conv, is_reconfig); + LeAudioClient::Get()->SetInCall(false); + + // should use preferred codec when switching back to media + ASSERT_EQ(LeAudioClient::Get()->IsUsingPreferredCodecConfig( + group_id, static_cast<int>(types::LeAudioContextType::MEDIA)), + true); +} + +TEST_F(UnicastTest, TwoEarbudsSetPreferenceWhenMediaNotForMediaForConv) { + com::android::bluetooth::flags::provider_->leaudio_set_codec_config_preference(true); + + int group_id = 2; + TestSetupRemoteDevices(group_id); + + // This codec can not be used by media and but by conv + btle_audio_codec_config_t preferred_codec_config_during_media = { + .codec_type = LE_AUDIO_CODEC_INDEX_SOURCE_LC3, + .sample_rate = LE_AUDIO_SAMPLE_RATE_INDEX_32000HZ, + .bits_per_sample = LE_AUDIO_BITS_PER_SAMPLE_INDEX_16, + .channel_count = LE_AUDIO_CHANNEL_COUNT_INDEX_1, + .frame_duration = LE_AUDIO_FRAME_DURATION_INDEX_10000US, + .octets_per_frame = 80}; + + bool set_before_media = false; + bool set_while_media = true; + bool is_using_set_before_media_codec_during_media = false; + bool is_using_set_while_media_codec_during_media = false; + // should use legacy codec + bool is_reconfig = false; + TestSetCodecPreference(nullptr, &preferred_codec_config_during_media, LeAudioContextType::MEDIA, + group_id, set_before_media, set_while_media, + is_using_set_before_media_codec_during_media, + is_using_set_while_media_codec_during_media, is_reconfig); + + // simulate suspend timeout passed, alarm executing + fake_osi_alarm_set_on_mloop_.cb(fake_osi_alarm_set_on_mloop_.data); + SyncOnMainLoop(); + + // SetInCall is used by GTBS - and only then we can expect CCID to be set. + LeAudioClient::Get()->SetInCall(true); + + bool set_before_conv = false; + bool set_while_conv = false; + bool is_using_set_before_conv_codec_during_conv = true; + bool is_using_set_while_conv_codec_during_conv = false; + is_reconfig = false; + TestSetCodecPreference(nullptr, nullptr, LeAudioContextType::CONVERSATIONAL, group_id, + set_before_conv, set_while_conv, + is_using_set_before_conv_codec_during_conv, + is_using_set_while_conv_codec_during_conv, is_reconfig); + LeAudioClient::Get()->SetInCall(false); + + // should use legacy codec when switching back to media + ASSERT_EQ(LeAudioClient::Get()->IsUsingPreferredCodecConfig( + group_id, static_cast<int>(types::LeAudioContextType::MEDIA)), + false); +} + +TEST_F(UnicastTest, TwoEarbudsSetPreferenceWhenMediaNotForBothMediaAndConv) { + com::android::bluetooth::flags::provider_->leaudio_set_codec_config_preference(true); + + int group_id = 2; + TestSetupRemoteDevices(group_id); + + // This codec can not be used by media and conv + btle_audio_codec_config_t preferred_codec_config_during_media = { + .codec_type = LE_AUDIO_CODEC_INDEX_SOURCE_LC3, + .sample_rate = LE_AUDIO_SAMPLE_RATE_INDEX_24000HZ, + .bits_per_sample = LE_AUDIO_BITS_PER_SAMPLE_INDEX_16, + .channel_count = LE_AUDIO_CHANNEL_COUNT_INDEX_1, + .frame_duration = LE_AUDIO_FRAME_DURATION_INDEX_10000US, + .octets_per_frame = 70}; + + bool set_before_media = false; + bool set_while_media = true; + bool is_using_set_before_media_codec_during_media = false; + bool is_using_set_while_media_codec_during_media = false; + // should use legacy codec + bool is_reconfig = false; + TestSetCodecPreference(nullptr, &preferred_codec_config_during_media, LeAudioContextType::MEDIA, + group_id, set_before_media, set_while_media, + is_using_set_before_media_codec_during_media, + is_using_set_while_media_codec_during_media, is_reconfig); + + // simulate suspend timeout passed, alarm executing + fake_osi_alarm_set_on_mloop_.cb(fake_osi_alarm_set_on_mloop_.data); + SyncOnMainLoop(); + + // SetInCall is used by GTBS - and only then we can expect CCID to be set. + LeAudioClient::Get()->SetInCall(true); + + bool set_before_conv = false; + bool set_while_conv = false; + bool is_using_set_before_conv_codec_during_conv = false; + bool is_using_set_while_conv_codec_during_conv = false; + is_reconfig = false; + TestSetCodecPreference(nullptr, nullptr, LeAudioContextType::CONVERSATIONAL, group_id, + set_before_conv, set_while_conv, + is_using_set_before_conv_codec_during_conv, + is_using_set_while_conv_codec_during_conv, is_reconfig); + LeAudioClient::Get()->SetInCall(false); + + // should use legacy codec when switching back to media + ASSERT_EQ(LeAudioClient::Get()->IsUsingPreferredCodecConfig( + group_id, static_cast<int>(types::LeAudioContextType::MEDIA)), + false); +} + +TEST_F(UnicastTest, TwoEarbudsSetPreferenceWhenConvForBothMediaAndConv) { + com::android::bluetooth::flags::provider_->leaudio_set_codec_config_preference(true); + + int group_id = 2; + TestSetupRemoteDevices(group_id); + + bool set_before_media = false; + bool set_while_media = false; + bool is_using_set_before_media_codec_during_media = false; + bool is_using_set_while_media_codec_during_media = false; + bool is_reconfig = false; + TestSetCodecPreference(nullptr, nullptr, LeAudioContextType::MEDIA, group_id, set_before_media, + set_while_media, is_using_set_before_media_codec_during_media, + is_using_set_while_media_codec_during_media, is_reconfig); + + // simulate suspend timeout passed, alarm executing + fake_osi_alarm_set_on_mloop_.cb(fake_osi_alarm_set_on_mloop_.data); + SyncOnMainLoop(); + + // This codec can be used by media and conv + btle_audio_codec_config_t preferred_codec_config_during_conv = { + .codec_type = LE_AUDIO_CODEC_INDEX_SOURCE_LC3, + .sample_rate = LE_AUDIO_SAMPLE_RATE_INDEX_16000HZ, + .bits_per_sample = LE_AUDIO_BITS_PER_SAMPLE_INDEX_16, + .channel_count = LE_AUDIO_CHANNEL_COUNT_INDEX_1, + .frame_duration = LE_AUDIO_FRAME_DURATION_INDEX_10000US, + .octets_per_frame = 40}; + + // SetInCall is used by GTBS - and only then we can expect CCID to be set. + LeAudioClient::Get()->SetInCall(true); + + bool set_before_conv = false; + bool set_while_conv = true; + bool is_using_set_before_conv_codec_during_conv = false; + bool is_using_set_while_conv_codec_during_conv = true; + // should use preferred codec and reconfig + is_reconfig = true; + TestSetCodecPreference(nullptr, &preferred_codec_config_during_conv, + LeAudioContextType::CONVERSATIONAL, group_id, set_before_conv, + set_while_conv, is_using_set_before_conv_codec_during_conv, + is_using_set_while_conv_codec_during_conv, is_reconfig); + LeAudioClient::Get()->SetInCall(false); + + // should use preferred codec when switching back to media + ASSERT_EQ(LeAudioClient::Get()->IsUsingPreferredCodecConfig( + group_id, static_cast<int>(types::LeAudioContextType::MEDIA)), + true); +} + +TEST_F(UnicastTest, TwoEarbudsSetPreferenceWhenConvForMediaNotForConv) { + com::android::bluetooth::flags::provider_->leaudio_set_codec_config_preference(true); + + int group_id = 2; + TestSetupRemoteDevices(group_id); + + bool set_before_media = false; + bool set_while_media = false; + bool is_using_set_before_media_codec_during_media = false; + bool is_using_set_while_media_codec_during_media = false; + bool is_reconfig = false; + TestSetCodecPreference(nullptr, nullptr, LeAudioContextType::MEDIA, group_id, set_before_media, + set_while_media, is_using_set_before_media_codec_during_media, + is_using_set_while_media_codec_during_media, is_reconfig); + + // simulate suspend timeout passed, alarm executing + fake_osi_alarm_set_on_mloop_.cb(fake_osi_alarm_set_on_mloop_.data); + SyncOnMainLoop(); + + // This codec can be used by media but not by conv + btle_audio_codec_config_t preferred_codec_config_during_conv = { + .codec_type = LE_AUDIO_CODEC_INDEX_SOURCE_LC3, + .sample_rate = LE_AUDIO_SAMPLE_RATE_INDEX_24000HZ, + .bits_per_sample = LE_AUDIO_BITS_PER_SAMPLE_INDEX_16, + .channel_count = LE_AUDIO_CHANNEL_COUNT_INDEX_1, + .frame_duration = LE_AUDIO_FRAME_DURATION_INDEX_10000US, + .octets_per_frame = 60}; + + // SetInCall is used by GTBS - and only then we can expect CCID to be set. + LeAudioClient::Get()->SetInCall(true); + + bool set_before_conv = false; + bool set_while_conv = true; + bool is_using_set_before_conv_codec_during_conv = false; + bool is_using_set_while_conv_codec_during_conv = false; + // should use legacy codec + is_reconfig = false; + TestSetCodecPreference(nullptr, &preferred_codec_config_during_conv, + LeAudioContextType::CONVERSATIONAL, group_id, set_before_conv, + set_while_conv, is_using_set_before_conv_codec_during_conv, + is_using_set_while_conv_codec_during_conv, is_reconfig); + LeAudioClient::Get()->SetInCall(false); + + // should use preferred codec when switching back to media + ASSERT_EQ(LeAudioClient::Get()->IsUsingPreferredCodecConfig( + group_id, static_cast<int>(types::LeAudioContextType::MEDIA)), + true); +} + +TEST_F(UnicastTest, TwoEarbudsSetPreferenceWhenConvNotForMediaForConv) { + com::android::bluetooth::flags::provider_->leaudio_set_codec_config_preference(true); + + int group_id = 2; + TestSetupRemoteDevices(group_id); + + bool set_before_media = false; + bool set_while_media = false; + bool is_using_set_before_media_codec_during_media = false; + bool is_using_set_while_media_codec_during_media = false; + bool is_reconfig = false; + TestSetCodecPreference(nullptr, nullptr, LeAudioContextType::MEDIA, group_id, set_before_media, + set_while_media, is_using_set_before_media_codec_during_media, + is_using_set_while_media_codec_during_media, is_reconfig); + + // simulate suspend timeout passed, alarm executing + fake_osi_alarm_set_on_mloop_.cb(fake_osi_alarm_set_on_mloop_.data); + SyncOnMainLoop(); + + // This codec can not be used by media but by conv + btle_audio_codec_config_t preferred_codec_config_during_conv = { + .codec_type = LE_AUDIO_CODEC_INDEX_SOURCE_LC3, + .sample_rate = LE_AUDIO_SAMPLE_RATE_INDEX_32000HZ, + .bits_per_sample = LE_AUDIO_BITS_PER_SAMPLE_INDEX_16, + .channel_count = LE_AUDIO_CHANNEL_COUNT_INDEX_1, + .frame_duration = LE_AUDIO_FRAME_DURATION_INDEX_10000US, + .octets_per_frame = 80}; + + // SetInCall is used by GTBS - and only then we can expect CCID to be set. + LeAudioClient::Get()->SetInCall(true); + + bool set_before_conv = false; + bool set_while_conv = true; + bool is_using_set_before_conv_codec_during_conv = false; + bool is_using_set_while_conv_codec_during_conv = true; + // should use preferred codec but not reconfig + is_reconfig = false; + TestSetCodecPreference(nullptr, &preferred_codec_config_during_conv, + LeAudioContextType::CONVERSATIONAL, group_id, set_before_conv, + set_while_conv, is_using_set_before_conv_codec_during_conv, + is_using_set_while_conv_codec_during_conv, is_reconfig); + LeAudioClient::Get()->SetInCall(false); + + // should use legacy codec when switching back to media + ASSERT_EQ(LeAudioClient::Get()->IsUsingPreferredCodecConfig( + group_id, static_cast<int>(types::LeAudioContextType::MEDIA)), + false); +} + +TEST_F(UnicastTest, TwoEarbudsSetPreferenceWhenConvNotForBothMediaAndConv) { + com::android::bluetooth::flags::provider_->leaudio_set_codec_config_preference(true); + + int group_id = 2; + TestSetupRemoteDevices(group_id); + + bool set_before_media = false; + bool set_while_media = false; + bool is_using_set_before_media_codec_during_media = false; + bool is_using_set_while_media_codec_during_media = false; + bool is_reconfig = false; + TestSetCodecPreference(nullptr, nullptr, LeAudioContextType::MEDIA, group_id, set_before_media, + set_while_media, is_using_set_before_media_codec_during_media, + is_using_set_while_media_codec_during_media, is_reconfig); + + // simulate suspend timeout passed, alarm executing + fake_osi_alarm_set_on_mloop_.cb(fake_osi_alarm_set_on_mloop_.data); + SyncOnMainLoop(); + + // This codec can not be used by media and conv + btle_audio_codec_config_t preferred_codec_config_during_conv = { + .codec_type = LE_AUDIO_CODEC_INDEX_SOURCE_LC3, + .sample_rate = LE_AUDIO_SAMPLE_RATE_INDEX_24000HZ, + .bits_per_sample = LE_AUDIO_BITS_PER_SAMPLE_INDEX_16, + .channel_count = LE_AUDIO_CHANNEL_COUNT_INDEX_1, + .frame_duration = LE_AUDIO_FRAME_DURATION_INDEX_10000US, + .octets_per_frame = 70}; + + // SetInCall is used by GTBS - and only then we can expect CCID to be set. + LeAudioClient::Get()->SetInCall(true); + + bool set_before_conv = false; + bool set_while_conv = true; + bool is_using_set_before_conv_codec_during_conv = false; + bool is_using_set_while_conv_codec_during_conv = false; + // should use legacy codec + is_reconfig = false; + TestSetCodecPreference(nullptr, &preferred_codec_config_during_conv, + LeAudioContextType::CONVERSATIONAL, group_id, set_before_conv, + set_while_conv, is_using_set_before_conv_codec_during_conv, + is_using_set_while_conv_codec_during_conv, is_reconfig); + LeAudioClient::Get()->SetInCall(false); + + // should use legacy codec when switching back to media + ASSERT_EQ(LeAudioClient::Get()->IsUsingPreferredCodecConfig( + group_id, static_cast<int>(types::LeAudioContextType::MEDIA)), + false); +} + TEST_F(UnicastTest, StreamingVxAospSampleSound) { uint8_t group_size = 2; int group_id = 2; @@ -6444,7 +7878,7 @@ TEST_F(UnicastTest, TwoEarbudsStopConversational_StartStreamSonification) { } TEST_F(UnicastTest, TwoEarbudsStreamingContextSwitchReconfigure) { - //TODO(b/352686917). Remove the test when flag will be removing + // TODO(b/352686917). Remove the test when flag will be removing com::android::bluetooth::flags::provider_->leaudio_speed_up_reconfiguration_between_call(false); uint8_t group_size = 2; @@ -6570,7 +8004,7 @@ TEST_F(UnicastTest, TwoEarbudsStreamingContextSwitchReconfigure_SpeedUpReconfigF constexpr int gmcs_ccid = 1; constexpr int gtbs_ccid = 2; - // Start streaming MEDIA + log::info("Start streaming MEDIA"); EXPECT_CALL(*mock_le_audio_source_hal_client_, Start(_, _, _)).Times(1); EXPECT_CALL(*mock_le_audio_sink_hal_client_, Start(_, _, _)).Times(1); LeAudioClient::Get()->SetCcidInformation(gmcs_ccid, 4 /* Media */); @@ -6592,15 +8026,21 @@ TEST_F(UnicastTest, TwoEarbudsStreamingContextSwitchReconfigure_SpeedUpReconfigF uint8_t cis_count_in = 0; TestAudioDataTransfer(group_id, cis_count_out, cis_count_in, 1920); - // Stop - StopStreaming(group_id); - // simulate suspend timeout passed, alarm executing - fake_osi_alarm_set_on_mloop_.cb(fake_osi_alarm_set_on_mloop_.data); - SyncOnMainLoop(); - Mock::VerifyAndClearExpectations(&mock_audio_hal_client_callbacks_); + log::info("Simulate incoming call"); + EXPECT_CALL(mock_state_machine_, StopStream(_)).Times(1); + Expectation reconfigure = + EXPECT_CALL(*mock_le_audio_source_hal_client_, SuspendedForReconfiguration()).Times(1); + EXPECT_CALL(*mock_le_audio_source_hal_client_, CancelStreamingRequest()).Times(1); + EXPECT_CALL(*mock_le_audio_source_hal_client_, ReconfigurationComplete()) + .Times(1) + .After(reconfigure); + EXPECT_CALL(mock_state_machine_, ConfigureStream(_, _, _, _)).Times(1); // SetInCall is used by GTBS - and only then we can expect CCID to be set. LeAudioClient::Get()->SetInCall(true); + SyncOnMainLoop(); + Mock::VerifyAndClearExpectations(&mock_state_machine_); + Mock::VerifyAndClearExpectations(mock_le_audio_source_hal_client_); // Conversational is a bidirectional scenario so expect GTBS CCID // in the metadata for both directions. Can be called twice when one @@ -6624,13 +8064,13 @@ TEST_F(UnicastTest, TwoEarbudsStreamingContextSwitchReconfigure_SpeedUpReconfigF // Stop stream will be called by SetInCall EXPECT_CALL(mock_state_machine_, StopStream(_)).Times(1); - Expectation reconfigure = + reconfigure = EXPECT_CALL(*mock_le_audio_source_hal_client_, SuspendedForReconfiguration()).Times(1); EXPECT_CALL(*mock_le_audio_source_hal_client_, CancelStreamingRequest()).Times(1); EXPECT_CALL(*mock_le_audio_source_hal_client_, ReconfigurationComplete()) .Times(1) .After(reconfigure); - EXPECT_CALL(mock_state_machine_, ConfigureStream(_, _, _, _)).Times(0); + EXPECT_CALL(mock_state_machine_, ConfigureStream(_, _, _, _)).Times(1); LeAudioClient::Get()->SetInCall(false); SyncOnMainLoop(); @@ -7931,7 +9371,7 @@ TEST_F(UnicastTest, MicrophoneAttachToCurrentMediaScenario) { int group_id = bluetooth::groups::kGroupUnknown; SetSampleDatabaseEarbudsValid(1, test_address0, codec_spec_conf::kLeAudioLocationStereo, - codec_spec_conf::kLeAudioLocationStereo, default_channel_cnt, + codec_spec_conf::kLeAudioLocationFrontLeft, default_channel_cnt, default_channel_cnt, 0x0024, false /*add_csis*/, true /*add_cas*/, true /*add_pacs*/, default_ase_cnt /*add_ascs_cnt*/, 1 /*set_size*/, 0 /*rank*/); @@ -7995,6 +9435,9 @@ TEST_F(UnicastTest, MicrophoneAttachToCurrentMediaScenario) { unicast_sink_hal_cb_)); SyncOnMainLoop(); + auto group = streaming_groups.at(group_id); + group->PrintDebugState(); + // Verify Data transfer on one audio source and sink cis cis_count_out = 1; cis_count_in = 1; @@ -8023,7 +9466,7 @@ TEST_F(UnicastTest, MicrophoneAttachToCurrentMediaScenario) { * use case). */ TEST_F(UnicastTest, UpdateNotSupportedContextTypeUnspecifiedAvailable) { - //TODO(b/352686917). Remove the test when flag will be removing + // TODO(b/352686917). Remove the test when flag will be removing com::android::bluetooth::flags::provider_->leaudio_speed_up_reconfiguration_between_call(false); const RawAddress test_address0 = GetTestAddress(0); @@ -8124,19 +9567,7 @@ TEST_F(UnicastTest, UpdateNotSupportedContextTypeUnspecifiedAvailable_SpeedUpRec uint8_t cis_count_out = 1; uint8_t cis_count_in = 0; - log::info( - " SetInCall = true, there is no stream so there should be no operations on state " - "machine"); - EXPECT_CALL(mock_state_machine_, StopStream(_)).Times(0); - EXPECT_CALL(*mock_le_audio_source_hal_client_, SuspendedForReconfiguration()).Times(0); - EXPECT_CALL(*mock_le_audio_source_hal_client_, CancelStreamingRequest()).Times(0); - EXPECT_CALL(*mock_le_audio_source_hal_client_, ReconfigurationComplete()).Times(0); - EXPECT_CALL(mock_state_machine_, ConfigureStream(_, _, _, _)).Times(0); - LeAudioClient::Get()->SetInCall(true); - SyncOnMainLoop(); - Mock::VerifyAndClearExpectations(&mock_state_machine_); - Mock::VerifyAndClearExpectations(mock_le_audio_source_hal_client_); // Audio sessions are started only when device gets active EXPECT_CALL(*mock_le_audio_source_hal_client_, Start(_, _, _)).Times(1); @@ -8147,31 +9578,15 @@ TEST_F(UnicastTest, UpdateNotSupportedContextTypeUnspecifiedAvailable_SpeedUpRec StartStreaming(AUDIO_USAGE_NOTIFICATION_TELEPHONY_RINGTONE, AUDIO_CONTENT_TYPE_UNKNOWN, group_id); LocalAudioSourceResume(); LocalAudioSinkResume(); - SyncOnMainLoop(); Mock::VerifyAndClearExpectations(&mock_audio_hal_client_callbacks_); Mock::VerifyAndClearExpectations(mock_le_audio_source_hal_client_); + SyncOnMainLoop(); // Verify Data transfer on one audio source cis TestAudioDataTransfer(group_id, cis_count_out, cis_count_in, 1920); - // Stop stream will be called by SetInCall - log::info(" SetInCall = false, there is stream so it should be stopped"); - EXPECT_CALL(mock_state_machine_, StopStream(_)).Times(1); - Expectation reconfigure = - EXPECT_CALL(*mock_le_audio_source_hal_client_, SuspendedForReconfiguration()).Times(1); - EXPECT_CALL(*mock_le_audio_source_hal_client_, CancelStreamingRequest()).Times(1); - EXPECT_CALL(*mock_le_audio_source_hal_client_, ReconfigurationComplete()) - .Times(1) - .After(reconfigure); - EXPECT_CALL(mock_state_machine_, ConfigureStream(_, _, _, _)).Times(0); LeAudioClient::Get()->SetInCall(false); - SyncOnMainLoop(); - - Mock::VerifyAndClearExpectations(&mock_state_machine_); - Mock::VerifyAndClearExpectations(mock_le_audio_source_hal_client_); - - log::info("Offloader called suspend"); LocalAudioSinkSuspend(); /* We should use GAME configuration, but do not send the GAME context type, as @@ -8183,7 +9598,7 @@ TEST_F(UnicastTest, UpdateNotSupportedContextTypeUnspecifiedAvailable_SpeedUpRec .source = types::AudioContexts(types::LeAudioContextType::UNSPECIFIED)}; EXPECT_CALL(mock_state_machine_, StartStream(_, types::LeAudioContextType::GAME, contexts, _)) .Times(1); - StartStreaming(AUDIO_USAGE_GAME, AUDIO_CONTENT_TYPE_UNKNOWN, group_id); + UpdateLocalSourceMetadata(AUDIO_USAGE_GAME, AUDIO_CONTENT_TYPE_UNKNOWN, false); SyncOnMainLoop(); } @@ -8194,7 +9609,7 @@ TEST_F(UnicastTest, UpdateNotSupportedContextTypeUnspecifiedAvailable_SpeedUpRec * is not confused about our intentions. */ TEST_F(UnicastTest, UpdateMultipleBidirContextTypes) { - //TODO(b/352686917). Remove the test when flag will be removing + // TODO(b/352686917). Remove the test when flag will be removing com::android::bluetooth::flags::provider_->leaudio_speed_up_reconfiguration_between_call(false); const RawAddress test_address0 = GetTestAddress(0); @@ -8401,13 +9816,14 @@ TEST_F(UnicastTest, UpdateMultipleBidirContextTypes_SpeedUpReconfigFlagEnabled) uint8_t cis_count_in = 1; TestAudioDataTransfer(group_id, cis_count_out, cis_count_in, 1920, 40); - // Stop - StopStreaming(group_id); - SyncOnMainLoop(); - Mock::VerifyAndClearExpectations(&mock_audio_hal_client_callbacks_); - log::info("Step 2 Now set in call preference to get CONVERSATIONAL into the mix"); // ----------------------------------------------------------------- + + EXPECT_CALL(*mock_le_audio_source_hal_client_, SuspendedForReconfiguration()).Times(0); + EXPECT_CALL(*mock_le_audio_source_hal_client_, CancelStreamingRequest()).Times(0); + EXPECT_CALL(*mock_le_audio_source_hal_client_, ReconfigurationComplete()).Times(0); + EXPECT_CALL(mock_state_machine_, ConfigureStream(_, _, _, _)).Times(0); + EXPECT_CALL(mock_state_machine_, StopStream(_)).Times(0); LeAudioClient::Get()->SetInCall(true); SyncOnMainLoop(); @@ -8438,14 +9854,11 @@ TEST_F(UnicastTest, UpdateMultipleBidirContextTypes_SpeedUpReconfigFlagEnabled) log::info("Step 3 Disable call so we could go to GAME"); // --------------------------------------- - Expectation reconfigure = - EXPECT_CALL(*mock_le_audio_source_hal_client_, SuspendedForReconfiguration()).Times(1); - EXPECT_CALL(*mock_le_audio_source_hal_client_, CancelStreamingRequest()).Times(1); - EXPECT_CALL(*mock_le_audio_source_hal_client_, ReconfigurationComplete()) - .Times(1) - .After(reconfigure); + EXPECT_CALL(*mock_le_audio_source_hal_client_, SuspendedForReconfiguration()).Times(0); + EXPECT_CALL(*mock_le_audio_source_hal_client_, CancelStreamingRequest()).Times(0); + EXPECT_CALL(*mock_le_audio_source_hal_client_, ReconfigurationComplete()).Times(0); EXPECT_CALL(mock_state_machine_, ConfigureStream(_, _, _, _)).Times(0); - EXPECT_CALL(mock_state_machine_, StopStream(_)).Times(1); + EXPECT_CALL(mock_state_machine_, StopStream(_)).Times(0); LeAudioClient::Get()->SetInCall(false); SyncOnMainLoop(); @@ -8454,27 +9867,19 @@ TEST_F(UnicastTest, UpdateMultipleBidirContextTypes_SpeedUpReconfigFlagEnabled) log::info("Start the game on local source - expect no previous sink (LIVE) metadata"); - EXPECT_CALL(mock_state_machine_, StopStream(_)).Times(0); - UpdateLocalSourceMetadata(AUDIO_USAGE_GAME, AUDIO_CONTENT_TYPE_UNKNOWN, false); - SyncOnMainLoop(); - - /* If the above triggers reconfiguration, Audio Hal action is needed to - * restart the stream. - */ + /* Stream shall keep streaming */ contexts = {.sink = types::AudioContexts(types::LeAudioContextType::GAME), .source = types::AudioContexts(types::LeAudioContextType::GAME)}; - EXPECT_CALL(mock_state_machine_, StartStream(_, types::LeAudioContextType::GAME, contexts, _)) - .Times(1); + EXPECT_CALL(mock_state_machine_, StartStream(_, _, contexts, _)).Times(1); + UpdateLocalSourceMetadata(AUDIO_USAGE_GAME, AUDIO_CONTENT_TYPE_UNKNOWN, false); LocalAudioSourceResume(); SyncOnMainLoop(); - Mock::VerifyAndClearExpectations(&mock_state_machine_); - EXPECT_CALL(mock_state_machine_, StartStream(_, types::LeAudioContextType::GAME, contexts, _)) - .Times(1); - - LocalAudioSinkResume(); - SyncOnMainLoop(); + // Verify Data transfer on one audio source cis + cis_count_out = 1; + cis_count_in = 1; + TestAudioDataTransfer(group_id, cis_count_out, cis_count_in, 1920, 40); Mock::VerifyAndClearExpectations(&mock_state_machine_); log::info(" Step 4 Stop streaming"); @@ -8567,7 +9972,7 @@ TEST_F(UnicastTest, UpdateDisableLocalAudioSinkOnGame) { /* Start music when in a call, end the call, continue with music only */ TEST_F(UnicastTest, MusicDuringCallContextTypes) { - //TODO(b/352686917). Remove the test when flag will be removing + // TODO(b/352686917). Remove the test when flag will be removing com::android::bluetooth::flags::provider_->leaudio_speed_up_reconfiguration_between_call(false); const RawAddress test_address0 = GetTestAddress(0); diff --git a/system/bta/le_audio/le_audio_types.cc b/system/bta/le_audio/le_audio_types.cc index a317b0450a..282a794ad3 100644 --- a/system/bta/le_audio/le_audio_types.cc +++ b/system/bta/le_audio/le_audio_types.cc @@ -858,6 +858,8 @@ template struct BidirectionalPair<bool>; template struct BidirectionalPair<int>; template struct BidirectionalPair<std::vector<set_configurations::AseConfiguration>>; template struct BidirectionalPair<set_configurations::QosConfigSetting>; +template struct BidirectionalPair< + std::unique_ptr<const bluetooth::le_audio::btle_audio_codec_config_t>>; } // namespace types } // namespace bluetooth::le_audio diff --git a/system/bta/le_audio/le_audio_types.h b/system/bta/le_audio/le_audio_types.h index 9e9b7ababa..aa6eaa6285 100644 --- a/system/bta/le_audio/le_audio_types.h +++ b/system/bta/le_audio/le_audio_types.h @@ -25,6 +25,7 @@ #include <bluetooth/log.h> #include <stdint.h> +#include <bit> #include <bitset> #include <map> #include <optional> @@ -100,6 +101,25 @@ static const bluetooth::Uuid kTelephonyMediaAudioProfileRoleCharacteristicUuid = } // namespace uuid namespace codec_spec_conf { +constexpr uint8_t SingleCapaToConfigHelper(uint16_t single_capability, uint8_t offset = 0) { + if (!single_capability || std::popcount(single_capability) > 1) { + return 0; + } + return std::countr_zero(single_capability) + offset; +} + +constexpr uint8_t SingleSamplingFreqCapability2Config(uint16_t single_capability) { + return SingleCapaToConfigHelper(single_capability, 1); +} + +constexpr uint8_t SingleFrameDurationCapability2Config(uint16_t single_capability) { + return SingleCapaToConfigHelper(single_capability); +} + +constexpr uint8_t SingleChannelCountCapability2Config(uint16_t single_capability) { + return SingleCapaToConfigHelper(single_capability, 1); +} + /* LTV Types */ constexpr uint8_t kLeAudioLtvTypeSamplingFreq = 0x01; constexpr uint8_t kLeAudioLtvTypeFrameDuration = 0x02; @@ -185,10 +205,22 @@ constexpr uint16_t kLeAudioCodecFrameLen120 = 120; constexpr uint8_t kInvalidCisId = 0xFF; namespace codec_spec_caps { -uint16_t constexpr SamplingFreqConfig2Capability(uint8_t conf) { return 1 << (conf - 1); } +uint16_t constexpr SamplingFreqConfig2Capability(uint8_t conf) { + if (!conf) { + return 0; + } + return 0x01 << (conf - 1); +} uint8_t constexpr FrameDurationConfig2Capability(uint8_t conf) { return 0x01 << (conf); } +uint16_t constexpr ChannelCountConfig2Capability(uint8_t conf) { + if (!conf) { + return 0; + } + return 0x01 << (conf - 1); +} + /* LTV Types - same values as in Codec Specific Configurations but 0x03 is * named differently. */ diff --git a/system/bta/le_audio/le_audio_types_test.cc b/system/bta/le_audio/le_audio_types_test.cc index 93dee03cc3..f46da64e26 100644 --- a/system/bta/le_audio/le_audio_types_test.cc +++ b/system/bta/le_audio/le_audio_types_test.cc @@ -717,5 +717,110 @@ TEST(CodecConfigSettingTest, test_vendor_codec_type) { ASSERT_EQ(vendor_16_2, vendor_codec); } +TEST(CodecSpecTest, test_sampling_frequency_transition) { + ASSERT_EQ(codec_spec_conf::SingleSamplingFreqCapability2Config( + codec_spec_caps::SamplingFreqConfig2Capability( + codec_spec_conf::kLeAudioSamplingFreq8000Hz)), + codec_spec_conf::kLeAudioSamplingFreq8000Hz); + ASSERT_EQ(codec_spec_conf::SingleSamplingFreqCapability2Config( + codec_spec_caps::SamplingFreqConfig2Capability( + codec_spec_conf::kLeAudioSamplingFreq11025Hz)), + codec_spec_conf::kLeAudioSamplingFreq11025Hz); + ASSERT_EQ(codec_spec_conf::SingleSamplingFreqCapability2Config( + codec_spec_caps::SamplingFreqConfig2Capability( + codec_spec_conf::kLeAudioSamplingFreq16000Hz)), + codec_spec_conf::kLeAudioSamplingFreq16000Hz); + ASSERT_EQ(codec_spec_conf::SingleSamplingFreqCapability2Config( + codec_spec_caps::SamplingFreqConfig2Capability( + codec_spec_conf::kLeAudioSamplingFreq22050Hz)), + codec_spec_conf::kLeAudioSamplingFreq22050Hz); + ASSERT_EQ(codec_spec_conf::SingleSamplingFreqCapability2Config( + codec_spec_caps::SamplingFreqConfig2Capability( + codec_spec_conf::kLeAudioSamplingFreq24000Hz)), + codec_spec_conf::kLeAudioSamplingFreq24000Hz); + ASSERT_EQ(codec_spec_conf::SingleSamplingFreqCapability2Config( + codec_spec_caps::SamplingFreqConfig2Capability( + codec_spec_conf::kLeAudioSamplingFreq32000Hz)), + codec_spec_conf::kLeAudioSamplingFreq32000Hz); + ASSERT_EQ(codec_spec_conf::SingleSamplingFreqCapability2Config( + codec_spec_caps::SamplingFreqConfig2Capability( + codec_spec_conf::kLeAudioSamplingFreq44100Hz)), + codec_spec_conf::kLeAudioSamplingFreq44100Hz); + ASSERT_EQ(codec_spec_conf::SingleSamplingFreqCapability2Config( + codec_spec_caps::SamplingFreqConfig2Capability( + codec_spec_conf::kLeAudioSamplingFreq48000Hz)), + codec_spec_conf::kLeAudioSamplingFreq48000Hz); + ASSERT_EQ(codec_spec_conf::SingleSamplingFreqCapability2Config( + codec_spec_caps::SamplingFreqConfig2Capability( + codec_spec_conf::kLeAudioSamplingFreq88200Hz)), + codec_spec_conf::kLeAudioSamplingFreq88200Hz); + ASSERT_EQ(codec_spec_conf::SingleSamplingFreqCapability2Config( + codec_spec_caps::SamplingFreqConfig2Capability( + codec_spec_conf::kLeAudioSamplingFreq96000Hz)), + codec_spec_conf::kLeAudioSamplingFreq96000Hz); + ASSERT_EQ(codec_spec_conf::SingleSamplingFreqCapability2Config( + codec_spec_caps::SamplingFreqConfig2Capability( + codec_spec_conf::kLeAudioSamplingFreq176400Hz)), + codec_spec_conf::kLeAudioSamplingFreq176400Hz); + ASSERT_EQ(codec_spec_conf::SingleSamplingFreqCapability2Config( + codec_spec_caps::SamplingFreqConfig2Capability( + codec_spec_conf::kLeAudioSamplingFreq192000Hz)), + codec_spec_conf::kLeAudioSamplingFreq192000Hz); + ASSERT_EQ(codec_spec_conf::SingleSamplingFreqCapability2Config( + codec_spec_caps::SamplingFreqConfig2Capability( + codec_spec_conf::kLeAudioSamplingFreq384000Hz)), + codec_spec_conf::kLeAudioSamplingFreq384000Hz); +} + +TEST(CodecSpecTest, test_frame_duration_transition) { + ASSERT_EQ(codec_spec_conf::SingleFrameDurationCapability2Config( + codec_spec_caps::FrameDurationConfig2Capability( + codec_spec_conf::kLeAudioCodecFrameDur7500us)), + codec_spec_conf::kLeAudioCodecFrameDur7500us); + ASSERT_EQ(codec_spec_conf::SingleFrameDurationCapability2Config( + codec_spec_caps::FrameDurationConfig2Capability( + codec_spec_conf::kLeAudioCodecFrameDur10000us)), + codec_spec_conf::kLeAudioCodecFrameDur10000us); +} + +TEST(CodecSpecTest, test_channel_count_transition) { + ASSERT_EQ(codec_spec_caps::ChannelCountConfig2Capability( + codec_spec_conf::SingleChannelCountCapability2Config( + codec_spec_caps::kLeAudioCodecChannelCountNone)), + codec_spec_caps::kLeAudioCodecChannelCountNone); + ASSERT_EQ(codec_spec_caps::ChannelCountConfig2Capability( + codec_spec_conf::SingleChannelCountCapability2Config( + codec_spec_caps::kLeAudioCodecChannelCountSingleChannel)), + codec_spec_caps::kLeAudioCodecChannelCountSingleChannel); + ASSERT_EQ(codec_spec_caps::ChannelCountConfig2Capability( + codec_spec_conf::SingleChannelCountCapability2Config( + codec_spec_caps::kLeAudioCodecChannelCountTwoChannel)), + codec_spec_caps::kLeAudioCodecChannelCountTwoChannel); + ASSERT_EQ(codec_spec_caps::ChannelCountConfig2Capability( + codec_spec_conf::SingleChannelCountCapability2Config( + codec_spec_caps::kLeAudioCodecChannelCountThreeChannel)), + codec_spec_caps::kLeAudioCodecChannelCountThreeChannel); + ASSERT_EQ(codec_spec_caps::ChannelCountConfig2Capability( + codec_spec_conf::SingleChannelCountCapability2Config( + codec_spec_caps::kLeAudioCodecChannelCountFourChannel)), + codec_spec_caps::kLeAudioCodecChannelCountFourChannel); + ASSERT_EQ(codec_spec_caps::ChannelCountConfig2Capability( + codec_spec_conf::SingleChannelCountCapability2Config( + codec_spec_caps::kLeAudioCodecChannelCountFiveChannel)), + codec_spec_caps::kLeAudioCodecChannelCountFiveChannel); + ASSERT_EQ(codec_spec_caps::ChannelCountConfig2Capability( + codec_spec_conf::SingleChannelCountCapability2Config( + codec_spec_caps::kLeAudioCodecChannelCountSixChannel)), + codec_spec_caps::kLeAudioCodecChannelCountSixChannel); + ASSERT_EQ(codec_spec_caps::ChannelCountConfig2Capability( + codec_spec_conf::SingleChannelCountCapability2Config( + codec_spec_caps::kLeAudioCodecChannelCountSevenChannel)), + codec_spec_caps::kLeAudioCodecChannelCountSevenChannel); + ASSERT_EQ(codec_spec_caps::ChannelCountConfig2Capability( + codec_spec_conf::SingleChannelCountCapability2Config( + codec_spec_caps::kLeAudioCodecChannelCountEightChannel)), + codec_spec_caps::kLeAudioCodecChannelCountEightChannel); +} + } // namespace types } // namespace bluetooth::le_audio diff --git a/system/bta/le_audio/le_audio_utils.cc b/system/bta/le_audio/le_audio_utils.cc index da36490e23..80adf4b87e 100644 --- a/system/bta/le_audio/le_audio_utils.cc +++ b/system/bta/le_audio/le_audio_utils.cc @@ -604,5 +604,67 @@ const struct types::acs_ac_record* GetConfigurationSupportedPac( } return nullptr; } + +bool IsAseConfigMatchedWithPreferredRequirements( + const std::vector<struct set_configurations::AseConfiguration>& ase_confs, + const std::vector< + CodecManager::UnicastConfigurationRequirements::DeviceDirectionRequirements>& reqs, + uint8_t channel_cnt_per_ase) { + if (ase_confs.empty() || reqs.empty() || ase_confs.size() != reqs.size()) { + return false; + } + + for (auto i = 0; i < static_cast<int>(ase_confs.size()); ++i) { + const auto& ase_config = ase_confs.at(i).codec.params.GetAsCoreCodecConfig(); + const auto& req_config = reqs.at(i).params.GetAsCoreCodecConfig(); + + /* Sampling frequency */ + if (!ase_config.sampling_frequency || !req_config.sampling_frequency) { + log::debug("Missing sampling frequencies capability"); + return false; + } + if (ase_config.sampling_frequency.value() != req_config.sampling_frequency.value()) { + log::debug("Ase cfg: SamplingFrequency= {:#x}", ase_config.sampling_frequency.value()); + log::debug("Req cfg: SamplingFrequency= {:#x}", req_config.sampling_frequency.value()); + log::debug("Sampling frequency not supported"); + return false; + } + + /* Channel counts */ + if (ase_confs.at(i).codec.GetChannelCountPerIsoStream() != channel_cnt_per_ase) { + log::debug("Ase cfg: Allocated channel count= {:#x}", + ase_confs.at(i).codec.GetChannelCountPerIsoStream()); + log::debug("Req cfg: Allocated channel counts= {:#x}", channel_cnt_per_ase); + log::debug("Channel count not supported"); + return false; + } + + /* Frame duration */ + if (!ase_config.frame_duration || !req_config.frame_duration) { + log::debug("Missing frame duration capability"); + return false; + } + if (ase_config.frame_duration.value() != ase_config.frame_duration.value()) { + log::debug("Ase cfg: FrameDuration= {:#x}", ase_config.frame_duration.value()); + log::debug("Req cfg: FrameDuration= {:#x}", req_config.frame_duration.value()); + log::debug("Frame duration not supported"); + return false; + } + + /* Octets per frame */ + if (!ase_config.octets_per_codec_frame || !req_config.octets_per_codec_frame) { + log::debug("Missing octets per codec frame"); + return false; + } + if (ase_config.octets_per_codec_frame.value() != req_config.octets_per_codec_frame.value()) { + log::debug("Ase cfg: Octets per frame={}", ase_config.octets_per_codec_frame.value()); + log::debug("Req cfg: Octets per frame={}", req_config.octets_per_codec_frame.value()); + return false; + } + } + + return true; +} + } // namespace utils } // namespace bluetooth::le_audio diff --git a/system/bta/le_audio/le_audio_utils.h b/system/bta/le_audio/le_audio_utils.h index 4ea21a784f..f7406a41a5 100644 --- a/system/bta/le_audio/le_audio_utils.h +++ b/system/bta/le_audio/le_audio_utils.h @@ -87,5 +87,10 @@ GetAudioSessionCodecConfigFromAudioSetConfiguration( const struct types::acs_ac_record* GetConfigurationSupportedPac( const ::bluetooth::le_audio::types::PublishedAudioCapabilities& pacs, const ::bluetooth::le_audio::set_configurations::CodecConfigSetting& codec_config_setting); +bool IsAseConfigMatchedWithPreferredRequirements( + const std::vector<struct set_configurations::AseConfiguration>& ase_confs, + const std::vector< + CodecManager::UnicastConfigurationRequirements::DeviceDirectionRequirements>& reqs, + uint8_t channel_cnt_per_ase); } // namespace utils } // namespace bluetooth::le_audio diff --git a/system/bta/le_audio/metrics_collector_test.cc b/system/bta/le_audio/metrics_collector_test.cc index b519420fc0..e17d23db2e 100644 --- a/system/bta/le_audio/metrics_collector_test.cc +++ b/system/bta/le_audio/metrics_collector_test.cc @@ -58,17 +58,17 @@ std::vector<int32_t> last_streaming_context_type; namespace bluetooth { namespace common { -void LogLeAudioConnectionSessionReported(int32_t group_size, int32_t group_metric_id, - int64_t connection_duration_nanos, - std::vector<int64_t>& device_connecting_offset_nanos, - std::vector<int64_t>& device_connected_offset_nanos, - std::vector<int64_t>& device_connection_duration_nanos, - std::vector<int32_t>& device_connection_status, - std::vector<int32_t>& device_disconnection_status, - std::vector<RawAddress>& device_address, - std::vector<int64_t>& streaming_offset_nanos, - std::vector<int64_t>& streaming_duration_nanos, - std::vector<int32_t>& streaming_context_type) { +void LogLeAudioConnectionSessionReported( + int32_t group_size, int32_t group_metric_id, int64_t connection_duration_nanos, + const std::vector<int64_t>& device_connecting_offset_nanos, + const std::vector<int64_t>& device_connected_offset_nanos, + const std::vector<int64_t>& device_connection_duration_nanos, + const std::vector<int32_t>& device_connection_status, + const std::vector<int32_t>& device_disconnection_status, + const std::vector<RawAddress>& device_address, + const std::vector<int64_t>& streaming_offset_nanos, + const std::vector<int64_t>& streaming_duration_nanos, + const std::vector<int32_t>& streaming_context_type) { log_count++; last_group_size = group_size; last_group_metric_id = group_metric_id; @@ -381,4 +381,4 @@ TEST_F(MetricsCollectorTest, BroadastSessions) { ASSERT_GT(last_broadcast_duration_nanos, 0); } -} // namespace bluetooth::le_audio
\ No newline at end of file +} // namespace bluetooth::le_audio diff --git a/system/bta/le_audio/state_machine.cc b/system/bta/le_audio/state_machine.cc index bfeaeff0ef..2e603b5ecd 100644 --- a/system/bta/le_audio/state_machine.cc +++ b/system/bta/le_audio/state_machine.cc @@ -1398,9 +1398,15 @@ private: param.max_trans_lat_stom = bluetooth::le_audio::types::kLeAudioHeadtrackerMaxTransLat; it->max_sdu_size_stom = bluetooth::le_audio::types::kLeAudioHeadtrackerMaxSduSize; + + // Early draft of DSA 2.0 spec mentioned allocating 15 bytes for headtracker data if (!com::android::bluetooth::flags::headtracker_sdu_size()) { it->max_sdu_size_stom = 15; + } else if (!group->DsaReducedSduSizeSupported()) { + log::verbose("Device does not support reduced headtracker SDU"); + it->max_sdu_size_stom = 15; } + it->rtn_stom = bluetooth::le_audio::types::kLeAudioHeadtrackerRtn; it++; diff --git a/system/bta/le_audio/state_machine_test.cc b/system/bta/le_audio/state_machine_test.cc index b3e7024d5f..1b54d417ce 100644 --- a/system/bta/le_audio/state_machine_test.cc +++ b/system/bta/le_audio/state_machine_test.cc @@ -664,7 +664,7 @@ protected: le_audio_devices_.push_back(leAudioDevice); addresses_.push_back(leAudioDevice->address_); - return std::move(leAudioDevice); + return leAudioDevice; } LeAudioDeviceGroup* GroupTheDevice(int group_id, diff --git a/system/bta/ras/ras_client.cc b/system/bta/ras/ras_client.cc index 82691317ab..86102037a5 100644 --- a/system/bta/ras/ras_client.cc +++ b/system/bta/ras/ras_client.cc @@ -120,7 +120,7 @@ public: callbacks_->OnConnected(address, att_handle, tracker->vendor_specific_characteristics_); return; } - BTA_GATTC_Open(gatt_if_, ble_bd_addr.bda, BTM_BLE_DIRECT_CONNECTION, false); + BTA_GATTC_Open(gatt_if_, ble_bd_addr.bda, BTM_BLE_DIRECT_CONNECTION, true); } void SendVendorSpecificReply( @@ -142,7 +142,7 @@ public: log::debug("write to remote, uuid {}, len {}", vendor_specific_characteristic.characteristicUuid_, vendor_specific_characteristic.value_.size()); - BTA_GATTC_WriteCharValue(tracker->conn_id_, characteristic->value_handle, GATT_WRITE, + BTA_GATTC_WriteCharValue(tracker->conn_id_, characteristic->value_handle, GATT_WRITE_NO_RSP, vendor_specific_characteristic.value_, GATT_AUTH_REQ_NO_MITM, GattWriteCallback, &gatt_write_callback_data_); } @@ -206,7 +206,7 @@ public: BTA_GATTC_Close(evt.conn_id); return; } - tracker->is_connected_ = false; + trackers_.remove(tracker); } void OnGattServiceSearchComplete(const tBTA_GATTC_SEARCH_CMPL& evt) { @@ -364,8 +364,8 @@ public: value[0] = (uint8_t)Opcode::GET_RANGING_DATA; value[1] = (uint8_t)(ranging_counter & 0xFF); value[2] = (uint8_t)((ranging_counter >> 8) & 0xFF); - BTA_GATTC_WriteCharValue(tracker->conn_id_, characteristic->value_handle, GATT_WRITE, value, - GATT_AUTH_REQ_NO_MITM, GattWriteCallback, nullptr); + BTA_GATTC_WriteCharValue(tracker->conn_id_, characteristic->value_handle, GATT_WRITE_NO_RSP, + value, GATT_AUTH_REQ_NO_MITM, GattWriteCallback, nullptr); } void AckRangingData(uint16_t ranging_counter, std::shared_ptr<RasTracker> tracker) { @@ -380,8 +380,8 @@ public: value[0] = (uint8_t)Opcode::ACK_RANGING_DATA; value[1] = (uint8_t)(ranging_counter & 0xFF); value[2] = (uint8_t)((ranging_counter >> 8) & 0xFF); - BTA_GATTC_WriteCharValue(tracker->conn_id_, characteristic->value_handle, GATT_WRITE, value, - GATT_AUTH_REQ_NO_MITM, GattWriteCallback, nullptr); + BTA_GATTC_WriteCharValue(tracker->conn_id_, characteristic->value_handle, GATT_WRITE_NO_RSP, + value, GATT_AUTH_REQ_NO_MITM, GattWriteCallback, nullptr); if (ranging_counter != tracker->latest_ranging_counter_) { GetRangingData(tracker->latest_ranging_counter_, tracker); } @@ -612,9 +612,6 @@ public: if ((value & kFilterRangingData) != 0) { ss << "|Filter Ranging Data"; } - if ((value & kPctPhaseFormat) != 0) { - ss << "|PCT Phase Format"; - } } return ss.str(); } diff --git a/system/bta/ras/ras_server.cc b/system/bta/ras/ras_server.cc index cdeb50dec9..543b7359fb 100644 --- a/system/bta/ras/ras_server.cc +++ b/system/bta/ras/ras_server.cc @@ -69,6 +69,8 @@ public: bool handling_control_point_command_ = false; uint8_t vendor_specific_reply_counter_ = 0; PendingWriteResponse pending_write_response_; + uint16_t last_ready_procedure_ = 0; + uint16_t last_overwritten_procedure_ = 0; }; void Initialize() { @@ -138,6 +140,7 @@ public: std::lock_guard<std::mutex> lock(on_demand_ranging_mutex_); DataBuffer& data_buffer = InitDataBuffer(ble_bd_addr.bda, procedure_counter); data_buffer.segments_.push_back(data); + tracker.last_ready_procedure_ = procedure_counter; // Send data ready if (is_last) { @@ -158,6 +161,7 @@ public: // Send data overwritten if (tracker.buffers_.size() > kBufferSize) { auto begin = tracker.buffers_.begin(); + tracker.last_overwritten_procedure_ = begin->ranging_counter_; if (ccc_data_over_written == GATT_CLT_CONFIG_NONE || ccc_real_time != GATT_CLT_CONFIG_NONE) { log::debug("Skip Ranging Data Over Written"); tracker.buffers_.erase(begin); @@ -181,6 +185,9 @@ public: case BTA_GATTS_CONNECT_EVT: { OnGattConnect(p_data); } break; + case BTA_GATTS_DISCONNECT_EVT: { + OnGattDisconnect(p_data); + } break; case BTA_GATTS_REG_EVT: { OnGattServerRegister(p_data); } break; @@ -215,6 +222,14 @@ public: trackers_[address].conn_id_ = p_data->conn.conn_id; } + void OnGattDisconnect(tBTA_GATTS* p_data) { + auto address = p_data->conn.remote_bda; + log::info("Address: {}, conn_id:{}", address, p_data->conn.conn_id); + if (trackers_.find(address) != trackers_.end()) { + trackers_.erase(address); + } + } + void OnGattServerRegister(tBTA_GATTS* p_data) { tGATT_STATUS status = p_data->reg_oper.status; log::info("status: {}", gatt_status_text(p_data->reg_oper.status)); @@ -279,7 +294,7 @@ public: ranging_data_ready_characteristic.uuid = kRasRangingDataReadyCharacteristic; ranging_data_ready_characteristic.type = BTGATT_DB_CHARACTERISTIC; ranging_data_ready_characteristic.properties = - GATT_CHAR_PROP_BIT_NOTIFY | GATT_CHAR_PROP_BIT_INDICATE; + GATT_CHAR_PROP_BIT_READ | GATT_CHAR_PROP_BIT_NOTIFY | GATT_CHAR_PROP_BIT_INDICATE; ranging_data_ready_characteristic.permissions = GATT_PERM_READ_ENCRYPTED | key_mask; service.push_back(ranging_data_ready_characteristic); service.push_back(ccc_descriptor); @@ -289,7 +304,7 @@ public: ranging_data_overwritten_characteristic.uuid = kRasRangingDataOverWrittenCharacteristic; ranging_data_overwritten_characteristic.type = BTGATT_DB_CHARACTERISTIC; ranging_data_overwritten_characteristic.properties = - GATT_CHAR_PROP_BIT_NOTIFY | GATT_CHAR_PROP_BIT_INDICATE; + GATT_CHAR_PROP_BIT_READ | GATT_CHAR_PROP_BIT_NOTIFY | GATT_CHAR_PROP_BIT_INDICATE; ranging_data_overwritten_characteristic.permissions = GATT_PERM_READ_ENCRYPTED | key_mask; service.push_back(ranging_data_overwritten_characteristic); service.push_back(ccc_descriptor); @@ -337,6 +352,13 @@ public: return; } log::info("Read uuid, {}", getUuidName(uuid)); + ClientTracker* tracker = &trackers_[p_data->req_data.remote_bda]; + if (trackers_.find(p_data->req_data.remote_bda) == trackers_.end()) { + log::warn("Can't find tracker for {}", p_data->req_data.remote_bda); + BTA_GATTS_SendRsp(p_data->req_data.conn_id, p_data->req_data.trans_id, GATT_ILLEGAL_PARAMETER, + &p_msg); + return; + } // Check Characteristic UUID switch (uuid.As16Bit()) { @@ -344,6 +366,20 @@ public: p_msg.attr_value.len = kFeatureSize; memcpy(p_msg.attr_value.value, &kSupportedFeatures, sizeof(uint32_t)); } break; + case kRasRangingDataReadyCharacteristic16bit: { + p_msg.attr_value.len = kRingingCounterSize; + std::vector<uint8_t> value(kRingingCounterSize); + if (tracker->buffers_.size() > 0) { + p_msg.attr_value.value[0] = (tracker->last_ready_procedure_ & 0xFF); + p_msg.attr_value.value[1] = (tracker->last_ready_procedure_ >> 8) & 0xFF; + } + } break; + case kRasRangingDataOverWrittenCharacteristic16bit: { + p_msg.attr_value.len = kRingingCounterSize; + std::vector<uint8_t> value(kRingingCounterSize); + p_msg.attr_value.value[0] = (tracker->last_overwritten_procedure_ & 0xFF); + p_msg.attr_value.value[1] = (tracker->last_overwritten_procedure_ >> 8) & 0xFF; + } break; default: log::warn("Unhandled uuid {}", uuid.ToString()); BTA_GATTS_SendRsp(p_data->req_data.conn_id, p_data->req_data.trans_id, @@ -418,8 +454,8 @@ public: } ClientTracker* tracker = &trackers_[p_data->req_data.remote_bda]; if (tracker->handling_control_point_command_) { - log::warn("Procedure Already In Progress"); - BTA_GATTS_SendRsp(conn_id, p_data->req_data.trans_id, GATT_PRC_IN_PROGRESS, &p_msg); + log::warn("Server busy"); + SendResponseCode(ResponseCodeValue::SERVER_BUSY, tracker); return; } if (need_rsp) { @@ -532,20 +568,19 @@ public: tracker->handling_control_point_command_ = true; switch (command.opcode_) { - case Opcode::GET_RANGING_DATA: { + case Opcode::GET_RANGING_DATA: OnGetRangingData(&command, tracker); - } break; - case Opcode::ACK_RANGING_DATA: { + break; + case Opcode::ACK_RANGING_DATA: OnAckRangingData(&command, tracker); - } break; + break; case Opcode::RETRIEVE_LOST_RANGING_DATA_SEGMENTS: case Opcode::ABORT_OPERATION: case Opcode::FILTER: - case Opcode::PCT_FORMAT: { log::warn("Unsupported opcode:0x{:02x}, {}", (uint16_t)command.opcode_, GetOpcodeText(command.opcode_)); SendResponseCode(ResponseCodeValue::OP_CODE_NOT_SUPPORTED, tracker); - } break; + break; default: log::warn("Unknown opcode:0x{:02x}", (uint16_t)command.opcode_); SendResponseCode(ResponseCodeValue::OP_CODE_NOT_SUPPORTED, tracker); diff --git a/system/bta/ras/ras_types.h b/system/bta/ras/ras_types.h index 54e41f6b89..95dda05aae 100644 --- a/system/bta/ras/ras_types.h +++ b/system/bta/ras/ras_types.h @@ -58,7 +58,6 @@ static const uint32_t kRealTimeRangingData = 0x01; static const uint32_t kRetrieveLostRangingDataSegments = 0x02; static const uint32_t kAbortOperation = 0x04; static const uint32_t kFilterRangingData = 0x08; -static const uint32_t kPctPhaseFormat = 0xA0; } // namespace feature enum class Opcode : uint8_t { @@ -67,7 +66,6 @@ enum class Opcode : uint8_t { RETRIEVE_LOST_RANGING_DATA_SEGMENTS = 0x02, ABORT_OPERATION = 0x03, FILTER = 0x04, - PCT_FORMAT = 0x05, }; static const uint8_t OPERATOR_NULL = 0x00; @@ -88,7 +86,7 @@ enum class ResponseCodeValue : uint8_t { PERSISTED = 0x04, ABORT_UNSUCCESSFUL = 0x05, PROCEDURE_NOT_COMPLETED = 0x06, - OPERAND_NOT_SUPPORTED = 0x07, + SERVER_BUSY = 0x07, NO_RECORDS_FOUND = 0x08, }; diff --git a/system/bta/ras/ras_utils.cc b/system/bta/ras/ras_utils.cc index 93befa7e9d..d27a6bf697 100644 --- a/system/bta/ras/ras_utils.cc +++ b/system/bta/ras/ras_utils.cc @@ -64,23 +64,18 @@ bool ParseControlPointCommand(ControlPointCommand* command, const uint8_t* value return false; } break; - case (uint8_t)Opcode::PCT_FORMAT: { - if (len != 2) { - return false; - } - } break; case (uint8_t)Opcode::GET_RANGING_DATA: case (uint8_t)Opcode::ACK_RANGING_DATA: - case (uint8_t)Opcode::FILTER: { + case (uint8_t)Opcode::FILTER: if (len != 3) { return false; } - } break; - case (uint8_t)Opcode::RETRIEVE_LOST_RANGING_DATA_SEGMENTS: { + break; + case (uint8_t)Opcode::RETRIEVE_LOST_RANGING_DATA_SEGMENTS: if (len != 5) { return false; } - } break; + break; default: log::warn("unknown opcode 0x{:02x}", value[0]); return false; @@ -102,8 +97,6 @@ std::string GetOpcodeText(Opcode opcode) { return "ABORT_OPERATION"; case Opcode::FILTER: return "FILTER"; - case Opcode::PCT_FORMAT: - return "PCT_FORMAT"; default: return "Unknown Opcode"; } @@ -125,12 +118,12 @@ std::string GetResponseOpcodeValueText(ResponseCodeValue response_code_value) { return "ABORT_UNSUCCESSFUL"; case ResponseCodeValue::PROCEDURE_NOT_COMPLETED: return "PROCEDURE_NOT_COMPLETED"; - case ResponseCodeValue::OPERAND_NOT_SUPPORTED: - return "OPERAND_NOT_SUPPORTED"; + case ResponseCodeValue::SERVER_BUSY: + return "SERVER_BUSY"; case ResponseCodeValue::NO_RECORDS_FOUND: return "NO_RECORDS_FOUND"; default: - return "Unknown Opcode"; + return "Reserved for Future Use"; } } diff --git a/system/bta/sdp/bta_sdp_act.cc b/system/bta/sdp/bta_sdp_act.cc index f39787d9e8..2f620464ce 100644 --- a/system/bta/sdp/bta_sdp_act.cc +++ b/system/bta/sdp/bta_sdp_act.cc @@ -532,7 +532,7 @@ static void bta_sdp_search_cback(Uuid uuid, const RawAddress& /* bd_addr */, tSD evt_data.remote_addr = bta_sdp_cb.remote_addr; evt_data.uuid = uuid; - if (result == SDP_SUCCESS || result == SDP_DB_FULL) { + if (result == tSDP_STATUS::SDP_SUCCESS || result == tSDP_STATUS::SDP_DB_FULL) { tSDP_DISC_REC* p_rec = NULL; do { p_rec = get_legacy_stack_sdp_api()->db.SDP_FindServiceUUIDInDb(p_bta_sdp_cfg->p_sdp_db, uuid, diff --git a/system/bta/sys/utl.cc b/system/bta/sys/utl.cc index a9c1a6f5d0..aa421d76bb 100644 --- a/system/bta/sys/utl.cc +++ b/system/bta/sys/utl.cc @@ -28,6 +28,7 @@ #include "internal_include/bt_target.h" #include "stack/include/bt_dev_class.h" #include "stack/include/btm_client_interface.h" +#include "stack/include/btm_status.h" /******************************************************************************* * @@ -212,10 +213,9 @@ bool utl_set_device_class(tBTA_UTL_COD* p_cod, uint8_t cmd) { DEV_CLASS dev_class; FIELDS_TO_COD(dev_class, minor, major, service); - if (BTM_SetDeviceClass(dev_class) == BTM_SUCCESS) { + if (get_btm_client_interface().local.BTM_SetDeviceClass(dev_class) == tBTM_STATUS::BTM_SUCCESS) { return true; } - return false; } diff --git a/system/bta/test/bta_ag_test.cc b/system/bta/test/bta_ag_test.cc index eefa8d2cc5..30e2634571 100644 --- a/system/bta/test/bta_ag_test.cc +++ b/system/bta/test/bta_ag_test.cc @@ -29,6 +29,7 @@ #include "bta/ag/bta_ag_int.h" #include "bta/include/bta_ag_swb_aptx.h" #include "hci/controller_interface_mock.h" +#include "stack/include/btm_status.h" #include "test/common/main_handler.h" #include "test/common/mock_functions.h" #include "test/fake/fake_osi.h" @@ -275,14 +276,14 @@ TEST_F_WITH_FLAGS(BtaAgCmdTest, at_hfp_cback__qcs_ev_codec_q0_enabled, mock_btm_client_interface.sco.BTM_SetEScoMode = [](enh_esco_params_t* /* p_parms */) -> tBTM_STATUS { inc_func_call_count("BTM_SetEScoMode"); - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; }; mock_btm_client_interface.sco.BTM_CreateSco = [](const RawAddress* /* remote_bda */, bool /* is_orig */, uint16_t /* pkt_types */, uint16_t* /* p_sco_inx */, tBTM_SCO_CB* /* p_conn_cb */, tBTM_SCO_CB* /* p_disc_cb */) -> tBTM_STATUS { inc_func_call_count("BTM_CreateSco"); - return BTM_CMD_STARTED; + return tBTM_STATUS::BTM_CMD_STARTED; }; tBTA_AG_SCB p_scb = {.peer_addr = addr, @@ -315,14 +316,14 @@ TEST_F_WITH_FLAGS(BtaAgCmdTest, handle_swb_at_event__qcs_ev_codec_q1_fallback_to reset_mock_btm_client_interface(); mock_btm_client_interface.sco.BTM_SetEScoMode = [](enh_esco_params_t* p_parms) -> tBTM_STATUS { inc_func_call_count("BTM_SetEScoMode"); - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; }; mock_btm_client_interface.sco.BTM_CreateSco = [](const RawAddress* /* remote_bda */, bool /* is_orig */, uint16_t /* pkt_types */, uint16_t* /* p_sco_inx */, tBTM_SCO_CB* /* p_conn_cb */, tBTM_SCO_CB* /* p_disc_cb */) -> tBTM_STATUS { inc_func_call_count("BTM_CreateSco"); - return BTM_CMD_STARTED; + return tBTM_STATUS::BTM_CMD_STARTED; }; tBTA_AG_SCB p_scb = {.peer_addr = addr, diff --git a/system/bta/test/bta_dip_test.cc b/system/bta/test/bta_dip_test.cc index 5cd1d9f0d3..61ccc5080f 100644 --- a/system/bta/test/bta_dip_test.cc +++ b/system/bta/test/bta_dip_test.cc @@ -201,5 +201,5 @@ TEST_F(BtaDipTest, test_invalid_size_checks) { } TEST_F(BtaDipTest, test_bta_sdp_search_cback) { - bluetooth::testing::bta_sdp_search_cback(UUID_DIP, RawAddress::kEmpty, SDP_SUCCESS); + bluetooth::testing::bta_sdp_search_cback(UUID_DIP, RawAddress::kEmpty, tSDP_STATUS::SDP_SUCCESS); } diff --git a/system/bta/test/bta_dm_test.cc b/system/bta/test/bta_dm_test.cc index e3309ecee7..13782e2cfa 100644 --- a/system/bta/test/bta_dm_test.cc +++ b/system/bta/test/bta_dm_test.cc @@ -245,7 +245,7 @@ TEST_F(BtaDmTest, bta_dm_set_encryption) { [](const RawAddress& bd_addr, tBT_TRANSPORT transport, tBTM_SEC_CALLBACK* p_callback, void* p_ref_data, tBTM_BLE_SEC_ACT sec_act) -> tBTM_STATUS { inc_func_call_count("BTM_SetEncryption"); - return BTM_CMD_STARTED; + return tBTM_STATUS::BTM_CMD_STARTED; }; bta_dm_set_encryption(kRawAddress, transport, BTA_DM_ENCRYPT_CBACK, sec_act); @@ -269,18 +269,18 @@ TEST_F(BtaDmTest, bta_dm_encrypt_cback) { // Encryption with no callback set device->p_encrypt_cback = nullptr; - bta_dm_encrypt_cback(kRawAddress, transport, nullptr, BTM_SUCCESS); + bta_dm_encrypt_cback(kRawAddress, transport, nullptr, tBTM_STATUS::BTM_SUCCESS); ASSERT_EQ(0UL, BTA_DM_ENCRYPT_CBACK_queue.size()); // Encryption with callback device->p_encrypt_cback = BTA_DM_ENCRYPT_CBACK; - bta_dm_encrypt_cback(kRawAddress, transport, nullptr, BTM_SUCCESS); + bta_dm_encrypt_cback(kRawAddress, transport, nullptr, tBTM_STATUS::BTM_SUCCESS); device->p_encrypt_cback = BTA_DM_ENCRYPT_CBACK; bta_dm_encrypt_cback(kRawAddress, transport, nullptr, BTM_WRONG_MODE); device->p_encrypt_cback = BTA_DM_ENCRYPT_CBACK; bta_dm_encrypt_cback(kRawAddress, transport, nullptr, BTM_NO_RESOURCES); device->p_encrypt_cback = BTA_DM_ENCRYPT_CBACK; - bta_dm_encrypt_cback(kRawAddress, transport, nullptr, BTM_BUSY); + bta_dm_encrypt_cback(kRawAddress, transport, nullptr, tBTM_STATUS::BTM_BUSY); device->p_encrypt_cback = BTA_DM_ENCRYPT_CBACK; bta_dm_encrypt_cback(kRawAddress, transport, nullptr, BTM_ILLEGAL_VALUE); @@ -309,7 +309,7 @@ TEST_F(BtaDmTest, bta_dm_remname_cback__typical) { search_cb.name_discover_done = false; tBTM_REMOTE_DEV_NAME name = { - .status = BTM_SUCCESS, + .btm_status = tBTM_STATUS::BTM_SUCCESS, .bd_addr = kRawAddress, .remote_bd_name = {}, .hci_status = HCI_SUCCESS, @@ -330,7 +330,7 @@ TEST_F(BtaDmTest, bta_dm_remname_cback__wrong_address) { search_cb.name_discover_done = false; tBTM_REMOTE_DEV_NAME name = { - .status = BTM_SUCCESS, + .btm_status = tBTM_STATUS::BTM_SUCCESS, .bd_addr = kRawAddress2, .remote_bd_name = {}, .hci_status = HCI_SUCCESS, @@ -348,7 +348,7 @@ TEST_F(BtaDmTest, bta_dm_remname_cback__HCI_ERR_CONNECTION_EXISTS) { search_cb.name_discover_done = false; tBTM_REMOTE_DEV_NAME name = { - .status = BTM_SUCCESS, + .btm_status = tBTM_STATUS::BTM_SUCCESS, .bd_addr = RawAddress::kEmpty, .remote_bd_name = {}, .hci_status = HCI_ERR_CONNECTION_EXISTS, diff --git a/system/bta/test/bta_jv_test.cc b/system/bta/test/bta_jv_test.cc index d541cf1562..c20c2656ba 100644 --- a/system/bta/test/bta_jv_test.cc +++ b/system/bta/test/bta_jv_test.cc @@ -137,7 +137,8 @@ protected: TEST_F(BtaJvTest, bta_jv_start_discovery_cback__no_callback) { bta_jv_enable(nullptr); - bluetooth::legacy::testing::bta_jv_start_discovery_cback(0x12345678, kRawAddress, SDP_SUCCESS); + bluetooth::legacy::testing::bta_jv_start_discovery_cback(0x12345678, kRawAddress, + tSDP_STATUS::SDP_SUCCESS); } TEST_F(BtaJvTest, bta_jv_start_discovery_cback__with_callback_success_no_record) { @@ -163,7 +164,8 @@ TEST_F(BtaJvTest, bta_jv_start_discovery_cback__with_callback_success_no_record) FAIL(); } }); - bluetooth::legacy::testing::bta_jv_start_discovery_cback(kSlotId, kRawAddress, SDP_SUCCESS); + bluetooth::legacy::testing::bta_jv_start_discovery_cback(kSlotId, kRawAddress, + tSDP_STATUS::SDP_SUCCESS); } TEST_F(BtaJvTest, bta_jv_start_discovery_cback__with_callback_success_with_record) { @@ -208,11 +210,12 @@ TEST_F(BtaJvTest, bta_jv_start_discovery_cback__with_callback_success_with_recor FAIL(); } }); - bluetooth::legacy::testing::bta_jv_start_discovery_cback(kSlotId, kRawAddress, SDP_SUCCESS); + bluetooth::legacy::testing::bta_jv_start_discovery_cback(kSlotId, kRawAddress, + tSDP_STATUS::SDP_SUCCESS); } TEST_F(BtaJvTest, bta_jv_start_discovery_cback__with_callback_failure) { - tSDP_RESULT result = SDP_CONN_FAILED; + tSDP_RESULT result = tSDP_STATUS::SDP_CONN_FAILED; // Ensure that there was an sdp active bta_jv_cb.sdp_cb = { diff --git a/system/bta/test/bta_sdp_test.cc b/system/bta/test/bta_sdp_test.cc index 32f1eca311..164939755a 100644 --- a/system/bta/test/bta_sdp_test.cc +++ b/system/bta/test/bta_sdp_test.cc @@ -57,5 +57,5 @@ TEST_F(BtaSdpTest, nop) {} TEST_F(BtaSdpRegisteredTest, bta_dm_sdp_result_SDP_SUCCESS) { std::unique_ptr<tBTA_DM_SDP_STATE> state = std::make_unique<tBTA_DM_SDP_STATE>( tBTA_DM_SDP_STATE{.service_index = BTA_MAX_SERVICE_ID}); - bluetooth::legacy::testing::bta_dm_sdp_result(SDP_SUCCESS, state.get()); + bluetooth::legacy::testing::bta_dm_sdp_result(tSDP_STATUS::SDP_SUCCESS, state.get()); } diff --git a/system/bta/test/bta_sec_test.cc b/system/bta/test/bta_sec_test.cc index e2fafae9c4..6a9b52150d 100644 --- a/system/bta/test/bta_sec_test.cc +++ b/system/bta/test/bta_sec_test.cc @@ -21,7 +21,7 @@ #include "bta/dm/bta_dm_sec_int.h" #include "bta/test/bta_test_fixtures.h" -#include "btm_status.h" +#include "stack/include/btm_status.h" #include "test/mock/mock_stack_btm_inq.h" #include "test/mock/mock_stack_btm_interface.h" #include "types/raw_address.h" @@ -60,7 +60,7 @@ TEST_F(BtaSecTest, bta_dm_sp_cback__BTM_SP_CFM_REQ_EVT_WithName) { static bool callback_sent = false; mock_btm_client_interface.peer.BTM_ReadRemoteDeviceName = [](const RawAddress& remote_bda, tBTM_NAME_CMPL_CB* p_cb, - tBT_TRANSPORT transport) -> tBTM_STATUS { return BTM_CMD_STARTED; }; + tBT_TRANSPORT transport) -> tBTM_STATUS { return tBTM_STATUS::BTM_CMD_STARTED; }; static tBTA_DM_SP_CFM_REQ cfm_req{}; bta_dm_sec_enable([](tBTA_DM_SEC_EVT event, tBTA_DM_SEC* p_data) { @@ -87,7 +87,7 @@ TEST_F(BtaSecTest, bta_dm_sp_cback__BTM_SP_CFM_REQ_EVT_WithName) { bd_name_from_char_pointer(data.cfm_req.bd_name, kRemoteName); ASSERT_EQ( - btm_status_text(BTM_CMD_STARTED), + btm_status_text(tBTM_STATUS::BTM_CMD_STARTED), btm_status_text(bluetooth::legacy::testing::bta_dm_sp_cback(BTM_SP_CFM_REQ_EVT, &data))); ASSERT_EQ(kNumVal, bta_dm_sec_cb.num_val); ASSERT_TRUE(callback_sent); @@ -109,7 +109,7 @@ TEST_F(BtaSecTest, bta_dm_sp_cback__BTM_SP_CFM_REQ_EVT_WithoutName_RNRSuccess) { reset_mock_btm_client_interface(); mock_btm_client_interface.peer.BTM_ReadRemoteDeviceName = [](const RawAddress& remote_bda, tBTM_NAME_CMPL_CB* p_cb, - tBT_TRANSPORT transport) -> tBTM_STATUS { return BTM_CMD_STARTED; }; + tBT_TRANSPORT transport) -> tBTM_STATUS { return tBTM_STATUS::BTM_CMD_STARTED; }; static tBTA_DM_SP_CFM_REQ cfm_req{}; bta_dm_sec_enable([](tBTA_DM_SEC_EVT event, tBTA_DM_SEC* p_data) { @@ -135,7 +135,7 @@ TEST_F(BtaSecTest, bta_dm_sp_cback__BTM_SP_CFM_REQ_EVT_WithoutName_RNRSuccess) { data.cfm_req.dev_class = kDeviceClass; ASSERT_EQ( - btm_status_text(BTM_CMD_STARTED), + btm_status_text(tBTM_STATUS::BTM_CMD_STARTED), btm_status_text(bluetooth::legacy::testing::bta_dm_sp_cback(BTM_SP_CFM_REQ_EVT, &data))); ASSERT_EQ(kNumVal, bta_dm_sec_cb.num_val); ASSERT_FALSE(callback_sent); @@ -146,7 +146,7 @@ TEST_F(BtaSecTest, bta_dm_sp_cback__BTM_SP_CFM_REQ_EVT_WithoutName_RNRFail) { static bool callback_sent = false; mock_btm_client_interface.peer.BTM_ReadRemoteDeviceName = [](const RawAddress& remote_bda, tBTM_NAME_CMPL_CB* p_cb, - tBT_TRANSPORT transport) -> tBTM_STATUS { return BTM_SUCCESS; }; + tBT_TRANSPORT transport) -> tBTM_STATUS { return tBTM_STATUS::BTM_SUCCESS; }; static tBTA_DM_SP_CFM_REQ cfm_req{}; bta_dm_sec_enable([](tBTA_DM_SEC_EVT event, tBTA_DM_SEC* p_data) { @@ -172,7 +172,7 @@ TEST_F(BtaSecTest, bta_dm_sp_cback__BTM_SP_CFM_REQ_EVT_WithoutName_RNRFail) { data.cfm_req.dev_class = kDeviceClass; ASSERT_EQ( - btm_status_text(BTM_CMD_STARTED), + btm_status_text(tBTM_STATUS::BTM_CMD_STARTED), btm_status_text(bluetooth::legacy::testing::bta_dm_sp_cback(BTM_SP_CFM_REQ_EVT, &data))); ASSERT_EQ(kNumVal, bta_dm_sec_cb.num_val); ASSERT_TRUE(callback_sent); @@ -192,7 +192,7 @@ TEST_F(BtaSecTest, bta_dm_sp_cback__BTM_SP_KEY_NOTIF_EVT) { static bool callback_sent = false; mock_btm_client_interface.peer.BTM_ReadRemoteDeviceName = [](const RawAddress& remote_bda, tBTM_NAME_CMPL_CB* p_cb, - tBT_TRANSPORT transport) -> tBTM_STATUS { return BTM_CMD_STARTED; }; + tBT_TRANSPORT transport) -> tBTM_STATUS { return tBTM_STATUS::BTM_CMD_STARTED; }; static tBTA_DM_SP_KEY_NOTIF key_notif{}; bta_dm_sec_enable([](tBTA_DM_SEC_EVT event, tBTA_DM_SEC* p_data) { @@ -213,7 +213,7 @@ TEST_F(BtaSecTest, bta_dm_sp_cback__BTM_SP_KEY_NOTIF_EVT) { data.key_notif.dev_class = kDeviceClass; bd_name_from_char_pointer(data.key_notif.bd_name, kRemoteName); - ASSERT_EQ(btm_status_text(BTM_CMD_STARTED), + ASSERT_EQ(btm_status_text(tBTM_STATUS::BTM_CMD_STARTED), btm_status_text( bluetooth::legacy::testing::bta_dm_sp_cback(BTM_SP_KEY_NOTIF_EVT, &data))); ASSERT_EQ(kPassKey, bta_dm_sec_cb.num_val); diff --git a/system/bta/test/bta_test_fixtures.h b/system/bta/test/bta_test_fixtures.h index d38f40ac24..9e719872a2 100644 --- a/system/bta/test/bta_test_fixtures.h +++ b/system/bta/test/bta_test_fixtures.h @@ -24,6 +24,7 @@ #include "bta/sys/bta_sys.h" #include "btm_client_interface.h" #include "osi/include/allocator.h" +#include "stack/include/btm_status.h" #include "stack/include/main_thread.h" #include "test/common/main_handler.h" #include "test/common/mock_functions.h" @@ -70,10 +71,10 @@ protected: uint8_t* p_num_uuid16) -> uint8_t { return 0; }; mock_btm_client_interface.eir.BTM_WriteEIR = [](BT_HDR* p_buf) -> tBTM_STATUS { osi_free(p_buf); - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; }; mock_btm_client_interface.local.BTM_ReadLocalDeviceNameFromController = - [](tBTM_CMPL_CB* cb) -> tBTM_STATUS { return BTM_CMD_STARTED; }; + [](tBTM_CMPL_CB* cb) -> tBTM_STATUS { return tBTM_STATUS::BTM_CMD_STARTED; }; mock_btm_client_interface.security.BTM_SecRegister = [](const tBTM_APPL_INFO* p_cb_info) -> bool { return true; }; } diff --git a/system/bta/vc/device.cc b/system/bta/vc/device.cc index 87d3efa488..cd17062082 100644 --- a/system/bta/vc/device.cc +++ b/system/bta/vc/device.cc @@ -400,7 +400,8 @@ bool VolumeControlDevice::IsEncryptionEnabled() { } bool VolumeControlDevice::EnableEncryption() { - int result = BTM_SetEncryption(address, BT_TRANSPORT_LE, nullptr, nullptr, BTM_BLE_SEC_ENCRYPT); + tBTM_STATUS result = + BTM_SetEncryption(address, BT_TRANSPORT_LE, nullptr, nullptr, BTM_BLE_SEC_ENCRYPT); log::info("{}: result=0x{:02x}", address, result); return result != BTM_ERR_KEY_MISSING; diff --git a/system/bta/vc/vc.cc b/system/bta/vc/vc.cc index e48934d205..ee76ef0525 100644 --- a/system/bta/vc/vc.cc +++ b/system/bta/vc/vc.cc @@ -37,6 +37,7 @@ #include "osi/include/osi.h" #include "stack/btm/btm_sec.h" #include "stack/include/bt_types.h" +#include "stack/include/btm_status.h" #include "types/bluetooth/uuid.h" #include "types/raw_address.h" @@ -178,7 +179,7 @@ public: BTA_GATTC_CancelOpen(gatt_if_, address, false); if (device->IsEncryptionEnabled()) { - OnEncryptionComplete(address, BTM_SUCCESS); + OnEncryptionComplete(address, tBTM_STATUS::BTM_SUCCESS); return; } @@ -188,15 +189,15 @@ public: } } - void OnEncryptionComplete(const RawAddress& address, uint8_t success) { + void OnEncryptionComplete(const RawAddress& address, tBTM_STATUS success) { VolumeControlDevice* device = volume_control_devices_.FindByAddress(address); if (!device) { log::error("Skipping unknown device {}", address); return; } - if (success != BTM_SUCCESS) { - log::error("encryption failed status: {}", int{success}); + if (success != tBTM_STATUS::BTM_SUCCESS) { + log::error("encryption failed status: {}", btm_status_text(success)); // If the encryption failed, do not remove the device. // Disconnect only, since the Android will try to re-enable encryption // after disconnection @@ -366,14 +367,16 @@ public: auto csis_api = CsisClient::Get(); if (!csis_api) { log::warn("Csis module is not available"); - callbacks_->OnVolumeStateChanged(device->address, device->volume, device->mute, true); + callbacks_->OnVolumeStateChanged(device->address, device->volume, device->mute, device->flags, + true); return; } auto group_id = csis_api->GetGroupId(device->address, le_audio::uuid::kCapServiceUuid); if (group_id == bluetooth::groups::kGroupUnknown) { log::warn("No group for device {}", device->address); - callbacks_->OnVolumeStateChanged(device->address, device->volume, device->mute, true); + callbacks_->OnVolumeStateChanged(device->address, device->volume, device->mute, device->flags, + true); return; } @@ -438,7 +441,8 @@ public: /* This is just a read, send single notification */ if (!is_notification) { - callbacks_->OnVolumeStateChanged(device->address, device->volume, device->mute, false); + callbacks_->OnVolumeStateChanged(device->address, device->volume, device->mute, device->flags, + false); return; } @@ -468,7 +472,8 @@ public: } else { /* op->is_autonomous_ will always be false, since we only make it true for group operations */ - callbacks_->OnVolumeStateChanged(device->address, device->volume, device->mute, false); + callbacks_->OnVolumeStateChanged(device->address, device->volume, device->mute, device->flags, + false); } ongoing_operations_.erase(op); @@ -1067,7 +1072,8 @@ private: callbacks_->OnConnectionState(ConnectionState::CONNECTED, device->address); // once profile connected we can notify current states - callbacks_->OnVolumeStateChanged(device->address, device->volume, device->mute, false); + callbacks_->OnVolumeStateChanged(device->address, device->volume, device->mute, device->flags, + true); for (auto const& offset : device->audio_offsets.volume_offsets) { callbacks_->OnExtAudioOutVolumeOffsetChanged(device->address, offset.id, offset.offset); @@ -1153,9 +1159,9 @@ private: } break; case BTA_GATTC_ENC_CMPL_CB_EVT: { - uint8_t encryption_status; + tBTM_STATUS encryption_status; if (BTM_IsEncrypted(p_data->enc_cmpl.remote_bda, BT_TRANSPORT_LE)) { - encryption_status = BTM_SUCCESS; + encryption_status = tBTM_STATUS::BTM_SUCCESS; } else { encryption_status = BTM_FAILED_ON_SECURITY; } diff --git a/system/bta/vc/vc_test.cc b/system/bta/vc/vc_test.cc index dfb436e903..2747cfefe9 100644 --- a/system/bta/vc/vc_test.cc +++ b/system/bta/vc/vc_test.cc @@ -29,10 +29,12 @@ #include "mock_csis_client.h" #include "osi/test/alarm_mock.h" #include "stack/include/bt_uuid16.h" +#include "stack/include/btm_status.h" #include "test/common/mock_functions.h" #include "types.h" #include "types/bluetooth/uuid.h" #include "types/raw_address.h" + void btif_storage_add_volume_control(const RawAddress& addr, bool auto_conn) {} struct alarm_t { @@ -82,7 +84,8 @@ public: MOCK_METHOD((void), OnDeviceAvailable, (const RawAddress& address, uint8_t num_offset), (override)); MOCK_METHOD((void), OnVolumeStateChanged, - (const RawAddress& address, uint8_t volume, bool mute, bool isAutonomous), + (const RawAddress& address, uint8_t volume, bool mute, uint8_t flags, + bool isAutonomous), (override)); MOCK_METHOD((void), OnGroupVolumeStateChanged, (int group_id, uint8_t volume, bool mute, bool isAutonomous), (override)); @@ -481,10 +484,10 @@ protected: tBTM_BLE_SEC_ACT sec_act) -> tBTM_STATUS { if (p_callback) { p_callback(bd_addr, transport, p_ref_data, - success ? BTM_SUCCESS : BTM_FAILED_ON_SECURITY); + success ? tBTM_STATUS::BTM_SUCCESS : BTM_FAILED_ON_SECURITY); } GetEncryptionCompleteEvt(bd_addr); - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; })); EXPECT_CALL(btm_interface, SetEncryption(address, _, _, _, BTM_BLE_SEC_ENCRYPT)).Times(1); } @@ -802,7 +805,7 @@ TEST_F(VolumeControlTest, test_service_discovery_completed_before_encryption) { ON_CALL(btm_interface, BTM_IsEncrypted(test_address, _)).WillByDefault(DoAll(Return(false))); ON_CALL(btm_interface, IsLinkKeyKnown(test_address, _)).WillByDefault(DoAll(Return(true))); ON_CALL(btm_interface, SetEncryption(test_address, _, _, _, _)) - .WillByDefault(Return(BTM_SUCCESS)); + .WillByDefault(Return(tBTM_STATUS::BTM_SUCCESS)); EXPECT_CALL(*callbacks, OnConnectionState(ConnectionState::CONNECTED, test_address)).Times(0); uint16_t conn_id = 1; @@ -885,7 +888,7 @@ TEST_F(VolumeControlTest, test_subscribe_vocs_output_description) { TEST_F(VolumeControlTest, test_read_vcs_volume_state) { const RawAddress test_address = GetTestAddress(0); - EXPECT_CALL(*callbacks, OnVolumeStateChanged(test_address, _, _, false)); + EXPECT_CALL(*callbacks, OnVolumeStateChanged(test_address, _, _, _, true)).Times(1); std::vector<uint16_t> handles({0x0021}); TestReadCharacteristic(test_address, 1, handles); } @@ -960,7 +963,7 @@ TEST_F(VolumeControlTest, test_discovery_vocs_broken) { TEST_F(VolumeControlTest, test_read_vcs_database_out_of_sync) { const RawAddress test_address = GetTestAddress(0); - EXPECT_CALL(*callbacks, OnVolumeStateChanged(test_address, _, _, false)); + EXPECT_CALL(*callbacks, OnVolumeStateChanged(test_address, _, _, _, true)); std::vector<uint16_t> handles({0x0021}); uint16_t conn_id = 1; @@ -1033,12 +1036,12 @@ protected: TEST_F(VolumeControlCallbackTest, test_volume_state_changed_stress) { std::vector<uint8_t> value({0x03, 0x01, 0x02}); - EXPECT_CALL(*callbacks, OnVolumeStateChanged(test_address, 0x03, true, true)); + EXPECT_CALL(*callbacks, OnVolumeStateChanged(test_address, 0x03, true, _, true)); GetNotificationEvent(0x0021, value); } TEST_F(VolumeControlCallbackTest, test_volume_state_changed_malformed) { - EXPECT_CALL(*callbacks, OnVolumeStateChanged(test_address, _, _, _)).Times(0); + EXPECT_CALL(*callbacks, OnVolumeStateChanged(test_address, _, _, _, _)).Times(0); std::vector<uint8_t> too_short({0x03, 0x01}); GetNotificationEvent(0x0021, too_short); std::vector<uint8_t> too_long({0x03, 0x01, 0x02, 0x03}); @@ -1527,6 +1530,8 @@ TEST_F(VolumeControlCsis, test_set_volume) { VolumeControl::Get()->SetVolume(test_address_1, 20); VolumeControl::Get()->SetVolume(test_address_2, 20); + EXPECT_CALL(*callbacks, OnVolumeStateChanged(test_address_1, 20, false, _, false)); + EXPECT_CALL(*callbacks, OnVolumeStateChanged(test_address_2, 20, false, _, false)); std::vector<uint8_t> value2({20, 0x00, 0x03}); GetNotificationEvent(conn_id_1, test_address_1, 0x0021, value2); GetNotificationEvent(conn_id_2, test_address_2, 0x0021, value2); diff --git a/system/btif/avrcp/avrcp_service.cc b/system/btif/avrcp/avrcp_service.cc index ee37667d9f..c76c281c63 100644 --- a/system/btif/avrcp/avrcp_service.cc +++ b/system/btif/avrcp/avrcp_service.cc @@ -215,6 +215,17 @@ public: player_id, media_id, bound_cb)); } + void GetAddressedPlayer(GetAddressedPlayerCallback addressed_cb) override { + auto cb_lambda = [](GetAddressedPlayerCallback cb, uint16_t addressed_player) { + do_in_main_thread(base::BindOnce(cb, addressed_player)); + }; + + auto bound_cb = base::Bind(cb_lambda, addressed_cb); + + do_in_jni_thread( + base::Bind(&MediaInterface::GetAddressedPlayer, base::Unretained(wrapped_), bound_cb)); + } + void SetBrowsedPlayer(uint16_t player_id, SetBrowsedPlayerCallback browse_cb) override { auto cb_lambda = [](SetBrowsedPlayerCallback cb, bool success, std::string root_id, uint32_t num_items) { @@ -227,6 +238,17 @@ public: player_id, bound_cb)); } + void SetAddressedPlayer(uint16_t player_id, SetAddressedPlayerCallback addressed_cb) override { + auto cb_lambda = [](SetAddressedPlayerCallback cb, uint16_t new_player) { + do_in_main_thread(base::BindOnce(cb, new_player)); + }; + + auto bound_cb = base::Bind(cb_lambda, addressed_cb); + + do_in_jni_thread(base::Bind(&MediaInterface::SetAddressedPlayer, base::Unretained(wrapped_), + player_id, bound_cb)); + } + void PlayItem(uint16_t player_id, bool now_playing, std::string media_id) override { do_in_jni_thread(base::Bind(&MediaInterface::PlayItem, base::Unretained(wrapped_), player_id, now_playing, media_id)); diff --git a/system/btif/co/bta_av_co.cc b/system/btif/co/bta_av_co.cc index 1b6b4c2576..efa125cbed 100644 --- a/system/btif/co/bta_av_co.cc +++ b/system/btif/co/bta_av_co.cc @@ -76,6 +76,8 @@ void BtaAvCoState::clearCodecConfig() { memset(codec_config_, 0, AVDT_CODEC_SIZE void BtaAvCoState::Reset() { active_peer_ = nullptr; + // TODO: b/339264791. Remove the method & usage. + // Pre-submit complains about codec_config not initialized. clearCodecConfig(); } @@ -674,7 +676,9 @@ bool BtaAvCo::SetActivePeer(const RawAddress& peer_address, const uint8_t t_loca if (peer_address.IsEmpty()) { // Reset the active peer; reference_state->setActivePeer(nullptr); - reference_state->clearCodecConfig(); + if (!com::android::bluetooth::flags::bta_av_use_peer_codec()) { + reference_state->clearCodecConfig(); + } return true; } @@ -685,8 +689,12 @@ bool BtaAvCo::SetActivePeer(const RawAddress& peer_address, const uint8_t t_loca } reference_state->setActivePeer(p_peer); - reference_state->setCodecConfig(p_peer->codec_config); - log::info("codec = {}", A2DP_CodecInfoString(reference_state->getCodecConfig())); + if (com::android::bluetooth::flags::bta_av_use_peer_codec()) { + log::info("codec = {}", A2DP_CodecInfoString(p_peer->getCodecConfig())); + } else { + reference_state->setCodecConfig(p_peer->codec_config); + log::info("codec = {}", A2DP_CodecInfoString(reference_state->getCodecConfig())); + } // report the selected codec configuration of this new active peer. ReportSourceCodecState(p_peer); return true; @@ -707,7 +715,16 @@ BtaAvCoState* BtaAvCo::getStateFromLocalProfile(const uint8_t t_local_sep) { } } -void BtaAvCo::SaveCodec(const uint8_t* new_codec_config) { +void BtaAvCo::SaveCodec(const RawAddress& peer_address, const uint8_t* new_codec_config) { + if (com::android::bluetooth::flags::bta_av_use_peer_codec()) { + BtaAvCoPeer* p_peer = peer_cache_->FindPeer(peer_address); + if (p_peer != nullptr) { + p_peer->setCodecConfig(new_codec_config); + } else { + log::error("Unable to find the peer address {}", peer_address); + } + return; + } if (com::android::bluetooth::flags::a2dp_concurrent_source_sink()) { bta_av_sink_state_.setCodecConfig(new_codec_config); } else { @@ -744,8 +761,17 @@ void BtaAvCo::GetPeerEncoderParameters(const RawAddress& peer_address, p_peer_params->peer_supports_3mbps); } -const tA2DP_ENCODER_INTERFACE* BtaAvCo::GetSourceEncoderInterface() { +const tA2DP_ENCODER_INTERFACE* BtaAvCo::GetSourceEncoderInterface(const RawAddress& peer_address) { std::lock_guard<std::recursive_mutex> lock(peer_cache_->codec_lock_); + if (com::android::bluetooth::flags::bta_av_use_peer_codec()) { + BtaAvCoPeer* p_peer = peer_cache_->FindPeer(peer_address); + if (p_peer != nullptr) { + return A2DP_GetEncoderInterface(p_peer->getCodecConfig()); + } else { + log::error("Unable to find the peer address {}", peer_address); + } + return nullptr; + } if (com::android::bluetooth::flags::a2dp_concurrent_source_sink()) { return A2DP_GetEncoderInterface(bta_av_source_state_.getCodecConfig()); } @@ -914,9 +940,18 @@ bool BtaAvCo::SetCodecAudioConfig(const btav_a2dp_codec_config_t& codec_audio_co return true; } -int BtaAvCo::GetSourceEncoderEffectiveFrameSize() { +int BtaAvCo::GetSourceEncoderEffectiveFrameSize(const RawAddress& peer_address) { std::lock_guard<std::recursive_mutex> lock(peer_cache_->codec_lock_); + if (com::android::bluetooth::flags::bta_av_use_peer_codec()) { + BtaAvCoPeer* p_peer = peer_cache_->FindPeer(peer_address); + if (p_peer != nullptr) { + return A2DP_GetEecoderEffectiveFrameSize(p_peer->getCodecConfig()); + } else { + log::error("Unable to find the peer address {}", peer_address); + } + return 0; + } if (com::android::bluetooth::flags::a2dp_concurrent_source_sink()) { return A2DP_GetEecoderEffectiveFrameSize(bta_av_source_state_.getCodecConfig()); } @@ -924,7 +959,13 @@ int BtaAvCo::GetSourceEncoderEffectiveFrameSize() { } int BtaAvCo::GetSourceEncoderPreferredIntervalUs() { - const tA2DP_ENCODER_INTERFACE* encoder = GetSourceEncoderInterface(); + const BtaAvCoPeer* active_peer = bta_av_source_state_.getActivePeer(); + const tA2DP_ENCODER_INTERFACE* encoder; + if (active_peer != nullptr) { + encoder = GetSourceEncoderInterface(active_peer->addr); + } else { + encoder = nullptr; + } return encoder == nullptr ? 0 : encoder->get_encoder_interval_ms() * 1000; } @@ -1291,8 +1332,12 @@ void BtaAvCo::SaveNewCodecConfig(BtaAvCoPeer* p_peer, const uint8_t* new_codec_c t_local_sep); return; } - reference_state->setCodecConfig(new_codec_config); - memcpy(p_peer->codec_config, new_codec_config, AVDT_CODEC_SIZE); + if (com::android::bluetooth::flags::bta_av_use_peer_codec()) { + p_peer->setCodecConfig(new_codec_config); + } else { + reference_state->setCodecConfig(new_codec_config); + memcpy(p_peer->codec_config, new_codec_config, AVDT_CODEC_SIZE); + } if (ContentProtectEnabled()) { // Check if this Sink supports SCMS @@ -1532,8 +1577,8 @@ bool bta_av_co_set_active_source_peer(const RawAddress& peer_address) { return bta_av_co_cb.SetActivePeer(peer_address, AVDT_TSEP_SRC); } -void bta_av_co_save_codec(const uint8_t* new_codec_config) { - return bta_av_co_cb.SaveCodec(new_codec_config); +void bta_av_co_save_codec(const RawAddress& peer_address, const uint8_t* new_codec_config) { + return bta_av_co_cb.SaveCodec(peer_address, new_codec_config); } void bta_av_co_get_peer_params(const RawAddress& peer_address, @@ -1541,8 +1586,8 @@ void bta_av_co_get_peer_params(const RawAddress& peer_address, bta_av_co_cb.GetPeerEncoderParameters(peer_address, p_peer_params); } -const tA2DP_ENCODER_INTERFACE* bta_av_co_get_encoder_interface(void) { - return bta_av_co_cb.GetSourceEncoderInterface(); +const tA2DP_ENCODER_INTERFACE* bta_av_co_get_encoder_interface(const RawAddress& peer_address) { + return bta_av_co_cb.GetSourceEncoderInterface(peer_address); } bool bta_av_co_set_codec_user_config(const RawAddress& peer_address, @@ -1555,8 +1600,8 @@ bool bta_av_co_set_codec_audio_config(const btav_a2dp_codec_config_t& codec_audi return bta_av_co_cb.SetCodecAudioConfig(codec_audio_config); } -int bta_av_co_get_encoder_effective_frame_size() { - return bta_av_co_cb.GetSourceEncoderEffectiveFrameSize(); +int bta_av_co_get_encoder_effective_frame_size(const RawAddress& peer_address) { + return bta_av_co_cb.GetSourceEncoderEffectiveFrameSize(peer_address); } int bta_av_co_get_encoder_preferred_interval_us() { @@ -1578,3 +1623,12 @@ btav_a2dp_scmst_info_t bta_av_co_get_scmst_info(const RawAddress& peer_address) } void btif_a2dp_codec_debug_dump(int fd) { bta_av_co_cb.DebugDump(fd); } + +uint8_t* bta_av_co_get_codec_config(const RawAddress& peer_address) { + BtaAvCoPeer* p_peer = bta_av_co_cb.peer_cache_->FindPeer(peer_address); + if (p_peer != nullptr) { + return p_peer->getCodecConfig(); + } + log::error("Unable to found the peer"); + return nullptr; +} diff --git a/system/btif/co/bta_av_co_peer.cc b/system/btif/co/bta_av_co_peer.cc index a652926091..966f91add4 100644 --- a/system/btif/co/bta_av_co_peer.cc +++ b/system/btif/co/bta_av_co_peer.cc @@ -91,6 +91,12 @@ void BtaAvCoPeer::Reset(tBTA_AV_HNDL bta_av_handle) { content_protect_active_ = false; } +uint8_t* BtaAvCoPeer::getCodecConfig() { return codec_config; } + +void BtaAvCoPeer::setCodecConfig(const uint8_t* new_codec_config) { + memcpy(codec_config, new_codec_config, AVDT_CODEC_SIZE); +} + void BtaAvCoPeerCache::Init(const std::vector<btav_a2dp_codec_config_t>& codec_priorities, std::vector<btav_a2dp_codec_info_t>* supported_codecs) { std::lock_guard<std::recursive_mutex> lock(codec_lock_); diff --git a/system/btif/include/bta_av_co.h b/system/btif/include/bta_av_co.h index 4c5f585006..66d15fdb1d 100644 --- a/system/btif/include/bta_av_co.h +++ b/system/btif/include/bta_av_co.h @@ -283,9 +283,10 @@ public: /** * Save the reconfig codec * + * @param peer_address the peer address. * @param new_codec_config the new codec config */ - void SaveCodec(const uint8_t* new_codec_config); + void SaveCodec(const RawAddress& peer_address, const uint8_t* new_codec_config); /** * Get the encoder parameters for a peer. @@ -299,9 +300,10 @@ public: /** * Get the Source encoder interface for the current codec. * + * @param peer_address the peer address. * @return the Source encoder interface for the current codec */ - const tA2DP_ENCODER_INTERFACE* GetSourceEncoderInterface(); + const tA2DP_ENCODER_INTERFACE* GetSourceEncoderInterface(const RawAddress& peer_address); /** * Set the codec user configuration. @@ -328,9 +330,10 @@ public: /** * Get the Source encoder maximum frame size for the current codec. * + * @param peer_address the peer address. * @return the effective frame size for the current codec */ - int GetSourceEncoderEffectiveFrameSize(); + int GetSourceEncoderEffectiveFrameSize(const RawAddress& peer_address); /** * Get the Source encoder preferred encoding interval. diff --git a/system/btif/include/bta_av_co_peer.h b/system/btif/include/bta_av_co_peer.h index 9e0bcd1a3c..e421934501 100644 --- a/system/btif/include/bta_av_co_peer.h +++ b/system/btif/include/bta_av_co_peer.h @@ -83,6 +83,18 @@ public: bool ContentProtectActive() const { return content_protect_active_; } void SetContentProtectActive(bool cp_active) { content_protect_active_ = cp_active; } + /** + * Gets the codec config for the state. + * @return the active codec config. + */ + uint8_t* getCodecConfig(); + + /** + * Updates the codec config + * @param new_codec_config codec config that needs to be updated. + */ + void setCodecConfig(const uint8_t* new_codec_config); + RawAddress addr; // Peer address BtaAvCoSep sinks[BTAV_A2DP_CODEC_INDEX_MAX]; // Supported sinks BtaAvCoSep sources[BTAV_A2DP_CODEC_INDEX_MAX]; // Supported sources diff --git a/system/btif/include/btif_a2dp_sink.h b/system/btif/include/btif_a2dp_sink.h index ef340a5b53..2c71f655ae 100644 --- a/system/btif/include/btif_a2dp_sink.h +++ b/system/btif/include/btif_a2dp_sink.h @@ -86,7 +86,7 @@ void btif_a2dp_sink_cleanup(void); // Update the decoder for the A2DP Sink module. // |p_codec_info| contains the new codec information. -void btif_a2dp_sink_update_decoder(const uint8_t* p_codec_info); +void btif_a2dp_sink_update_decoder(const RawAddress& peer_address, const uint8_t* p_codec_info); // Process 'idle' request from the BTIF state machine during initialization. void btif_a2dp_sink_on_idle(void); diff --git a/system/btif/include/btif_av_co.h b/system/btif/include/btif_av_co.h index c0c49bfb27..165178f31b 100644 --- a/system/btif/include/btif_av_co.h +++ b/system/btif/include/btif_av_co.h @@ -41,7 +41,7 @@ bool bta_av_co_set_active_sink_peer(const RawAddress& peer_address); */ bool bta_av_co_set_active_source_peer(const RawAddress& peer_address); -void bta_av_co_save_codec(const uint8_t* new_codec_config); +void bta_av_co_save_codec(const RawAddress& peer_address, const uint8_t* new_codec_config); // Gets the A2DP peer parameters that are used to initialize the encoder. // The peer address is |peer_addr|. @@ -54,7 +54,7 @@ void bta_av_co_get_peer_params(const RawAddress& peer_addr, // prepare A2DP packets for transmission - see |tA2DP_ENCODER_INTERFACE|. // Returns the A2DP encoder interface if the current codec is setup, // otherwise NULL. -const tA2DP_ENCODER_INTERFACE* bta_av_co_get_encoder_interface(void); +const tA2DP_ENCODER_INTERFACE* bta_av_co_get_encoder_interface(const RawAddress& peer_address); // Sets the user preferred codec configuration. // The peer address is |peer_addr|. @@ -93,7 +93,7 @@ A2dpCodecConfig* bta_av_get_a2dp_peer_current_codec(const RawAddress& peer_addre // Gets the A2DP effective frame size from the current encoder. // Returns the effective frame size if the encoder is configured, otherwise 0. -int bta_av_co_get_encoder_effective_frame_size(); +int bta_av_co_get_encoder_effective_frame_size(const RawAddress& peer_address); // Gets the preferred encoding interval from the current encoder. // Returns the preferred encoding interval if the encoder is configured, @@ -105,4 +105,11 @@ int bta_av_co_get_encoder_preferred_interval_us(); // information. void btif_a2dp_codec_debug_dump(int fd); +/** + * Retrieves the cached codec config for the input peer address. + * @param peer_address peer address of the remote device. + * @return the codec configuration for the corresponding peer address. + */ +uint8_t* bta_av_co_get_codec_config(const RawAddress& peer_address); + #endif // BTIF_AV_CO_H diff --git a/system/btif/src/bluetooth.cc b/system/btif/src/bluetooth.cc index 41fa84c816..6cd064af47 100644 --- a/system/btif/src/bluetooth.cc +++ b/system/btif/src/bluetooth.cc @@ -101,6 +101,7 @@ #include "stack/include/a2dp_api.h" #include "stack/include/avdt_api.h" #include "stack/include/btm_client_interface.h" +#include "stack/include/btm_status.h" #include "stack/include/hfp_lc3_decoder.h" #include "stack/include/hfp_lc3_encoder.h" #include "stack/include/hfp_msbc_decoder.h" @@ -1396,7 +1397,8 @@ void invoke_oob_data_request_cb(tBT_TRANSPORT t, bool valid, Octet16 c, Octet16 log::info(""); bt_oob_data_t oob_data = {}; const char* local_name; - if (get_btm_client_interface().local.BTM_ReadLocalDeviceName(&local_name) != BTM_SUCCESS) { + if (get_btm_client_interface().local.BTM_ReadLocalDeviceName(&local_name) != + tBTM_STATUS::BTM_SUCCESS) { log::warn("Unable to read local device name"); } for (int i = 0; i < BD_NAME_LEN; i++) { diff --git a/system/btif/src/btif_a2dp_sink.cc b/system/btif/src/btif_a2dp_sink.cc index f397e3d838..33a3b9d7a2 100644 --- a/system/btif/src/btif_a2dp_sink.cc +++ b/system/btif/src/btif_a2dp_sink.cc @@ -75,6 +75,7 @@ enum { typedef struct { BT_HDR_RIGID hdr; uint8_t codec_info[AVDT_CODEC_SIZE]; + RawAddress peer_address; } tBTIF_MEDIA_SINK_DECODER_UPDATE; typedef struct { @@ -134,7 +135,8 @@ static std::atomic<int> btif_a2dp_sink_state{BTIF_A2DP_SINK_STATE_OFF}; static void btif_a2dp_sink_init_delayed(); static void btif_a2dp_sink_startup_delayed(); -static void btif_a2dp_sink_start_session_delayed(std::promise<void> peer_ready_promise); +static void btif_a2dp_sink_start_session_delayed(const RawAddress& peer_address, + std::promise<void> peer_ready_promise); static void btif_a2dp_sink_end_session_delayed(); static void btif_a2dp_sink_shutdown_delayed(); static void btif_a2dp_sink_cleanup_delayed(); @@ -147,6 +149,7 @@ static void btif_a2dp_sink_audio_rx_flush_req(); /* Handle incoming media packets A2DP SINK streaming */ static void btif_a2dp_sink_handle_inc_media(BT_HDR* p_msg); static void btif_a2dp_sink_decoder_update_event(tBTIF_MEDIA_SINK_DECODER_UPDATE* p_buf); +static void btif_a2dp_sink_decoder_update_event_old(tBTIF_MEDIA_SINK_DECODER_UPDATE* p_buf); static void btif_a2dp_sink_clear_track_event(); static void btif_a2dp_sink_set_focus_state_event(btif_a2dp_sink_focus_state_t state); static void btif_a2dp_sink_audio_rx_flush_event(); @@ -219,11 +222,82 @@ static void btif_a2dp_sink_startup_delayed() { // Nothing to do } +static void btif_a2dp_sink_on_decode_complete(uint8_t* data, uint32_t len) { +#ifdef __ANDROID__ + BtifAvrcpAudioTrackWriteData(btif_a2dp_sink_cb.audio_track, reinterpret_cast<void*>(data), len); +#endif +} + +static bool btif_a2dp_sink_initialize_a2dp_control_block(const RawAddress& peer_address) { + log::info("Initializing the control block for peer {}", peer_address); + if (peer_address.IsEmpty()) { + log::error("Peer address is empty. Control block cannot be initialized"); + return false; + } + uint8_t* codec_config = bta_av_co_get_codec_config(peer_address); + log::verbose("p_codec_info[{:x}:{:x}:{:x}:{:x}:{:x}:{:x}]", codec_config[1], codec_config[2], + codec_config[3], codec_config[4], codec_config[5], codec_config[6]); + + btif_a2dp_sink_cb.decoder_interface = A2DP_GetDecoderInterface(codec_config); + + if (btif_a2dp_sink_cb.decoder_interface == nullptr) { + log::error("cannot stream audio: no source decoder interface"); + return false; + } + + if (!btif_a2dp_sink_cb.decoder_interface->decoder_init(btif_a2dp_sink_on_decode_complete)) { + log::error("failed to initialize decoder"); + return false; + } + + if (btif_a2dp_sink_cb.decoder_interface->decoder_configure != nullptr) { + btif_a2dp_sink_cb.decoder_interface->decoder_configure(codec_config); + } + + log::info("codec = {}", A2DP_CodecInfoString(codec_config)); + int sample_rate = A2DP_GetTrackSampleRate(codec_config); + if (sample_rate == -1) { + log::error("cannot get the track frequency"); + return false; + } + int bits_per_sample = A2DP_GetTrackBitsPerSample(codec_config); + if (bits_per_sample == -1) { + log::error("%cannot get the bits per sample"); + return false; + } + int channel_count = A2DP_GetTrackChannelCount(codec_config); + if (channel_count == -1) { + log::error("cannot get the channel count"); + return false; + } + int channel_type = A2DP_GetSinkTrackChannelType(codec_config); + if (channel_type == -1) { + log::error("cannot get the Sink channel type"); + return false; + } + btif_a2dp_sink_cb.sample_rate = sample_rate; + btif_a2dp_sink_cb.bits_per_sample = bits_per_sample; + btif_a2dp_sink_cb.channel_count = channel_count; + + btif_a2dp_sink_cb.audio_track = +#ifdef __ANDROID__ + BtifAvrcpAudioTrackCreate(sample_rate, bits_per_sample, channel_count); +#else + NULL; +#endif + if (btif_a2dp_sink_cb.audio_track == nullptr) { + log::error("track creation failed"); + return false; + } + log::info("A2DP sink control block initialized"); + return true; +} + bool btif_a2dp_sink_start_session(const RawAddress& peer_address, std::promise<void> peer_ready_promise) { log::info("peer_address={}", peer_address); if (btif_a2dp_sink_cb.worker_thread.DoInThread( - FROM_HERE, base::BindOnce(btif_a2dp_sink_start_session_delayed, + FROM_HERE, base::BindOnce(btif_a2dp_sink_start_session_delayed, peer_address, std::move(peer_ready_promise)))) { return true; } else { @@ -233,9 +307,13 @@ bool btif_a2dp_sink_start_session(const RawAddress& peer_address, } } -static void btif_a2dp_sink_start_session_delayed(std::promise<void> peer_ready_promise) { +static void btif_a2dp_sink_start_session_delayed(const RawAddress& peer_address, + std::promise<void> peer_ready_promise) { log::info(""); LockGuard lock(g_mutex); + if (com::android::bluetooth::flags::bta_av_use_peer_codec()) { + btif_a2dp_sink_initialize_a2dp_control_block(peer_address); + } peer_ready_promise.set_value(); // Nothing to do } @@ -369,15 +447,15 @@ static void btif_a2dp_sink_command_ready(BT_HDR_RIGID* p_msg) { osi_free(p_msg); } -void btif_a2dp_sink_update_decoder(const uint8_t* p_codec_info) { - log::info(""); +void btif_a2dp_sink_update_decoder(const RawAddress& peer_address, const uint8_t* p_codec_info) { + log::info("peer_address {}", peer_address); tBTIF_MEDIA_SINK_DECODER_UPDATE* p_buf = reinterpret_cast<tBTIF_MEDIA_SINK_DECODER_UPDATE*>( osi_malloc(sizeof(tBTIF_MEDIA_SINK_DECODER_UPDATE))); log::verbose("p_codec_info[{:x}:{:x}:{:x}:{:x}:{:x}:{:x}]", p_codec_info[1], p_codec_info[2], p_codec_info[3], p_codec_info[4], p_codec_info[5], p_codec_info[6]); - memcpy(p_buf->codec_info, p_codec_info, AVDT_CODEC_SIZE); + p_buf->peer_address = peer_address; p_buf->hdr.event = BTIF_MEDIA_SINK_DECODER_UPDATE; btif_a2dp_sink_cb.worker_thread.DoInThread( @@ -497,12 +575,6 @@ static void btif_a2dp_sink_audio_handle_start_decoding() { nullptr); } -static void btif_a2dp_sink_on_decode_complete(uint8_t* data, uint32_t len) { -#ifdef __ANDROID__ - BtifAvrcpAudioTrackWriteData(btif_a2dp_sink_cb.audio_track, reinterpret_cast<void*>(data), len); -#endif -} - // Must be called while locked. static void btif_a2dp_sink_handle_inc_media(BT_HDR* p_msg) { if ((btif_av_get_peer_sep(A2dpType::kSink) == AVDT_TSEP_SNK) || (btif_a2dp_sink_cb.rx_flush)) { @@ -570,6 +642,24 @@ static void btif_a2dp_sink_audio_rx_flush_event() { static void btif_a2dp_sink_decoder_update_event(tBTIF_MEDIA_SINK_DECODER_UPDATE* p_buf) { log::info(""); + if (!com::android::bluetooth::flags::bta_av_use_peer_codec()) { + btif_a2dp_sink_decoder_update_event_old(p_buf); + return; + } + LockGuard lock(g_mutex); + log::verbose("p_codec_info[{:x}:{:x}:{:x}:{:x}:{:x}:{:x}]", p_buf->codec_info[1], + p_buf->codec_info[2], p_buf->codec_info[3], p_buf->codec_info[4], + p_buf->codec_info[5], p_buf->codec_info[6]); + + btif_a2dp_sink_cb.rx_flush = false; + log::verbose("reset to Sink role"); + + bta_av_co_save_codec(p_buf->peer_address, p_buf->codec_info); + log::info("codec = {}", A2DP_CodecInfoString(p_buf->codec_info)); +} + +static void btif_a2dp_sink_decoder_update_event_old(tBTIF_MEDIA_SINK_DECODER_UPDATE* p_buf) { + log::info(""); LockGuard lock(g_mutex); log::verbose("p_codec_info[{:x}:{:x}:{:x}:{:x}:{:x}:{:x}]", p_buf->codec_info[1], p_buf->codec_info[2], p_buf->codec_info[3], p_buf->codec_info[4], @@ -602,7 +692,8 @@ static void btif_a2dp_sink_decoder_update_event(tBTIF_MEDIA_SINK_DECODER_UPDATE* btif_a2dp_sink_cb.rx_flush = false; log::verbose("reset to Sink role"); - bta_av_co_save_codec(p_buf->codec_info); + bta_av_co_save_codec(p_buf->peer_address, p_buf->codec_info); + log::info("codec = {}", A2DP_CodecInfoString(p_buf->codec_info)); btif_a2dp_sink_cb.decoder_interface = A2DP_GetDecoderInterface(p_buf->codec_info); diff --git a/system/btif/src/btif_a2dp_source.cc b/system/btif/src/btif_a2dp_source.cc index 633a82a50e..9fccfabceb 100644 --- a/system/btif/src/btif_a2dp_source.cc +++ b/system/btif/src/btif_a2dp_source.cc @@ -50,6 +50,7 @@ #include "stack/include/acl_api_types.h" #include "stack/include/bt_hdr.h" #include "stack/include/btm_client_interface.h" +#include "stack/include/btm_status.h" #include "types/raw_address.h" using bluetooth::audio::a2dp::BluetoothAudioStatus; @@ -537,7 +538,7 @@ static void btif_a2dp_source_setup_codec_delayed(const RawAddress& peer_address) return; } } - btif_a2dp_source_cb.encoder_interface = bta_av_co_get_encoder_interface(); + btif_a2dp_source_cb.encoder_interface = bta_av_co_get_encoder_interface(peer_address); if (btif_a2dp_source_cb.encoder_interface == nullptr) { log::error("Cannot stream audio: no source encoder interface"); return; @@ -917,7 +918,7 @@ static bool btif_a2dp_source_enqueue_callback(BT_HDR* p_buf, size_t frames_n, RawAddress peer_bda = btif_av_source_active_peer(); tBTM_STATUS status = get_btm_client_interface().link_controller.BTM_ReadRSSI(peer_bda, btm_read_rssi_cb); - if (status != BTM_CMD_STARTED) { + if (status != tBTM_STATUS::BTM_CMD_STARTED) { log::warn("Cannot read RSSI: status {}", status); } @@ -929,13 +930,13 @@ static bool btif_a2dp_source_enqueue_callback(BT_HDR* p_buf, size_t frames_n, // creating a framework to avoid ifdefs. #ifndef TARGET_FLOSS status = BTM_ReadFailedContactCounter(peer_bda, btm_read_failed_contact_counter_cb); - if (status != BTM_CMD_STARTED) { + if (status != tBTM_STATUS::BTM_CMD_STARTED) { log::warn("Cannot read Failed Contact Counter: status {}", status); } #endif status = BTM_ReadTxPower(peer_bda, BT_TRANSPORT_BR_EDR, btm_read_tx_power_cb); - if (status != BTM_CMD_STARTED) { + if (status != tBTM_STATUS::BTM_CMD_STARTED) { log::warn("Cannot read Tx Power: status {}", status); } } @@ -1240,7 +1241,7 @@ static void btm_read_rssi_cb(void* data) { } tBTM_RSSI_RESULT* result = (tBTM_RSSI_RESULT*)data; - if (result->status != BTM_SUCCESS) { + if (result->status != tBTM_STATUS::BTM_SUCCESS) { log::error("unable to read remote RSSI (status {})", result->status); return; } @@ -1258,7 +1259,7 @@ static void btm_read_failed_contact_counter_cb(void* data) { } tBTM_FAILED_CONTACT_COUNTER_RESULT* result = (tBTM_FAILED_CONTACT_COUNTER_RESULT*)data; - if (result->status != BTM_SUCCESS) { + if (result->status != tBTM_STATUS::BTM_SUCCESS) { log::error("unable to read Failed Contact Counter (status {})", result->status); return; } @@ -1277,7 +1278,7 @@ static void btm_read_tx_power_cb(void* data) { } tBTM_TX_POWER_RESULT* result = (tBTM_TX_POWER_RESULT*)data; - if (result->status != BTM_SUCCESS) { + if (result->status != tBTM_STATUS::BTM_SUCCESS) { log::error("unable to read Tx Power (status {})", result->status); return; } diff --git a/system/btif/src/btif_av.cc b/system/btif/src/btif_av.cc index 835c0b5781..6ac29ca9f6 100644 --- a/system/btif/src/btif_av.cc +++ b/system/btif/src/btif_av.cc @@ -31,6 +31,7 @@ #include <cstdint> #include <future> #include <mutex> +#include <optional> #include <string> #include <vector> @@ -102,6 +103,11 @@ typedef struct { bool is_low_latency; } btif_av_set_latency_req_t; +typedef struct { + std::vector<btav_a2dp_codec_config_t> codec_preferences; + std::promise<void> reconf_ready_promise; +} btif_av_reconfig_req_t; + /** * BTIF AV events */ @@ -119,6 +125,7 @@ typedef enum { BTIF_AV_AVRCP_CLOSE_EVT, BTIF_AV_AVRCP_REMOTE_PLAY_EVT, BTIF_AV_SET_LATENCY_REQ_EVT, + BTIF_AV_RECONFIGURE_REQ_EVT, } btif_av_sm_event_t; class BtifAvEvent { @@ -251,6 +258,7 @@ public: kFlagRemoteSuspend = 0x2, kFlagPendingStart = 0x4, kFlagPendingStop = 0x8, + kFlagPendingReconfigure = 0x10, }; static constexpr uint64_t kTimeoutAvOpenOnRcMs = 2 * 1000; // 2s @@ -360,6 +368,16 @@ public: bool UseLatencyMode() const { return use_latency_mode_; } void SetUseLatencyMode(bool use_latency_mode) { use_latency_mode_ = use_latency_mode; } + void SetReconfigureStreamData(btif_av_reconfig_req_t&& req) { + reconfig_req_ = std::make_optional<btif_av_reconfig_req_t>(std::move(req)); + } + + std::optional<btif_av_reconfig_req_t> GetReconfigureStreamData() { + std::optional<btif_av_reconfig_req_t> data = std::move(reconfig_req_); + reconfig_req_ = std::nullopt; + return data; + } + private: const RawAddress peer_address_; uint8_t peer_sep_; // SEP type of peer device @@ -374,6 +392,7 @@ private: uint16_t delay_report_; bool mandatory_codec_preferred_ = false; bool use_latency_mode_ = false; + std::optional<btif_av_reconfig_req_t> reconfig_req_; }; class BtifAvSource { @@ -593,6 +612,33 @@ public: */ void DispatchSuspendStreamEvent(btif_av_sm_event_t event); + /** + * Set peer reconfigure stream data. + * + * @param peer_address the peer address to reconfigure stream + * @param codec_preferences codec preferences for stream reconfiguration + * @param reconf_ready_promise promise fulfilled when the reconfiguration done + */ + bt_status_t SetPeerReconfigureStreamData(const RawAddress& peer_address, + std::vector<btav_a2dp_codec_config_t> codec_preferences, + std::promise<void> reconf_ready_promise) { + std::lock_guard<std::recursive_mutex> lock(btifavsource_peers_lock_); + + BtifAvPeer* peer = FindPeer(peer_address); + if (peer == nullptr) { + log::error("Can not find peer: {}", peer_address.ToString()); + return BT_STATUS_NOT_READY; + } + + btif_av_reconfig_req_t reconf_stream_req = { + .codec_preferences = codec_preferences, + .reconf_ready_promise = std::move(reconf_ready_promise), + }; + + peer->SetReconfigureStreamData(std::move(reconf_stream_req)); + return BT_STATUS_SUCCESS; + } + void DumpPeersInfo(int fd); void RegisterAllBtaHandles(); void DeregisterAllBtaHandles(); @@ -965,6 +1011,7 @@ const char* dump_av_sm_event_name(btif_av_sm_event_t event) { CASE_RETURN_STR(BTIF_AV_AVRCP_CLOSE_EVT) CASE_RETURN_STR(BTIF_AV_AVRCP_REMOTE_PLAY_EVT) CASE_RETURN_STR(BTIF_AV_SET_LATENCY_REQ_EVT) + CASE_RETURN_STR(BTIF_AV_RECONFIGURE_REQ_EVT) default: return "UNKNOWN_EVENT"; } @@ -1120,6 +1167,12 @@ std::string BtifAvPeer::FlagsToString() const { } result += "PENDING_STOP"; } + if (flags_ & BtifAvPeer::kFlagPendingReconfigure) { + if (!result.empty()) { + result += "|"; + } + result += "PENDING_RECONFIGURE"; + } if (result.empty()) { result = "None"; } @@ -2057,6 +2110,15 @@ bool BtifAvStateMachine::StateIdle::ProcessEvent(uint32_t event, void* p_data) { btif_a2dp_on_offload_started(peer_.PeerAddress(), BTA_AV_FAIL); break; + case BTIF_AV_RECONFIGURE_REQ_EVT: { + // Unlock JNI thread only + auto req_data = peer_.GetReconfigureStreamData(); + if (req_data) { + req_data.value().reconf_ready_promise.set_value(); + } + break; + } + default: log::warn("Peer {} : Unhandled event={}", peer_.PeerAddress(), BtifAvEvent::EventName(event)); return false; @@ -2318,6 +2380,15 @@ bool BtifAvStateMachine::StateOpening::ProcessEvent(uint32_t event, void* p_data } break; + case BTIF_AV_RECONFIGURE_REQ_EVT: { + // Unlock JNI thread only + auto req_data = peer_.GetReconfigureStreamData(); + if (req_data) { + req_data.value().reconf_ready_promise.set_value(); + } + break; + } + CHECK_RC_EVENT(event, reinterpret_cast<tBTA_AV*>(p_data)); default: @@ -2439,6 +2510,16 @@ bool BtifAvStateMachine::StateOpened::ProcessEvent(uint32_t event, void* p_data) if (should_suspend) { btif_av_source_dispatch_sm_event(peer_.PeerAddress(), BTIF_AV_SUSPEND_STREAM_REQ_EVT); } + + if (com::android::bluetooth::flags::av_stream_reconfigure_fix() && + peer_.CheckFlags(BtifAvPeer::kFlagPendingReconfigure)) { + log::info( + "Peer {} : Stream started but reconfiguration pending. " + "Reconfiguring stream", + peer_.PeerAddress()); + btif_av_source_dispatch_sm_event(peer_.PeerAddress(), BTIF_AV_RECONFIGURE_REQ_EVT); + } + peer_.StateMachine().TransitionTo(BtifAvStateMachine::kStateStarted); break; } @@ -2548,6 +2629,33 @@ bool BtifAvStateMachine::StateOpened::ProcessEvent(uint32_t event, void* p_data) BTA_AvSetLatency(peer_.BtaHandle(), p_set_latency_req->is_low_latency); } break; + case BTIF_AV_RECONFIGURE_REQ_EVT: { + log::info("Peer {} : event={} flags={}", peer_.PeerAddress(), BtifAvEvent::EventName(event), + peer_.FlagsToString()); + if (!peer_.IsSink()) { + log::verbose("Peer {} is not sink", peer_.PeerAddress()); + break; + } + + if (peer_.CheckFlags(BtifAvPeer::kFlagPendingStart)) { + // The start stream request was sent but we wait for response. + // Enable the reconfigure pending flag to schedule reconfiguration + // after start stream response. + peer_.SetFlags(BtifAvPeer::kFlagPendingReconfigure); + } else { + // Reconfigure + peer_.ClearFlags(BtifAvPeer::kFlagPendingReconfigure); + if (btif_av_source.Enabled()) { + auto req_data = peer_.GetReconfigureStreamData(); + if (req_data) { + btif_av_source.UpdateCodecConfig(peer_.PeerAddress(), + req_data.value().codec_preferences, + std::move(req_data.value().reconf_ready_promise)); + } + } + } + } break; + default: log::warn("Peer {} : Unhandled event={}", peer_.PeerAddress(), BtifAvEvent::EventName(event)); return false; @@ -2764,6 +2872,19 @@ bool BtifAvStateMachine::StateStarted::ProcessEvent(uint32_t event, void* p_data CHECK_RC_EVENT(event, reinterpret_cast<tBTA_AV*>(p_data)); + case BTIF_AV_RECONFIGURE_REQ_EVT: { + log::info("Peer {} : event={} flags={}", peer_.PeerAddress(), BtifAvEvent::EventName(event), + peer_.FlagsToString()); + peer_.ClearFlags(BtifAvPeer::kFlagPendingReconfigure); + if (btif_av_source.Enabled()) { + auto req_data = peer_.GetReconfigureStreamData(); + if (req_data) { + btif_av_source.UpdateCodecConfig(peer_.PeerAddress(), req_data.value().codec_preferences, + std::move(req_data.value().reconf_ready_promise)); + } + } + } break; + default: log::warn("Peer {} : Unhandled event={}", peer_.PeerAddress(), BtifAvEvent::EventName(event)); return false; @@ -2838,6 +2959,15 @@ bool BtifAvStateMachine::StateClosing::ProcessEvent(uint32_t event, void* p_data peer_.StateMachine().TransitionTo(BtifAvStateMachine::kStateIdle); break; + case BTIF_AV_RECONFIGURE_REQ_EVT: { + // Unlock JNI thread only + auto req_data = peer_.GetReconfigureStreamData(); + if (req_data) { + req_data.value().reconf_ready_promise.set_value(); + } + break; + } + default: log::warn("Peer {} : Unhandled event={}", peer_.PeerAddress(), BtifAvEvent::EventName(event)); return false; @@ -2854,7 +2984,7 @@ static void btif_av_source_initiate_av_open_timer_timeout(void* data) { BtifAvPeer* peer = reinterpret_cast<BtifAvPeer*>(data); bool device_connected = false; - if (com::android::bluetooth::flags::avrcp_connect_a2dp_delayed() && is_new_avrcp_enabled()) { + if (com::android::bluetooth::flags::avrcp_connect_a2dp_with_delay() && is_new_avrcp_enabled()) { // check if device is connected if (bluetooth::avrcp::AvrcpService::Get() != nullptr) { device_connected = @@ -3394,7 +3524,7 @@ static void bta_av_event_callback(tBTA_AV_EVT event, tBTA_AV* p_data) { // TODO: All processing should be done on the JNI thread static void bta_av_sink_media_callback(const RawAddress& peer_address, tBTA_AV_EVT event, tBTA_AV_MEDIA* p_data) { - log::verbose("event={}", event); + log::verbose("event={} peer {}", event, peer_address); switch (event) { case BTA_AV_SINK_MEDIA_DATA_EVT: { @@ -3415,7 +3545,8 @@ static void bta_av_sink_media_callback(const RawAddress& peer_address, tBTA_AV_E log::verbose("address={}", p_data->avk_config.bd_addr); // Update the codec info of the A2DP Sink decoder - btif_a2dp_sink_update_decoder(reinterpret_cast<uint8_t*>(p_data->avk_config.codec_info)); + btif_a2dp_sink_update_decoder(p_data->avk_config.bd_addr, + reinterpret_cast<uint8_t*>(p_data->avk_config.codec_info)); config_req.sample_rate = A2DP_GetTrackSampleRate(p_data->avk_config.codec_info); if (config_req.sample_rate == -1) { @@ -3687,14 +3818,36 @@ bt_status_t btif_av_source_set_codec_config_preference( std::promise<void> peer_ready_promise; std::future<void> peer_ready_future = peer_ready_promise.get_future(); - bt_status_t status = do_in_main_thread( - base::BindOnce(&BtifAvSource::UpdateCodecConfig, base::Unretained(&btif_av_source), - peer_address, codec_preferences, std::move(peer_ready_promise))); - if (status == BT_STATUS_SUCCESS) { - peer_ready_future.wait(); + bt_status_t status = BT_STATUS_FAIL; + + if (com::android::bluetooth::flags::av_stream_reconfigure_fix()) { + status = btif_av_source.SetPeerReconfigureStreamData(peer_address, codec_preferences, + std::move(peer_ready_promise)); + if (status != BT_STATUS_SUCCESS) { + log::error("SetPeerReconfigureStreamData failed, status: {}", status); + return status; + } + + BtifAvEvent btif_av_event(BTIF_AV_RECONFIGURE_REQ_EVT, nullptr, 0); + status = do_in_main_thread(base::BindOnce(&btif_av_handle_event, + AVDT_TSEP_SNK, // peer_sep + peer_address, kBtaHandleUnknown, btif_av_event)); } else { - log::warn("BTIF AV Source fails to config codec"); + status = do_in_main_thread(base::BindOnce(&BtifAvSource::UpdateCodecConfig, + base::Unretained(&btif_av_source), peer_address, + codec_preferences, std::move(peer_ready_promise))); + } + + if (status != BT_STATUS_SUCCESS) { + log::error("do_in_main_thread failed, status: {}", status); + return status; + } + + if (peer_ready_future.wait_for(std::chrono::seconds(10)) != std::future_status::ready) { + log::error("BTIF AV Source fails to config codec"); + return BT_STATUS_FAIL; } + return status; } diff --git a/system/btif/src/btif_dm.cc b/system/btif/src/btif_dm.cc index d7e459c4ef..b5279d4332 100644 --- a/system/btif/src/btif_dm.cc +++ b/system/btif/src/btif_dm.cc @@ -3614,7 +3614,7 @@ static void btif_dm_ble_oob_req_evt(tBTA_DM_SP_RMT_OOB* req_oob_type) { pairing_cb.is_le_only = true; pairing_cb.is_le_nc = false; - BTM_BleOobDataReply(req_oob_type->bd_addr, 0, 16, oob_cb.p192_data.sm_tk); + BTM_BleOobDataReply(req_oob_type->bd_addr, BTM_SUCCESS, 16, oob_cb.p192_data.sm_tk); } static void btif_dm_ble_sc_oob_req_evt(tBTA_DM_SP_RMT_OOB* req_oob_type) { diff --git a/system/btif/src/btif_gatt.cc b/system/btif/src/btif_gatt.cc index 3292ddbe7a..ed20db4821 100644 --- a/system/btif/src/btif_gatt.cc +++ b/system/btif/src/btif_gatt.cc @@ -28,12 +28,14 @@ #include "btif_gatt.h" +#include <com_android_bluetooth_flags.h> #include <hardware/bluetooth.h> #include <hardware/bt_gatt.h> #include <stdlib.h> #include <string.h> -#include "bta_gatt_api.h" +#include "bta/include/bta_gatt_api.h" +#include "btif/include/btif_common.h" #include "main/shim/distance_measurement_manager.h" #include "main/shim/le_advertising_manager.h" diff --git a/system/btif/src/btif_gatt_client.cc b/system/btif/src/btif_gatt_client.cc index 8e9ada0c8c..f8f42af337 100644 --- a/system/btif/src/btif_gatt_client.cc +++ b/system/btif/src/btif_gatt_client.cc @@ -30,6 +30,7 @@ #include <base/functional/bind.h> #include <base/threading/thread.h> #include <bluetooth/log.h> +#include <com_android_bluetooth_flags.h> #include <hardware/bluetooth.h> #include <hardware/bt_gatt.h> #include <hardware/bt_gatt_types.h> @@ -89,7 +90,8 @@ static btif_test_cb_t test_cb; ******************************************************************************/ #define CLI_CBACK_WRAP_IN_JNI(P_CBACK, P_CBACK_WRAP) \ do { \ - if (bt_gatt_callbacks && bt_gatt_callbacks->client->P_CBACK) { \ + auto callbacks = bt_gatt_callbacks; \ + if (callbacks && callbacks->client->P_CBACK) { \ log::verbose("HAL bt_gatt_callbacks->client->{}", #P_CBACK); \ do_in_jni_thread(P_CBACK_WRAP); \ } else { \ @@ -97,14 +99,15 @@ static btif_test_cb_t test_cb; } \ } while (0) -#define CLI_CBACK_IN_JNI(P_CBACK, ...) \ - do { \ - if (bt_gatt_callbacks && bt_gatt_callbacks->client->P_CBACK) { \ - log::verbose("HAL bt_gatt_callbacks->client->{}", #P_CBACK); \ - do_in_jni_thread(Bind(bt_gatt_callbacks->client->P_CBACK, __VA_ARGS__)); \ - } else { \ - ASSERTC(0, "Callback is NULL", 0); \ - } \ +#define CLI_CBACK_IN_JNI(P_CBACK, ...) \ + do { \ + auto callbacks = bt_gatt_callbacks; \ + if (callbacks && callbacks->client->P_CBACK) { \ + log::verbose("HAL bt_gatt_callbacks->client->{}", #P_CBACK); \ + do_in_jni_thread(Bind(callbacks->client->P_CBACK, __VA_ARGS__)); \ + } else { \ + ASSERTC(0, "Callback is NULL", 0); \ + } \ } while (0) #define CHECK_BTGATT_INIT() \ @@ -139,16 +142,17 @@ uint8_t rssi_request_client_if; static void btif_gattc_upstreams_evt(uint16_t event, char* p_param) { log::debug("Event {} [{}]", gatt_client_event_text(static_cast<tBTA_GATTC_EVT>(event)), event); + auto callbacks = bt_gatt_callbacks; tBTA_GATTC* p_data = (tBTA_GATTC*)p_param; switch (event) { case BTA_GATTC_EXEC_EVT: { - HAL_CBACK(bt_gatt_callbacks, client->execute_write_cb, p_data->exec_cmpl.conn_id, + HAL_CBACK(callbacks, client->execute_write_cb, p_data->exec_cmpl.conn_id, p_data->exec_cmpl.status); break; } case BTA_GATTC_SEARCH_CMPL_EVT: { - HAL_CBACK(bt_gatt_callbacks, client->search_complete_cb, p_data->search_cmpl.conn_id, + HAL_CBACK(callbacks, client->search_complete_cb, p_data->search_cmpl.conn_id, p_data->search_cmpl.status); break; } @@ -163,7 +167,7 @@ static void btif_gattc_upstreams_evt(uint16_t event, char* p_param) { data.is_notify = p_data->notify.is_notify; data.len = p_data->notify.len; - HAL_CBACK(bt_gatt_callbacks, client->notify_cb, p_data->notify.conn_id, data); + HAL_CBACK(callbacks, client->notify_cb, p_data->notify.conn_id, data); if (!p_data->notify.is_notify) { BTA_GATTC_SendIndConfirm(p_data->notify.conn_id, p_data->notify.cid); @@ -174,12 +178,12 @@ static void btif_gattc_upstreams_evt(uint16_t event, char* p_param) { case BTA_GATTC_OPEN_EVT: { log::debug("BTA_GATTC_OPEN_EVT {}", p_data->open.remote_bda); - HAL_CBACK(bt_gatt_callbacks, client->open_cb, p_data->open.conn_id, p_data->open.status, + HAL_CBACK(callbacks, client->open_cb, p_data->open.conn_id, p_data->open.status, p_data->open.client_if, p_data->open.remote_bda); if (GATT_DEF_BLE_MTU_SIZE != p_data->open.mtu && p_data->open.mtu) { - HAL_CBACK(bt_gatt_callbacks, client->configure_mtu_cb, p_data->open.conn_id, - p_data->open.status, p_data->open.mtu); + HAL_CBACK(callbacks, client->configure_mtu_cb, p_data->open.conn_id, p_data->open.status, + p_data->open.mtu); } if (p_data->open.status == GATT_SUCCESS) { @@ -190,7 +194,7 @@ static void btif_gattc_upstreams_evt(uint16_t event, char* p_param) { case BTA_GATTC_CLOSE_EVT: { log::debug("BTA_GATTC_CLOSE_EVT {}", p_data->close.remote_bda); - HAL_CBACK(bt_gatt_callbacks, client->close_cb, p_data->close.conn_id, p_data->close.status, + HAL_CBACK(callbacks, client->close_cb, p_data->close.conn_id, p_data->close.status, p_data->close.client_if, p_data->close.remote_bda); break; } @@ -203,33 +207,33 @@ static void btif_gattc_upstreams_evt(uint16_t event, char* p_param) { break; case BTA_GATTC_CFG_MTU_EVT: { - HAL_CBACK(bt_gatt_callbacks, client->configure_mtu_cb, p_data->cfg_mtu.conn_id, + HAL_CBACK(callbacks, client->configure_mtu_cb, p_data->cfg_mtu.conn_id, p_data->cfg_mtu.status, p_data->cfg_mtu.mtu); break; } case BTA_GATTC_CONGEST_EVT: - HAL_CBACK(bt_gatt_callbacks, client->congestion_cb, p_data->congest.conn_id, + HAL_CBACK(callbacks, client->congestion_cb, p_data->congest.conn_id, p_data->congest.congested); break; case BTA_GATTC_PHY_UPDATE_EVT: - HAL_CBACK(bt_gatt_callbacks, client->phy_updated_cb, p_data->phy_update.conn_id, + HAL_CBACK(callbacks, client->phy_updated_cb, p_data->phy_update.conn_id, p_data->phy_update.tx_phy, p_data->phy_update.rx_phy, p_data->phy_update.status); break; case BTA_GATTC_CONN_UPDATE_EVT: - HAL_CBACK(bt_gatt_callbacks, client->conn_updated_cb, p_data->conn_update.conn_id, + HAL_CBACK(callbacks, client->conn_updated_cb, p_data->conn_update.conn_id, p_data->conn_update.interval, p_data->conn_update.latency, p_data->conn_update.timeout, p_data->conn_update.status); break; case BTA_GATTC_SRVC_CHG_EVT: - HAL_CBACK(bt_gatt_callbacks, client->service_changed_cb, p_data->service_changed.conn_id); + HAL_CBACK(callbacks, client->service_changed_cb, p_data->service_changed.conn_id); break; case BTA_GATTC_SUBRATE_CHG_EVT: - HAL_CBACK(bt_gatt_callbacks, client->subrate_chg_cb, p_data->subrate_chg.conn_id, + HAL_CBACK(callbacks, client->subrate_chg_cb, p_data->subrate_chg.conn_id, p_data->subrate_chg.subrate_factor, p_data->subrate_chg.latency, p_data->subrate_chg.cont_num, p_data->subrate_chg.timeout, p_data->subrate_chg.status); @@ -274,8 +278,9 @@ static bt_status_t btif_gattc_register_app(const Uuid& uuid, bool eatt_support) [](const Uuid& uuid, uint8_t client_id, uint8_t status) { do_in_jni_thread(Bind( [](const Uuid& uuid, uint8_t client_id, uint8_t status) { - HAL_CBACK(bt_gatt_callbacks, client->register_client_cb, - status, client_id, uuid); + auto callbacks = bt_gatt_callbacks; + HAL_CBACK(callbacks, client->register_client_cb, status, + client_id, uuid); }, uuid, client_id, status)); }, @@ -319,7 +324,8 @@ void btif_gattc_open_impl(int client_if, RawAddress address, tBLE_ADDR_TYPE addr tBTM_BLE_VSC_CB vnd_capabilities; BTM_BleGetVendorCapabilities(&vnd_capabilities); if (!vnd_capabilities.rpa_offloading) { - HAL_CBACK(bt_gatt_callbacks, client->open_cb, 0, BT_STATUS_UNSUPPORTED, client_if, address); + auto callbacks = bt_gatt_callbacks; + HAL_CBACK(callbacks, client->open_cb, 0, BT_STATUS_UNSUPPORTED, client_if, address); return; } } @@ -404,7 +410,8 @@ void btif_gattc_get_gatt_db_impl(int conn_id) { int count = 0; BTA_GATTC_GetGattDb(conn_id, 0x0000, 0xFFFF, &db, &count); - HAL_CBACK(bt_gatt_callbacks, client->get_gatt_db_cb, conn_id, db, count); + auto callbacks = bt_gatt_callbacks; + HAL_CBACK(callbacks, client->get_gatt_db_cb, conn_id, db, count); osi_free(db); } @@ -469,7 +476,6 @@ void read_desc_cb(uint16_t conn_id, tGATT_STATUS status, uint16_t handle, uint16 if (len > 0) { memcpy(params.value.value, value, len); } - CLI_CBACK_IN_JNI(read_descriptor_cb, conn_id, status, params); } @@ -546,7 +552,8 @@ static void btif_gattc_reg_for_notification_impl(tGATT_IF client_if, const RawAd tGATT_STATUS status = BTA_GATTC_RegisterForNotifications(client_if, bda, handle); // TODO(jpawlowski): conn_id is currently unused - HAL_CBACK(bt_gatt_callbacks, client->register_for_notification_cb, + auto callbacks = bt_gatt_callbacks; + HAL_CBACK(callbacks, client->register_for_notification_cb, /* conn_id */ 0, 1, status, handle); } @@ -563,7 +570,8 @@ static void btif_gattc_dereg_for_notification_impl(tGATT_IF client_if, const Raw tGATT_STATUS status = BTA_GATTC_DeregisterForNotifications(client_if, bda, handle); // TODO(jpawlowski): conn_id is currently unused - HAL_CBACK(bt_gatt_callbacks, client->register_for_notification_cb, + auto callbacks = bt_gatt_callbacks; + HAL_CBACK(callbacks, client->register_for_notification_cb, /* conn_id */ 0, 0, status, handle); } @@ -582,7 +590,7 @@ static bt_status_t btif_gattc_read_remote_rssi(int client_if, const RawAddress& return do_in_jni_thread(base::Bind( [](int client_if, const RawAddress& bd_addr) { if (get_btm_client_interface().link_controller.BTM_ReadRSSI( - bd_addr, btm_read_rssi_cb) != BTM_SUCCESS) { + bd_addr, btm_read_rssi_cb) != BTM_CMD_STARTED) { log::warn("Unable to read RSSI peer:{} client_if:{}", bd_addr, client_if); } }, diff --git a/system/btif/src/btif_gatt_server.cc b/system/btif/src/btif_gatt_server.cc index a273f8d9d7..3714269c23 100644 --- a/system/btif/src/btif_gatt_server.cc +++ b/system/btif/src/btif_gatt_server.cc @@ -147,10 +147,11 @@ static void btapp_gatts_free_req_data(uint16_t event, tBTA_GATTS* p_data) { static void btapp_gatts_handle_cback(uint16_t event, char* p_param) { log::verbose("Event {}", event); + auto callbacks = bt_gatt_callbacks; tBTA_GATTS* p_data = (tBTA_GATTS*)p_param; switch (event) { case BTA_GATTS_REG_EVT: { - HAL_CBACK(bt_gatt_callbacks, server->register_server_cb, p_data->reg_oper.status, + HAL_CBACK(callbacks, server->register_server_cb, p_data->reg_oper.status, p_data->reg_oper.server_if, p_data->reg_oper.uuid); break; } @@ -161,29 +162,29 @@ static void btapp_gatts_handle_cback(uint16_t event, char* p_param) { case BTA_GATTS_CONNECT_EVT: { btif_gatt_check_encrypted_link(p_data->conn.remote_bda, p_data->conn.transport); - HAL_CBACK(bt_gatt_callbacks, server->connection_cb, p_data->conn.conn_id, - p_data->conn.server_if, true, p_data->conn.remote_bda); + HAL_CBACK(callbacks, server->connection_cb, p_data->conn.conn_id, p_data->conn.server_if, + true, p_data->conn.remote_bda); break; } case BTA_GATTS_DISCONNECT_EVT: { - HAL_CBACK(bt_gatt_callbacks, server->connection_cb, p_data->conn.conn_id, - p_data->conn.server_if, false, p_data->conn.remote_bda); + HAL_CBACK(callbacks, server->connection_cb, p_data->conn.conn_id, p_data->conn.server_if, + false, p_data->conn.remote_bda); break; } case BTA_GATTS_STOP_EVT: - HAL_CBACK(bt_gatt_callbacks, server->service_stopped_cb, p_data->srvc_oper.status, + HAL_CBACK(callbacks, server->service_stopped_cb, p_data->srvc_oper.status, p_data->srvc_oper.server_if, p_data->srvc_oper.service_id); break; case BTA_GATTS_DELETE_EVT: - HAL_CBACK(bt_gatt_callbacks, server->service_deleted_cb, p_data->srvc_oper.status, + HAL_CBACK(callbacks, server->service_deleted_cb, p_data->srvc_oper.status, p_data->srvc_oper.server_if, p_data->srvc_oper.service_id); break; case BTA_GATTS_READ_CHARACTERISTIC_EVT: { - HAL_CBACK(bt_gatt_callbacks, server->request_read_characteristic_cb, p_data->req_data.conn_id, + HAL_CBACK(callbacks, server->request_read_characteristic_cb, p_data->req_data.conn_id, p_data->req_data.trans_id, p_data->req_data.remote_bda, p_data->req_data.p_data->read_req.handle, p_data->req_data.p_data->read_req.offset, p_data->req_data.p_data->read_req.is_long); @@ -191,7 +192,7 @@ static void btapp_gatts_handle_cback(uint16_t event, char* p_param) { } case BTA_GATTS_READ_DESCRIPTOR_EVT: { - HAL_CBACK(bt_gatt_callbacks, server->request_read_descriptor_cb, p_data->req_data.conn_id, + HAL_CBACK(callbacks, server->request_read_descriptor_cb, p_data->req_data.conn_id, p_data->req_data.trans_id, p_data->req_data.remote_bda, p_data->req_data.p_data->read_req.handle, p_data->req_data.p_data->read_req.offset, p_data->req_data.p_data->read_req.is_long); @@ -200,39 +201,39 @@ static void btapp_gatts_handle_cback(uint16_t event, char* p_param) { case BTA_GATTS_WRITE_CHARACTERISTIC_EVT: { const auto& req = p_data->req_data.p_data->write_req; - HAL_CBACK(bt_gatt_callbacks, server->request_write_characteristic_cb, - p_data->req_data.conn_id, p_data->req_data.trans_id, p_data->req_data.remote_bda, - req.handle, req.offset, req.need_rsp, req.is_prep, req.value, req.len); + HAL_CBACK(callbacks, server->request_write_characteristic_cb, p_data->req_data.conn_id, + p_data->req_data.trans_id, p_data->req_data.remote_bda, req.handle, req.offset, + req.need_rsp, req.is_prep, req.value, req.len); break; } case BTA_GATTS_WRITE_DESCRIPTOR_EVT: { const auto& req = p_data->req_data.p_data->write_req; - HAL_CBACK(bt_gatt_callbacks, server->request_write_descriptor_cb, p_data->req_data.conn_id, + HAL_CBACK(callbacks, server->request_write_descriptor_cb, p_data->req_data.conn_id, p_data->req_data.trans_id, p_data->req_data.remote_bda, req.handle, req.offset, req.need_rsp, req.is_prep, req.value, req.len); break; } case BTA_GATTS_EXEC_WRITE_EVT: { - HAL_CBACK(bt_gatt_callbacks, server->request_exec_write_cb, p_data->req_data.conn_id, + HAL_CBACK(callbacks, server->request_exec_write_cb, p_data->req_data.conn_id, p_data->req_data.trans_id, p_data->req_data.remote_bda, p_data->req_data.p_data->exec_write); break; } case BTA_GATTS_CONF_EVT: - HAL_CBACK(bt_gatt_callbacks, server->indication_sent_cb, p_data->req_data.conn_id, + HAL_CBACK(callbacks, server->indication_sent_cb, p_data->req_data.conn_id, p_data->req_data.status); break; case BTA_GATTS_CONGEST_EVT: - HAL_CBACK(bt_gatt_callbacks, server->congestion_cb, p_data->congest.conn_id, + HAL_CBACK(callbacks, server->congestion_cb, p_data->congest.conn_id, p_data->congest.congested); break; case BTA_GATTS_MTU_EVT: - HAL_CBACK(bt_gatt_callbacks, server->mtu_changed_cb, p_data->req_data.conn_id, + HAL_CBACK(callbacks, server->mtu_changed_cb, p_data->req_data.conn_id, p_data->req_data.p_data->mtu); break; @@ -243,18 +244,18 @@ static void btapp_gatts_handle_cback(uint16_t event, char* p_param) { break; case BTA_GATTS_PHY_UPDATE_EVT: - HAL_CBACK(bt_gatt_callbacks, server->phy_updated_cb, p_data->phy_update.conn_id, + HAL_CBACK(callbacks, server->phy_updated_cb, p_data->phy_update.conn_id, p_data->phy_update.tx_phy, p_data->phy_update.rx_phy, p_data->phy_update.status); break; case BTA_GATTS_CONN_UPDATE_EVT: - HAL_CBACK(bt_gatt_callbacks, server->conn_updated_cb, p_data->conn_update.conn_id, + HAL_CBACK(callbacks, server->conn_updated_cb, p_data->conn_update.conn_id, p_data->conn_update.interval, p_data->conn_update.latency, p_data->conn_update.timeout, p_data->conn_update.status); break; case BTA_GATTS_SUBRATE_CHG_EVT: - HAL_CBACK(bt_gatt_callbacks, server->subrate_chg_cb, p_data->subrate_chg.conn_id, + HAL_CBACK(callbacks, server->subrate_chg_cb, p_data->subrate_chg.conn_id, p_data->subrate_chg.subrate_factor, p_data->subrate_chg.latency, p_data->subrate_chg.cont_num, p_data->subrate_chg.timeout, p_data->subrate_chg.status); @@ -390,8 +391,8 @@ static bt_status_t btif_gatts_close(int server_if, const RawAddress& bd_addr, in static void on_service_added_cb(tGATT_STATUS status, int server_if, vector<btgatt_db_element_t> service) { - HAL_CBACK(bt_gatt_callbacks, server->service_added_cb, status, server_if, service.data(), - service.size()); + auto callbacks = bt_gatt_callbacks; + HAL_CBACK(callbacks, server->service_added_cb, status, server_if, service.data(), service.size()); } static void add_service_impl(int server_if, vector<btgatt_db_element_t> service) { @@ -401,7 +402,8 @@ static void add_service_impl(int server_if, vector<btgatt_db_element_t> service) if (service[0].uuid == Uuid::From16Bit(UUID_SERVCLASS_GATT_SERVER) || service[0].uuid == Uuid::From16Bit(UUID_SERVCLASS_GAP_SERVER)) { log::error("Attept to register restricted service"); - HAL_CBACK(bt_gatt_callbacks, server->service_added_cb, BT_STATUS_AUTH_REJECTED, server_if, + auto callbacks = bt_gatt_callbacks; + HAL_CBACK(callbacks, server->service_added_cb, BT_STATUS_AUTH_REJECTED, server_if, service.data(), service.size()); return; } @@ -448,7 +450,8 @@ static void btif_gatts_send_response_impl(int conn_id, int trans_id, int status, BTA_GATTS_SendRsp(conn_id, trans_id, static_cast<tGATT_STATUS>(status), &rsp_struct); - HAL_CBACK(bt_gatt_callbacks, server->response_confirmation_cb, 0, rsp_struct.attr_value.handle); + auto callbacks = bt_gatt_callbacks; + HAL_CBACK(callbacks, server->response_confirmation_cb, 0, rsp_struct.attr_value.handle); } static bt_status_t btif_gatts_send_response(int conn_id, int trans_id, int status, diff --git a/system/btif/src/btif_hh.cc b/system/btif/src/btif_hh.cc index 47907ae833..c0ec97443c 100644 --- a/system/btif/src/btif_hh.cc +++ b/system/btif/src/btif_hh.cc @@ -464,12 +464,14 @@ static bthh_connection_state_t hh_get_state_on_disconnect(tAclLinkSpec& link_spe } } -static void hh_connect_complete(uint8_t handle, tAclLinkSpec& link_spec, - bthh_connection_state_t state) { +static void hh_connect_complete(tBTA_HH_CONN& conn, bthh_connection_state_t state) { if (state != BTHH_CONN_STATE_CONNECTED) { - BTA_HhClose(handle); + if (!com::android::bluetooth::flags::close_hid_only_if_connected() || + conn.status == BTA_HH_OK) { + BTA_HhClose(conn.handle); + } } - BTHH_STATE_UPDATE(link_spec, state); + BTHH_STATE_UPDATE(conn.link_spec, state); } /******************************************************************************* @@ -585,7 +587,7 @@ static void hh_open_handler(tBTA_HH_CONN& conn) { } if (!com::android::bluetooth::flags::suppress_hid_rejection_broadcast()) { - hh_connect_complete(conn.handle, conn.link_spec, BTHH_CONN_STATE_DISCONNECTED); + hh_connect_complete(conn, BTHH_CONN_STATE_DISCONNECTED); return; } BTA_HhClose(conn.handle); @@ -607,14 +609,14 @@ static void hh_open_handler(tBTA_HH_CONN& conn) { p_dev->dev_status = hh_get_state_on_disconnect(p_dev->link_spec); } - hh_connect_complete(conn.handle, conn.link_spec, BTHH_CONN_STATE_DISCONNECTED); + hh_connect_complete(conn, BTHH_CONN_STATE_DISCONNECTED); return; } /* Initialize device driver */ if (!bta_hh_co_open(conn.handle, conn.sub_class, conn.attr_mask, conn.app_id, conn.link_spec)) { log::warn("Failed to find the uhid driver"); - hh_connect_complete(conn.handle, conn.link_spec, BTHH_CONN_STATE_DISCONNECTED); + hh_connect_complete(conn, BTHH_CONN_STATE_DISCONNECTED); return; } @@ -623,7 +625,7 @@ static void hh_open_handler(tBTA_HH_CONN& conn) { /* The connect request must have come from device side and exceeded the * connected HID device number. */ log::warn("Cannot find device with handle {}", conn.handle); - hh_connect_complete(conn.handle, conn.link_spec, BTHH_CONN_STATE_DISCONNECTED); + hh_connect_complete(conn, BTHH_CONN_STATE_DISCONNECTED); return; } @@ -634,7 +636,7 @@ static void hh_open_handler(tBTA_HH_CONN& conn) { p_dev->link_spec = conn.link_spec; p_dev->dev_status = BTHH_CONN_STATE_CONNECTED; } - hh_connect_complete(conn.handle, conn.link_spec, BTHH_CONN_STATE_CONNECTED); + hh_connect_complete(conn, BTHH_CONN_STATE_CONNECTED); // Send set_idle if the peer_device is a keyboard if (check_cod_hid_major(conn.link_spec.addrt.bda, COD_HID_KEYBOARD) || check_cod_hid_major(conn.link_spec.addrt.bda, COD_HID_COMBO)) { @@ -2186,6 +2188,7 @@ void DumpsysHid(int fd) { p_dev->reconnect_allowed ? "T" : "F"); } } + BTA_HhDump(fd); } namespace bluetooth { diff --git a/system/btif/src/btif_sock_sco.cc b/system/btif/src/btif_sock_sco.cc index a4fd0f6c75..5035757a38 100644 --- a/system/btif/src/btif_sock_sco.cc +++ b/system/btif/src/btif_sock_sco.cc @@ -34,6 +34,7 @@ #include "osi/include/thread.h" #include "stack/include/btm_api.h" #include "stack/include/btm_client_interface.h" +#include "stack/include/btm_status.h" #include "types/raw_address.h" // This module provides a socket abstraction for SCO connections to a higher @@ -89,7 +90,7 @@ bt_status_t btsock_sco_init(thread_t* thread_) { thread = thread_; enh_esco_params_t params = esco_parameters_for_codec(SCO_CODEC_CVSD_D1, true); - if (get_btm_client_interface().sco.BTM_SetEScoMode(¶ms) != BTM_SUCCESS) { + if (get_btm_client_interface().sco.BTM_SetEScoMode(¶ms) != tBTM_STATUS::BTM_SUCCESS) { log::warn("Unable to set ESCO parameters"); } @@ -112,8 +113,8 @@ bt_status_t btsock_sco_listen(int* sock_fd, int /* flags */) { return BT_STATUS_SOCKET_ERROR; } - if (get_btm_client_interface().sco.BTM_RegForEScoEvts(sco_socket->sco_handle, - connection_request_cb) != BTM_SUCCESS) { + if (get_btm_client_interface().sco.BTM_RegForEScoEvts( + sco_socket->sco_handle, connection_request_cb) != tBTM_STATUS::BTM_SUCCESS) { log::warn("Unable to register for ESCO events"); } listen_sco_socket = sco_socket; @@ -154,7 +155,7 @@ static sco_socket_t* sco_socket_establish_locked(bool is_listening, const RawAdd status = get_btm_client_interface().sco.BTM_CreateSco( bd_addr, !is_listening, params.packet_types, &sco_socket->sco_handle, connect_completed_cb, disconnect_completed_cb); - if (status != BTM_CMD_STARTED) { + if (status != tBTM_STATUS::BTM_CMD_STARTED) { log::error("unable to create SCO socket: {}", status); goto error; } @@ -199,7 +200,8 @@ static void sco_socket_free_locked(sco_socket_t* sco_socket) { } if (sco_socket->sco_handle != BTM_INVALID_SCO_INDEX) { - if (get_btm_client_interface().sco.BTM_RemoveSco(sco_socket->sco_handle) != BTM_SUCCESS) { + if (get_btm_client_interface().sco.BTM_RemoveSco(sco_socket->sco_handle) != + tBTM_STATUS::BTM_SUCCESS) { log::warn("Unable to remove SCO handle:{}", sco_socket->sco_handle); } } @@ -270,8 +272,8 @@ static void connection_request_cb(tBTM_ESCO_EVT event, tBTM_ESCO_EVT_DATA* data) goto error; } - if (get_btm_client_interface().sco.BTM_RegForEScoEvts(listen_sco_socket->sco_handle, - connection_request_cb) != BTM_SUCCESS) { + if (get_btm_client_interface().sco.BTM_RegForEScoEvts( + listen_sco_socket->sco_handle, connection_request_cb) != tBTM_STATUS::BTM_SUCCESS) { log::warn("Unable to register for ESCO events handle:{}", listen_sco_socket->sco_handle); } get_btm_client_interface().sco.BTM_EScoConnRsp(conn_data->sco_inx, HCI_SUCCESS, NULL); @@ -299,7 +301,8 @@ static void connect_completed_cb(uint16_t sco_handle) { // app-level // interest in the SCO socket. if (!sco_socket->socket) { - if (get_btm_client_interface().sco.BTM_RemoveSco(sco_socket->sco_handle) != BTM_SUCCESS) { + if (get_btm_client_interface().sco.BTM_RemoveSco(sco_socket->sco_handle) != + tBTM_STATUS::BTM_SUCCESS) { log::warn("Unable to remove SCO handle:{}", sco_socket->sco_handle); } list_remove(sco_sockets, sco_socket); @@ -335,7 +338,8 @@ static void socket_read_ready_cb(socket_t* /* socket */, void* context) { // routine that the socket is no longer desired and should be torn // down. if (sco_socket->connect_completed || sco_socket == listen_sco_socket) { - if (BTM_RemoveSco(sco_socket->sco_handle) == BTM_SUCCESS) { + if (get_btm_client_interface().sco.BTM_RemoveSco(sco_socket->sco_handle) == + tBTM_STATUS::BTM_SUCCESS) { list_remove(sco_sockets, sco_socket); } if (sco_socket == listen_sco_socket) { diff --git a/system/btif/src/btif_vc.cc b/system/btif/src/btif_vc.cc index 150141f118..9ff8db312a 100644 --- a/system/btif/src/btif_vc.cc +++ b/system/btif/src/btif_vc.cc @@ -60,10 +60,10 @@ class VolumeControlInterfaceImpl : public VolumeControlInterface, public VolumeC address)); } - void OnVolumeStateChanged(const RawAddress& address, uint8_t volume, bool mute, + void OnVolumeStateChanged(const RawAddress& address, uint8_t volume, bool mute, uint8_t flags, bool isAutonomous) override { do_in_jni_thread(Bind(&VolumeControlCallbacks::OnVolumeStateChanged, Unretained(callbacks_), - address, volume, mute, isAutonomous)); + address, volume, mute, flags, isAutonomous)); } void OnGroupVolumeStateChanged(int group_id, uint8_t volume, bool mute, diff --git a/system/btif/src/stack_manager.cc b/system/btif/src/stack_manager.cc index 3af74062d6..61099d65d8 100644 --- a/system/btif/src/stack_manager.cc +++ b/system/btif/src/stack_manager.cc @@ -63,6 +63,7 @@ #include "internal_include/stack_config.h" #include "rust/src/core/ffi/module.h" #include "stack/btm/btm_ble_int.h" +#include "stack/include/ais_api.h" #include "stack/include/smp_api.h" #ifndef BT_STACK_CLEANUP_WAIT_MS @@ -301,6 +302,7 @@ static void event_start_up_stack(bluetooth::core::CoreInterface* interface, RFCOMM_Init(); GAP_Init(); + AIS_Init(); startProfiles(); diff --git a/system/common/Android.bp b/system/common/Android.bp index 73170b1eec..f50de9f23e 100644 --- a/system/common/Android.bp +++ b/system/common/Android.bp @@ -59,7 +59,6 @@ cc_library_static { "libbt-platform-protos-lite", "libbt_shim_bridge", ], - cflags: ["-Wno-unused-parameter"], } cc_test { @@ -118,7 +117,6 @@ cc_test { cfi: false, }, header_libs: ["libbluetooth_headers"], - cflags: ["-Wno-unused-parameter"], } cc_test { @@ -149,7 +147,6 @@ cc_test { "libosi", ], header_libs: ["libbluetooth_headers"], - cflags: ["-Wno-unused-parameter"], } cc_benchmark { @@ -177,5 +174,4 @@ cc_benchmark { "libosi", ], header_libs: ["libbluetooth_headers"], - cflags: ["-Wno-unused-parameter"], } diff --git a/system/common/benchmark/thread_performance_benchmark.cc b/system/common/benchmark/thread_performance_benchmark.cc index 1a9828d394..cfad3627b9 100644 --- a/system/common/benchmark/thread_performance_benchmark.cc +++ b/system/common/benchmark/thread_performance_benchmark.cc @@ -48,15 +48,15 @@ void pthread_callback_batch(void* context) { } } -void callback_sequential(void* context) { g_counter_promise->set_value(); } +void callback_sequential(void* /* context */) { g_counter_promise->set_value(); } -void callback_sequential_queue(fixed_queue_t* queue, void* context) { +void callback_sequential_queue(fixed_queue_t* queue, void* /* context */) { bluetooth::log::assert_that(queue != nullptr, "assert failed: queue != nullptr"); fixed_queue_dequeue(queue); g_counter_promise->set_value(); } -void callback_batch(fixed_queue_t* queue, void* data) { +void callback_batch(fixed_queue_t* queue, void* /* data */) { bluetooth::log::assert_that(queue != nullptr, "assert failed: queue != nullptr"); fixed_queue_dequeue(queue); g_counter++; diff --git a/system/common/message_loop_thread_unittest.cc b/system/common/message_loop_thread_unittest.cc index 21f05f68c2..8b6d598aaf 100644 --- a/system/common/message_loop_thread_unittest.cc +++ b/system/common/message_loop_thread_unittest.cc @@ -324,10 +324,10 @@ TEST_F(MessageLoopThreadTest, test_post_twice) { int counter = 0; message_loop_thread.StartUp(); message_loop_thread.Post(base::BindOnce( - [](MessageLoopThread* thread, int* counter) { ASSERT_EQ((*counter)++, 0); }, + [](MessageLoopThread* /* thread */, int* counter) { ASSERT_EQ((*counter)++, 0); }, &message_loop_thread, &counter)); message_loop_thread.Post(base::BindOnce( - [](MessageLoopThread* thread, int* counter) { ASSERT_EQ((*counter)++, 1); }, + [](MessageLoopThread* /* thread */, int* counter) { ASSERT_EQ((*counter)++, 1); }, &message_loop_thread, &counter)); message_loop_thread.ShutDown(); ASSERT_EQ(counter, 2); diff --git a/system/common/metrics.cc b/system/common/metrics.cc index 778662ec4e..4f75ca4426 100644 --- a/system/common/metrics.cc +++ b/system/common/metrics.cc @@ -16,7 +16,7 @@ * ******************************************************************************/ -#include "metrics.h" +#include "common/metrics.h" #include <base/base64.h> #include <bluetooth/log.h> @@ -26,24 +26,21 @@ #include <unistd.h> #include <algorithm> -#include <array> #include <cerrno> #include <cstdint> #include <cstring> #include <memory> -#include <mutex> +#include <mutex> // NOLINT +#include <utility> -#include "address_obfuscator.h" #include "bluetooth/metrics/bluetooth.pb.h" +#include "common/address_obfuscator.h" +#include "common/leaky_bonded_queue.h" +#include "common/time_util.h" #include "hci/address.h" -#include "internal_include/bt_trace.h" -#include "leaky_bonded_queue.h" #include "main/shim/metric_id_api.h" -#include "metric_id_allocator.h" #include "metrics/metrics_state.h" -#include "os/metrics.h" #include "osi/include/osi.h" -#include "time_util.h" #include "types/raw_address.h" namespace fmt { @@ -391,7 +388,7 @@ void BluetoothMetricsLogger::LogBluetoothSessionDeviceInfo(uint32_t device_class } DeviceInfo* info = pimpl_->bluetooth_session_->mutable_device_connected_to(); info->set_device_class(device_class); - info->set_device_type(DeviceInfo::DEVICE_TYPE_BREDR); + info->set_device_type(get_device_type(device_type)); } void BluetoothMetricsLogger::LogA2dpSession(const A2dpSessionMetrics& a2dp_session_metrics) { @@ -851,17 +848,17 @@ void LogBluetoothHalCrashReason(const RawAddress& address, uint32_t error_code, } } -void LogLeAudioConnectionSessionReported(int32_t group_size, int32_t group_metric_id, - int64_t connection_duration_nanos, - std::vector<int64_t>& device_connecting_offset_nanos, - std::vector<int64_t>& device_connected_offset_nanos, - std::vector<int64_t>& device_connection_duration_nanos, - std::vector<int32_t>& device_connection_status, - std::vector<int32_t>& device_disconnection_status, - std::vector<RawAddress>& device_address, - std::vector<int64_t>& streaming_offset_nanos, - std::vector<int64_t>& streaming_duration_nanos, - std::vector<int32_t>& streaming_context_type) { +void LogLeAudioConnectionSessionReported( + int32_t group_size, int32_t group_metric_id, int64_t connection_duration_nanos, + const std::vector<int64_t>& device_connecting_offset_nanos, + const std::vector<int64_t>& device_connected_offset_nanos, + const std::vector<int64_t>& device_connection_duration_nanos, + const std::vector<int32_t>& device_connection_status, + const std::vector<int32_t>& device_disconnection_status, + const std::vector<RawAddress>& device_address, + const std::vector<int64_t>& streaming_offset_nanos, + const std::vector<int64_t>& streaming_duration_nanos, + const std::vector<int32_t>& streaming_context_type) { std::vector<int32_t> device_metric_id(device_address.size()); for (uint64_t i = 0; i < device_address.size(); i++) { if (!device_address[i].IsEmpty()) { diff --git a/system/common/metrics.h b/system/common/metrics.h index c40b184bf8..42bae9b215 100644 --- a/system/common/metrics.h +++ b/system/common/metrics.h @@ -493,17 +493,17 @@ void LogManufacturerInfo(const RawAddress& address, void LogBluetoothHalCrashReason(const RawAddress& address, uint32_t error_code, uint32_t vendor_error_code); -void LogLeAudioConnectionSessionReported(int32_t group_size, int32_t group_metric_id, - int64_t connection_duration_nanos, - std::vector<int64_t>& device_connecting_offset_nanos, - std::vector<int64_t>& device_connected_offset_nanos, - std::vector<int64_t>& device_connection_duration_nanos, - std::vector<int32_t>& device_connection_status, - std::vector<int32_t>& device_disconnection_status, - std::vector<RawAddress>& device_address, - std::vector<int64_t>& streaming_offset_nanos, - std::vector<int64_t>& streaming_duration_nanos, - std::vector<int32_t>& streaming_context_type); +void LogLeAudioConnectionSessionReported( + int32_t group_size, int32_t group_metric_id, int64_t connection_duration_nanos, + const std::vector<int64_t>& device_connecting_offset_nanos, + const std::vector<int64_t>& device_connected_offset_nanos, + const std::vector<int64_t>& device_connection_duration_nanos, + const std::vector<int32_t>& device_connection_status, + const std::vector<int32_t>& device_disconnection_status, + const std::vector<RawAddress>& device_address, + const std::vector<int64_t>& streaming_offset_nanos, + const std::vector<int64_t>& streaming_duration_nanos, + const std::vector<int32_t>& streaming_context_type); void LogLeAudioBroadcastSessionReported(int64_t duration_nanos); diff --git a/system/common/metrics_linux.cc b/system/common/metrics_linux.cc index 04ac50c9d6..13795f764d 100644 --- a/system/common/metrics_linux.cc +++ b/system/common/metrics_linux.cc @@ -18,58 +18,60 @@ #include <bluetooth/log.h> -#include "leaky_bonded_queue.h" -#include "metrics.h" +#include "common/metrics.h" #include "types/raw_address.h" namespace bluetooth { namespace common { -void A2dpSessionMetrics::Update(const A2dpSessionMetrics& metrics) {} +void A2dpSessionMetrics::Update(const A2dpSessionMetrics& /* metrics */) {} -bool A2dpSessionMetrics::operator==(const A2dpSessionMetrics& rhs) const { +bool A2dpSessionMetrics::operator==(const A2dpSessionMetrics& /* rhs */) const { log::info("UNIMPLEMENTED"); return true; } struct BluetoothMetricsLogger::impl { - impl(size_t max_bluetooth_session, size_t max_pair_event, size_t max_wake_event, - size_t max_scan_event) {} + impl(size_t /* max_bluetooth_session */, size_t /* max_pair_event */, size_t /* max_wake_event */, + size_t /* max_scan_event */) {} }; BluetoothMetricsLogger::BluetoothMetricsLogger() : pimpl_(new impl(kMaxNumBluetoothSession, kMaxNumPairEvent, kMaxNumWakeEvent, kMaxNumScanEvent)) {} -void BluetoothMetricsLogger::LogPairEvent(uint32_t disconnect_reason, uint64_t timestamp_ms, - uint32_t device_class, device_type_t device_type) {} +void BluetoothMetricsLogger::LogPairEvent(uint32_t /* disconnect_reason */, + uint64_t /* timestamp_ms */, uint32_t /* device_class */, + device_type_t /* device_type */) {} -void BluetoothMetricsLogger::LogWakeEvent(wake_event_type_t type, const std::string& requestor, - const std::string& name, uint64_t timestamp_ms) {} +void BluetoothMetricsLogger::LogWakeEvent(wake_event_type_t /* type */, + const std::string& /* requestor */, + const std::string& /* name */, + uint64_t /* timestamp_ms */) {} -void BluetoothMetricsLogger::LogScanEvent(bool start, const std::string& initiator, - scan_tech_t type, uint32_t results, - uint64_t timestamp_ms) {} +void BluetoothMetricsLogger::LogScanEvent(bool /* start */, const std::string& /* initiator */, + scan_tech_t /* type */, uint32_t /* results */, + uint64_t /* timestamp_ms */) {} -void BluetoothMetricsLogger::LogBluetoothSessionStart(connection_tech_t connection_tech_type, - uint64_t timestamp_ms) {} +void BluetoothMetricsLogger::LogBluetoothSessionStart(connection_tech_t /* connection_tech_type */, + uint64_t /* timestamp_ms */) {} -void BluetoothMetricsLogger::LogBluetoothSessionEnd(disconnect_reason_t disconnect_reason, - uint64_t timestamp_ms) {} +void BluetoothMetricsLogger::LogBluetoothSessionEnd(disconnect_reason_t /* disconnect_reason */, + uint64_t /* timestamp_ms */) {} -void BluetoothMetricsLogger::LogBluetoothSessionDeviceInfo(uint32_t device_class, - device_type_t device_type) {} +void BluetoothMetricsLogger::LogBluetoothSessionDeviceInfo(uint32_t /* device_class */, + device_type_t /* device_type */) {} -void BluetoothMetricsLogger::LogA2dpSession(const A2dpSessionMetrics& a2dp_session_metrics) {} +void BluetoothMetricsLogger::LogA2dpSession(const A2dpSessionMetrics& /* a2dp_session_metrics */) {} -void BluetoothMetricsLogger::LogHeadsetProfileRfcConnection(tBTA_SERVICE_ID service_id) {} +void BluetoothMetricsLogger::LogHeadsetProfileRfcConnection(tBTA_SERVICE_ID /* service_id */) {} -void BluetoothMetricsLogger::WriteString(std::string* serialized) {} +void BluetoothMetricsLogger::WriteString(std::string* /* serialized */) {} -void BluetoothMetricsLogger::WriteBase64String(std::string* serialized) {} +void BluetoothMetricsLogger::WriteBase64String(std::string* /* serialized */) {} -void BluetoothMetricsLogger::WriteBase64(int fd) {} +void BluetoothMetricsLogger::WriteBase64(int /* fd */) {} void BluetoothMetricsLogger::CutoffSession() {} @@ -81,71 +83,82 @@ void BluetoothMetricsLogger::ResetLog() {} void BluetoothMetricsLogger::Reset() {} -void LogClassicPairingEvent(const RawAddress& address, uint16_t handle, uint32_t hci_cmd, - uint16_t hci_event, uint16_t cmd_status, uint16_t reason_code, - int64_t event_value) {} - -void LogSocketConnectionState(const RawAddress& address, int port, int type, - android::bluetooth::SocketConnectionstateEnum connection_state, - int64_t tx_bytes, int64_t rx_bytes, int uid, int server_port, - android::bluetooth::SocketRoleEnum socket_role) {} - -void LogHciTimeoutEvent(uint32_t hci_cmd) {} - -void LogA2dpAudioUnderrunEvent(const RawAddress& address, uint64_t encoding_interval_millis, - int num_missing_pcm_bytes) {} - -void LogA2dpAudioOverrunEvent(const RawAddress& address, uint64_t encoding_interval_millis, - int num_dropped_buffers, int num_dropped_encoded_frames, - int num_dropped_encoded_bytes) {} - -void LogA2dpPlaybackEvent(const RawAddress& address, int playback_state, int audio_coding_mode) {} - -void LogBluetoothHalCrashReason(const RawAddress& address, uint32_t error_code, - uint32_t vendor_error_code) {} - -void LogReadRssiResult(const RawAddress& address, uint16_t handle, uint32_t cmd_status, - int8_t rssi) {} - -void LogReadFailedContactCounterResult(const RawAddress& address, uint16_t handle, - uint32_t cmd_status, int32_t failed_contact_counter) {} - -void LogReadTxPowerLevelResult(const RawAddress& address, uint16_t handle, uint32_t cmd_status, - int32_t transmit_power_level) {} - -void LogRemoteVersionInfo(uint16_t handle, uint8_t status, uint8_t version, - uint16_t manufacturer_name, uint16_t subversion) {} - -void LogLinkLayerConnectionEvent(const RawAddress* address, uint32_t connection_handle, - android::bluetooth::DirectionEnum direction, uint16_t link_type, - uint32_t hci_cmd, uint16_t hci_event, uint16_t hci_ble_event, - uint16_t cmd_status, uint16_t reason_code) {} - -void LogManufacturerInfo(const RawAddress& address, - android::bluetooth::DeviceInfoSrcEnum source_type, - const std::string& source_name, const std::string& manufacturer, - const std::string& model, const std::string& hardware_version, - const std::string& software_version) {} - -void LogSdpAttribute(const RawAddress& address, uint16_t protocol_uuid, uint16_t attribute_id, - size_t attribute_size, const char* attribute_value) {} - -void LogSmpPairingEvent(const RawAddress& address, uint8_t smp_cmd, - android::bluetooth::DirectionEnum direction, uint8_t smp_fail_reason) {} - -void LogLeAudioConnectionSessionReported(int32_t group_size, int32_t group_metric_id, - int64_t connection_duration_nanos, - std::vector<int64_t>& device_connecting_offset_nanos, - std::vector<int64_t>& device_connected_offset_nanos, - std::vector<int64_t>& device_connection_duration_nanos, - std::vector<int32_t>& device_connection_status, - std::vector<int32_t>& device_disconnection_status, - std::vector<RawAddress>& device_address, - std::vector<int64_t>& streaming_offset_nanos, - std::vector<int64_t>& streaming_duration_nanos, - std::vector<int32_t>& streaming_context_type) {} - -void LogLeAudioBroadcastSessionReported(int64_t duration_nanos) {} +void LogClassicPairingEvent(const RawAddress& /* address */, uint16_t /* handle */, + uint32_t /* hci_cmd */, uint16_t /* hci_event */, + uint16_t /* cmd_status */, uint16_t /* reason_code */, + int64_t /* event_value */) {} + +void LogSocketConnectionState(const RawAddress& /* address */, int /* port */, int /* type */, + android::bluetooth::SocketConnectionstateEnum /* connection_state */, + int64_t /* tx_bytes */, int64_t /* rx_bytes */, int /* uid */, + int /* server_port */, + android::bluetooth::SocketRoleEnum /* socket_role */) {} + +void LogHciTimeoutEvent(uint32_t /* hci_cmd */) {} + +void LogA2dpAudioUnderrunEvent(const RawAddress& /* address */, + uint64_t /* encoding_interval_millis */, + int /* num_missing_pcm_bytes */) {} + +void LogA2dpAudioOverrunEvent(const RawAddress& /* address */, + uint64_t /* encoding_interval_millis */, + int /* num_dropped_buffers */, int /* num_dropped_encoded_frames */, + int /* num_dropped_encoded_bytes */) {} + +void LogA2dpPlaybackEvent(const RawAddress& /* address */, int /* playback_state */, + int /* audio_coding_mode */) {} + +void LogBluetoothHalCrashReason(const RawAddress& /* address */, uint32_t /* error_code */, + uint32_t /* vendor_error_code */) {} + +void LogReadRssiResult(const RawAddress& /* address */, uint16_t /* handle */, + uint32_t /* cmd_status */, int8_t /* rssi */) {} + +void LogReadFailedContactCounterResult(const RawAddress& /* address */, uint16_t /* handle */, + uint32_t /* cmd_status */, + int32_t /* failed_contact_counter */) {} + +void LogReadTxPowerLevelResult(const RawAddress& /* address */, uint16_t /* handle */, + uint32_t /* cmd_status */, int32_t /* transmit_power_level */) {} + +void LogRemoteVersionInfo(uint16_t /* handle */, uint8_t /* status */, uint8_t /* version */, + uint16_t /* manufacturer_name */, uint16_t /* subversion */) {} + +void LogLinkLayerConnectionEvent(const RawAddress* /* address */, uint32_t /* connection_handle */, + android::bluetooth::DirectionEnum /* direction */, + uint16_t /* link_type */, uint32_t /* hci_cmd */, + uint16_t /* hci_event */, uint16_t /* hci_ble_event */, + uint16_t /* cmd_status */, uint16_t /* reason_code */) {} + +void LogManufacturerInfo(const RawAddress& /* address */, + android::bluetooth::DeviceInfoSrcEnum /* source_type */, + const std::string& /* source_name */, + /* const */ std::string& /* manufacturer */, + const std::string& /* model */, const std::string& /* hardware_version */, + const std::string& /* software_version */) {} + +void LogSdpAttribute(const RawAddress& /* address */, uint16_t /* protocol_uuid */, + uint16_t /* attribute_id */, size_t /* attribute_size */, + const char* /* attribute_value */) {} + +void LogSmpPairingEvent(const RawAddress& /* address */, uint8_t /* smp_cmd */, + android::bluetooth::DirectionEnum /* direction */, + uint8_t /* smp_fail_reason */) {} + +void LogLeAudioConnectionSessionReported( + int32_t /* group_size */, int32_t /* group_metric_id */, + int64_t /* connection_duration_nanos */, + const std::vector<int64_t>& /* device_connecting_offset_nanos */, + const std::vector<int64_t>& /* device_connected_offset_nanos */, + const std::vector<int64_t>& /* device_connection_duration_nanos */, + const std::vector<int32_t>& /* device_connection_status */, + const std::vector<int32_t>& /* device_disconnection_status */, + const std::vector<RawAddress>& /* device_address */, + const std::vector<int64_t>& /* streaming_offset_nanos */, + const std::vector<int64_t>& /* streaming_duration_nanos */, + const std::vector<int32_t>& /* streaming_context_type */) {} + +void LogLeAudioBroadcastSessionReported(int64_t /* duration_nanos */) {} } // namespace common diff --git a/system/common/test/thread_performance_test.cc b/system/common/test/thread_performance_test.cc index 6696486270..4eed2fdf10 100644 --- a/system/common/test/thread_performance_test.cc +++ b/system/common/test/thread_performance_test.cc @@ -39,7 +39,7 @@ using namespace bluetooth; static int g_counter = 0; static std::unique_ptr<std::promise<void>> g_counter_promise = nullptr; -void callback_batch(fixed_queue_t* queue, void* data) { +void callback_batch(fixed_queue_t* queue, void* /* data */) { if (queue != nullptr) { fixed_queue_dequeue(queue); } diff --git a/system/gd/Android.bp b/system/gd/Android.bp index aedb017047..273fdb3b7c 100644 --- a/system/gd/Android.bp +++ b/system/gd/Android.bp @@ -34,7 +34,6 @@ cc_defaults { "-DEXPORT_SYMBOL=__attribute__((visibility(\"default\")))", "-DGOOGLE_PROTOBUF_NO_RTTI", "-DLOG_NDEBUG=0", - "-Wno-unused-result", "-fvisibility=hidden", ], header_libs: ["jni_headers"], @@ -174,7 +173,6 @@ cc_defaults { "libbluetooth_smp_pdl", ], static_libs: [ - "bluetooth_flags_c_lib", "libaconfig_storage_read_api_cc", "libbase", "libbluetooth-dumpsys", @@ -210,7 +208,10 @@ cc_library { "com.android.btservices", ], min_sdk_version: "31", - static_libs: ["libchrome"], + static_libs: [ + "bluetooth_flags_c_lib", + "libchrome", + ], } cc_library_static { @@ -219,7 +220,6 @@ cc_library_static { "libbluetooth_gd_defaults", ], srcs: [ - ":BluetoothDiscoverySources", ":BluetoothShimSources", ], include_dirs: [ @@ -229,7 +229,10 @@ cc_library_static { "com.android.btservices", ], min_sdk_version: "31", - static_libs: ["libchrome"], + static_libs: [ + "bluetooth_flags_c_lib", + "libchrome", + ], } cc_library { @@ -249,6 +252,7 @@ cc_library { "-Wno-unused-parameter", ], static_libs: [ + "bluetooth_flags_c_lib", "libbluetooth-types", "libbt-common", "libchrome", @@ -271,6 +275,7 @@ cc_library { "-DUSE_FAKE_TIMERS", ], static_libs: [ + "bluetooth_flags_c_lib_for_test", "libbluetooth-types", "libbt-common", "libchrome", @@ -487,7 +492,7 @@ cc_test { "BluetoothGeneratedDumpsysTestData_h", ], static_libs: [ - "bluetooth_flags_c_lib", + "bluetooth_flags_c_lib_for_test", "libbase", "libbluetooth-protos", "libbluetooth-types", @@ -509,12 +514,12 @@ cc_test { "libflatbuffers-cpp", "libgmock", "libosi", + "server_configurable_flags", ], shared_libs: [ "libPlatformProperties", "libaconfig_storage_read_api_cc", "libcrypto", - "server_configurable_flags", ], sanitize: { address: true, @@ -538,7 +543,6 @@ cc_test { ], host_supported: true, srcs: [ - ":BluetoothDiscoveryTestSources", ":BluetoothDumpsysTestSources", ":BluetoothShimTestSources", ":TestCommonMockFunctions", @@ -561,7 +565,6 @@ cc_test { "libbluetooth-dumpsys-test", "libbluetooth-dumpsys-unittest", "libbluetooth-gdx", - "libbluetooth-types", "libbluetooth_gd", "libbluetooth_log", "libbt-btu-main-thread", @@ -577,9 +580,6 @@ cc_test { "libosi", "server_configurable_flags", ], - shared_libs: [ - "libcrypto", - ], sanitize: { address: true, }, diff --git a/system/gd/BUILD.gn b/system/gd/BUILD.gn index 74f489b63b..7f8c0b5d28 100644 --- a/system/gd/BUILD.gn +++ b/system/gd/BUILD.gn @@ -56,11 +56,6 @@ group("gd_default_deps") { } static_library("libbluetooth-gdx") { - sources = [ - "discovery/device/bt_property.cc", - "discovery/device/data_parser.cc", - "discovery/device/eir_data.cc", - ] include_dirs = [ "packages/modules/Bluetooth/system", ] diff --git a/system/gd/discovery/Android.bp b/system/gd/discovery/Android.bp deleted file mode 100644 index fd042493ef..0000000000 --- a/system/gd/discovery/Android.bp +++ /dev/null @@ -1,18 +0,0 @@ -filegroup { - name: "BluetoothDiscoverySources", - srcs: [ - "device/bt_property.cc", - "device/data_parser.cc", - "device/eir_data.cc", - ], -} - -filegroup { - name: "BluetoothDiscoveryTestSources", - srcs: [ - "device/bt_property_unittest.cc", - "device/data_parser_unittest.cc", - "device/eir_data_unittest.cc", - "device/eir_test_data_packets.cc", - ], -} diff --git a/system/gd/discovery/device/bt_property.cc b/system/gd/discovery/device/bt_property.cc deleted file mode 100644 index ab61b8ebca..0000000000 --- a/system/gd/discovery/device/bt_property.cc +++ /dev/null @@ -1,331 +0,0 @@ -/* - * Copyright 2024 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "discovery/device/bt_property.h" - -#include <base/strings/stringprintf.h> - -#include <string> - -#include "include/hardware/bluetooth.h" -#include "os/log.h" -#include "stack/include/bt_name.h" -#include "types/bluetooth/uuid.h" - -std::string bt_property_type_text(const bt_property_type_t& type) { - switch (type) { - CASE_RETURN_TEXT(BT_PROPERTY_BDNAME); - CASE_RETURN_TEXT(BT_PROPERTY_BDADDR); - CASE_RETURN_TEXT(BT_PROPERTY_UUIDS); - CASE_RETURN_TEXT(BT_PROPERTY_CLASS_OF_DEVICE); - CASE_RETURN_TEXT(BT_PROPERTY_TYPE_OF_DEVICE); - CASE_RETURN_TEXT(BT_PROPERTY_SERVICE_RECORD); - CASE_RETURN_TEXT(BT_PROPERTY_ADAPTER_BONDED_DEVICES); - CASE_RETURN_TEXT(BT_PROPERTY_ADAPTER_DISCOVERABLE_TIMEOUT); - CASE_RETURN_TEXT(BT_PROPERTY_REMOTE_FRIENDLY_NAME); - CASE_RETURN_TEXT(BT_PROPERTY_REMOTE_RSSI); - CASE_RETURN_TEXT(BT_PROPERTY_REMOTE_VERSION_INFO); - CASE_RETURN_TEXT(BT_PROPERTY_LOCAL_LE_FEATURES); - CASE_RETURN_TEXT(BT_PROPERTY_DYNAMIC_AUDIO_BUFFER); - CASE_RETURN_TEXT(BT_PROPERTY_REMOTE_IS_COORDINATED_SET_MEMBER); - CASE_RETURN_TEXT(BT_PROPERTY_APPEARANCE); - CASE_RETURN_TEXT(BT_PROPERTY_VENDOR_PRODUCT_INFO); - CASE_RETURN_TEXT(BT_PROPERTY_REMOTE_ASHA_CAPABILITY); - CASE_RETURN_TEXT(BT_PROPERTY_REMOTE_ASHA_TRUNCATED_HISYNCID); - CASE_RETURN_TEXT(BT_PROPERTY_REMOTE_MODEL_NUM); - CASE_RETURN_TEXT(BT_PROPERTY_REMOTE_ADDR_TYPE); - CASE_RETURN_TEXT(BT_PROPERTY_REMOTE_DEVICE_TIMESTAMP); - CASE_RETURN_TEXT(BT_PROPERTY_REMOTE_SECURE_CONNECTIONS_SUPPORTED); - CASE_RETURN_TEXT(BT_PROPERTY_REMOTE_MAX_SESSION_KEY_SIZE); - CASE_RETURN_TEXT(BT_PROPERTY_RESERVED_07); - CASE_RETURN_TEXT(BT_PROPERTY_RESERVED_0E); - CASE_RETURN_TEXT(BT_PROPERTY_RESERVED_0F); - CASE_RETURN_TEXT(BT_PROPERTY_RESERVED_0x14); - } - return base::StringPrintf("Unknown [%d]", (int)type); -} - -std::string bt_property_text(const bt_property_t& property) { - switch (property.type) { - case BT_PROPERTY_BDNAME: - return base::StringPrintf("type:%s name:%s", bt_property_type_text(property.type).c_str(), - (const char*)property.val); - case BT_PROPERTY_BDADDR: - return base::StringPrintf("type:%s addr:%s", bt_property_type_text(property.type).c_str(), - ((const RawAddress*)property.val)->ToString().c_str()); - case BT_PROPERTY_UUIDS: { - std::ostringstream oss; - const bluetooth::Uuid* it = (const bluetooth::Uuid*)property.val; - for (size_t i = 0; i < (size_t)property.len; i += sizeof(bluetooth::Uuid), it++) { - (i == 0) ? oss << *it : oss << " " << *it; - } - return base::StringPrintf("type:%s uuids:%s", bt_property_type_text(property.type).c_str(), - oss.str().c_str()); - } - case BT_PROPERTY_CLASS_OF_DEVICE: - return base::StringPrintf("type:%s cod:0x%x", bt_property_type_text(property.type).c_str(), - *(uint32_t*)(property.val)); - - case BT_PROPERTY_TYPE_OF_DEVICE: - return base::StringPrintf("type:%s type_of_device:%d", - bt_property_type_text(property.type).c_str(), - *(uint32_t*)(property.val)); - - case BT_PROPERTY_SERVICE_RECORD: - return base::StringPrintf("type:%s uuid:%s channel:%u name:\"%s\"", - bt_property_type_text(property.type).c_str(), - (((bt_service_record_t*)property.val)->uuid).ToString().c_str(), - (((bt_service_record_t*)property.val)->channel), - (((bt_service_record_t*)property.val)->name)); - - case BT_PROPERTY_ADAPTER_BONDED_DEVICES: { - std::ostringstream oss; - const RawAddress* it = (const RawAddress*)property.val; - for (size_t i = 0; i < (size_t)property.len; i += sizeof(RawAddress), it++) { - (i == 0) ? oss << *it : oss << " " << *it; - } - return base::StringPrintf("type:%s addrs:%s", bt_property_type_text(property.type).c_str(), - oss.str().c_str()); - } - case BT_PROPERTY_ADAPTER_DISCOVERABLE_TIMEOUT: - return base::StringPrintf("type:%s discoverable_timeout:%u", - bt_property_type_text(property.type).c_str(), - *((uint32_t*)property.val)); - - case BT_PROPERTY_REMOTE_FRIENDLY_NAME: - return base::StringPrintf("type:%s remote_friendly_name:%s", - bt_property_type_text(property.type).c_str(), - (uint8_t*)property.val); - - case BT_PROPERTY_REMOTE_RSSI: - return base::StringPrintf("type:%s rssi:%hhd", bt_property_type_text(property.type).c_str(), - *(int8_t*)property.val); - - case BT_PROPERTY_REMOTE_VERSION_INFO: - return base::StringPrintf("type:%s version:%d sub:%d mfr:%d", - bt_property_type_text(property.type).c_str(), - ((bt_remote_version_t*)property.val)->version, - ((bt_remote_version_t*)property.val)->sub_ver, - ((bt_remote_version_t*)property.val)->manufacturer); - - case BT_PROPERTY_LOCAL_LE_FEATURES: - return base::StringPrintf( - "type:%s version_supported:%d local_privacy_enabled:%d" - " max_adv_instance:%d rpa_offload_supported:%d max_irk_list_size:%d" - " max_adv_filter_supported:%d activity_energy_info_supported:%d" - " scan_result_storage_size:%d total_trackable_advertisers:%d" - " extended_scan_support:%d debug_logging_supported:%d le_2m_phy_supported:%d" - " le_coded_phy_supported:%d le_extended_advertising_supported:%d" - " le_periodic_advertising_supported:%d le_maximum_advertising_data_length:%d" - " dynamic_audio_buffer_supported:%d " - "le_periodic_advertising_sync_transfer_sender_supported:%d" - " le_connected_isochronous_stream_central_supported:%d " - "le_isochronous_broadcast_supported:%d" - " le_periodic_advertising_sync_transfer_recipient_supported:%d " - "adv_filter_extended_features_mask:%d" - "le_channel_sounding_supported:%d ", - bt_property_type_text(property.type).c_str(), - ((bt_local_le_features_t*)property.val)->version_supported, - ((bt_local_le_features_t*)property.val)->local_privacy_enabled, - ((bt_local_le_features_t*)property.val)->max_adv_instance, - ((bt_local_le_features_t*)property.val)->rpa_offload_supported, - ((bt_local_le_features_t*)property.val)->max_irk_list_size, - ((bt_local_le_features_t*)property.val)->max_adv_filter_supported, - ((bt_local_le_features_t*)property.val)->activity_energy_info_supported, - ((bt_local_le_features_t*)property.val)->scan_result_storage_size, - ((bt_local_le_features_t*)property.val)->total_trackable_advertisers, - ((bt_local_le_features_t*)property.val)->extended_scan_support, - ((bt_local_le_features_t*)property.val)->debug_logging_supported, - ((bt_local_le_features_t*)property.val)->le_2m_phy_supported, - ((bt_local_le_features_t*)property.val)->le_coded_phy_supported, - ((bt_local_le_features_t*)property.val)->le_extended_advertising_supported, - ((bt_local_le_features_t*)property.val)->le_periodic_advertising_supported, - ((bt_local_le_features_t*)property.val)->le_maximum_advertising_data_length, - ((bt_local_le_features_t*)property.val)->dynamic_audio_buffer_supported, - ((bt_local_le_features_t*)property.val) - ->le_periodic_advertising_sync_transfer_sender_supported, - ((bt_local_le_features_t*)property.val) - ->le_connected_isochronous_stream_central_supported, - ((bt_local_le_features_t*)property.val)->le_isochronous_broadcast_supported, - ((bt_local_le_features_t*)property.val) - ->le_periodic_advertising_sync_transfer_recipient_supported, - ((bt_local_le_features_t*)property.val)->adv_filter_extended_features_mask, - ((bt_local_le_features_t*)property.val)->le_channel_sounding_supported); - - case BT_PROPERTY_DYNAMIC_AUDIO_BUFFER: - return base::StringPrintf("type:%s", bt_property_type_text(property.type).c_str()); - - case BT_PROPERTY_REMOTE_IS_COORDINATED_SET_MEMBER: - return base::StringPrintf("type:%s is_coordinated_set_member:%s", - bt_property_type_text(property.type).c_str(), - (*(bool*)property.val) ? "true" : "false"); - - case BT_PROPERTY_APPEARANCE: - return base::StringPrintf("type:%s appearance:0x%x", - bt_property_type_text(property.type).c_str(), - (*(uint16_t*)property.val)); - - case BT_PROPERTY_VENDOR_PRODUCT_INFO: - return base::StringPrintf( - "type:%s vendor_id_src:%hhu vendor_id:%hu product_id:%hu version:%hu", - bt_property_type_text(property.type).c_str(), - ((bt_vendor_product_info_t*)property.val)->vendor_id_src, - ((bt_vendor_product_info_t*)property.val)->vendor_id, - ((bt_vendor_product_info_t*)property.val)->product_id, - ((bt_vendor_product_info_t*)property.val)->version); - - case BT_PROPERTY_REMOTE_ASHA_CAPABILITY: - return base::StringPrintf("type:%s remote_asha_capability:%hd", - bt_property_type_text(property.type).c_str(), - (*(int16_t*)property.val)); - - case BT_PROPERTY_REMOTE_ASHA_TRUNCATED_HISYNCID: - return base::StringPrintf("type:%s remote_asha_truncated_hisyncid:%u", - bt_property_type_text(property.type).c_str(), - (*(uint32_t*)property.val)); - - case BT_PROPERTY_REMOTE_MODEL_NUM: - return base::StringPrintf("type:%s remote_model_num:%s", - bt_property_type_text(property.type).c_str(), (char*)property.val); - - case BT_PROPERTY_REMOTE_ADDR_TYPE: - return base::StringPrintf("type:%s remote_asha_truncated_hisyncid:0x%x", - bt_property_type_text(property.type).c_str(), - (*(uint8_t*)property.val)); - - case BT_PROPERTY_REMOTE_DEVICE_TIMESTAMP: - return base::StringPrintf("type:%s", bt_property_type_text(property.type).c_str()); - - case BT_PROPERTY_REMOTE_SECURE_CONNECTIONS_SUPPORTED: - return base::StringPrintf("type:%s remote secure connections supported:%hhd", - bt_property_type_text(property.type).c_str(), - (*(uint8_t*)property.val)); - - case BT_PROPERTY_REMOTE_MAX_SESSION_KEY_SIZE: - return base::StringPrintf("type:%s remote max session key size:%hhd", - bt_property_type_text(property.type).c_str(), - (*(uint8_t*)property.val)); - - case BT_PROPERTY_RESERVED_07: - case BT_PROPERTY_RESERVED_0E: - case BT_PROPERTY_RESERVED_0F: - case BT_PROPERTY_RESERVED_0x14: - return base::StringPrintf("type:%s", bt_property_type_text(property.type).c_str()); - } - return std::string("Unknown"); -} - -namespace bluetooth::property { - -BtPropertyLegacy::BtPropertyLegacy(const std::vector<std::shared_ptr<BtProperty>>& bt_properties) - : bt_properties_(bt_properties) { - properties_.resize(bt_properties.size()); - std::vector<bt_property_t>::iterator it = properties_.begin(); - for (const auto& p : bt_properties) { - *it++ = { - .type = p->Type(), - .len = (int)p->Size(), - .val = (void*)p->Val(), - }; - } -} - -void BtPropertyLegacy::Export(bt_property_t* bt_properties, size_t size) { - log::assert_that(bt_properties != nullptr, "assert failed: bt_properties != nullptr"); - log::assert_that(size >= properties_.size(), "assert failed: size >= properties_.size()"); - - for (const auto& p : bt_properties_) { - *bt_properties++ = { - .type = p->Type(), - .len = (int)p->Size(), - .val = (void*)p->Val(), - }; - } -} - -size_t BtPropertyLegacy::NumProperties() const { return properties_.size(); } - -const std::vector<bt_property_t>& BtPropertyLegacy::Properties() const { return properties_; } - -std::shared_ptr<BdName> BdName::Create(const BD_NAME bd_name) { - return std::make_shared<BdName>(BdName(bd_name)); -} -std::shared_ptr<BdAddr> BdAddr::Create(const RawAddress& bd_addr) { - return std::make_shared<BdAddr>(BdAddr(bd_addr)); -} -std::shared_ptr<Uuids> Uuids::Create(const std::vector<bluetooth::Uuid>& uuids) { - return std::make_shared<Uuids>(Uuids(uuids)); -} -std::shared_ptr<ClassOfDevice> ClassOfDevice::Create(const uint32_t& cod) { - return std::make_shared<ClassOfDevice>(ClassOfDevice(cod)); -} -std::shared_ptr<TypeOfDevice> TypeOfDevice::Create(const bt_device_type_t& type) { - return std::make_shared<TypeOfDevice>(TypeOfDevice(type)); -} -std::shared_ptr<ServiceRecord> ServiceRecord::Create(const bt_service_record_t& record) { - return std::make_shared<ServiceRecord>(ServiceRecord(record)); -} -std::shared_ptr<AdapterBondedDevices> AdapterBondedDevices::Create(const RawAddress* bd_addr, - size_t len) { - log::assert_that(bd_addr != nullptr, "assert failed: bd_addr != nullptr"); - return std::make_shared<AdapterBondedDevices>(AdapterBondedDevices(bd_addr, len)); -} -std::shared_ptr<AdapterDiscoverableTimeout> AdapterDiscoverableTimeout::Create( - const uint32_t& timeout) { - return std::make_shared<AdapterDiscoverableTimeout>(AdapterDiscoverableTimeout(timeout)); -} -std::shared_ptr<RemoteFriendlyName> RemoteFriendlyName::Create(const uint8_t bd_name[], - size_t len) { - return std::make_shared<RemoteFriendlyName>(RemoteFriendlyName(bd_name, len)); -} -std::shared_ptr<RemoteRSSI> RemoteRSSI::Create(const int8_t& rssi) { - return std::make_shared<RemoteRSSI>(RemoteRSSI(rssi)); -} -std::shared_ptr<RemoteVersionInfo> RemoteVersionInfo::Create(const bt_remote_version_t& info) { - return std::make_shared<RemoteVersionInfo>(RemoteVersionInfo(info)); -} -std::shared_ptr<LocalLeFeatures> LocalLeFeatures::Create(const bt_local_le_features_t& features) { - return std::make_shared<LocalLeFeatures>(LocalLeFeatures(features)); -} -std::shared_ptr<RemoteIsCoordinatedSetMember> RemoteIsCoordinatedSetMember::Create( - const bool& is_set_member) { - return std::make_shared<RemoteIsCoordinatedSetMember>( - RemoteIsCoordinatedSetMember(is_set_member)); -} -std::shared_ptr<Appearance> Appearance::Create(const uint16_t& appearance) { - return std::make_shared<Appearance>(Appearance(appearance)); -} -std::shared_ptr<VendorProductInfo> VendorProductInfo::Create(const bt_vendor_product_info_t& info) { - return std::make_shared<VendorProductInfo>(VendorProductInfo(info)); -} -std::shared_ptr<RemoteASHACapability> RemoteASHACapability::Create(const int16_t& capability) { - return std::make_shared<RemoteASHACapability>(RemoteASHACapability(capability)); -} -std::shared_ptr<RemoteASHATruncatedHiSyncId> RemoteASHATruncatedHiSyncId::Create( - const uint32_t& id) { - return std::make_shared<RemoteASHATruncatedHiSyncId>(RemoteASHATruncatedHiSyncId(id)); -} -std::shared_ptr<RemoteModelNum> RemoteModelNum::Create(const bt_bdname_t& name) { - return std::make_shared<RemoteModelNum>(RemoteModelNum(name)); -} -std::shared_ptr<RemoteAddrType> RemoteAddrType::Create(const uint8_t& addr) { - return std::make_shared<RemoteAddrType>(RemoteAddrType(addr)); -} -std::shared_ptr<RemoteDeviceTimestamp> RemoteDeviceTimestamp::Create(const int& timestamp) { - return std::make_shared<RemoteDeviceTimestamp>(RemoteDeviceTimestamp(timestamp)); -} - -} // namespace bluetooth::property diff --git a/system/gd/discovery/device/bt_property.h b/system/gd/discovery/device/bt_property.h deleted file mode 100644 index 0ed94d98af..0000000000 --- a/system/gd/discovery/device/bt_property.h +++ /dev/null @@ -1,275 +0,0 @@ -/* - * Copyright 2024 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include <memory> -#include <string> -#include <vector> - -#include "hardware/bluetooth.h" -#include "include/hardware/bluetooth.h" -#include "stack/include/bt_name.h" - -std::string bt_property_text(const bt_property_t& property); -std::string bt_property_type_text(const bt_property_type_t& type); - -namespace bluetooth { -namespace property { - -class BtProperty { -public: - // Return size in bytes of property data value - virtual size_t Size() const = 0; - // Returns raw pointer to the data value - virtual const void* Val() const = 0; - - bt_property_type_t Type() const { return type_; } - - std::string ToString() const { return bt_property_type_text(type_); } - -protected: - BtProperty(bt_property_type_t type) : type_(type) {} - virtual ~BtProperty() = default; - -private: - const bt_property_type_t type_; -}; - -// Provide pointer/size access to properties for legacy jni API -class BtPropertyLegacy { -public: - BtPropertyLegacy(const std::vector<std::shared_ptr<BtProperty>>& bt_properties); - - void Export(bt_property_t* bt_properties, size_t size); - - size_t NumProperties() const; - - const std::vector<bt_property_t>& Properties() const; - - bt_property_t* Ptr() const { return const_cast<bt_property_t*>(&properties_[0]); } - int Len() const { return static_cast<int>(properties_.size()); } - -private: - const std::vector<std::shared_ptr<BtProperty>> bt_properties_; - std::vector<bt_property_t> properties_; -}; - -template <typename T> -class BtPropertySimple : public BtProperty { -public: - virtual size_t Size() const override { return sizeof(T); } - - const void* Val() const override { return (const void*)val_.get(); } - -protected: - BtPropertySimple<T>(bt_property_type_t type, T val) - : BtProperty(type), val_(std::make_shared<T>(val)) {} - -private: - std::shared_ptr<T> val_; -}; - -template <typename T> -class BtPropertyVector : public BtProperty { -public: - virtual size_t Size() const override { return sizeof(T) * val_->size(); } - const void* Val() const override { return (const void*)&(*val_)[0]; } - -protected: - // Create a vector property from another vector - BtPropertyVector<T>(bt_property_type_t type, const std::vector<T>& val) - : BtProperty(type), val_(std::make_shared<std::vector<T>>(val)) {} - - // Create a vector property from a raw pointer and size - BtPropertyVector<T>(bt_property_type_t type, const T* val, size_t size) - : BtProperty(type), val_(std::make_shared<std::vector<T>>(val, val + size)) {} - -protected: - std::shared_ptr<std::vector<T>> val_; -}; - -template <typename T> -class BtPropertyVectorWithPad : public BtPropertyVector<T> { -protected: - // Create a vector property from a raw pointer and size with pad element - BtPropertyVectorWithPad<T>(bt_property_type_t type, const T* val, size_t size, T pad) - : BtPropertyVector<T>(type, val, size) { - BtPropertyVector<T>::val_->push_back(pad); - } -}; - -class BdName : public BtPropertyVectorWithPad<uint8_t> { -public: - BdName(const BD_NAME bd_name) - : BtPropertyVectorWithPad<uint8_t>(BT_PROPERTY_BDNAME, bd_name, kBdNameLength, kBdNameDelim) { - } - - static std::shared_ptr<BdName> Create(const BD_NAME bd_name); -}; - -class BdAddr : public BtPropertySimple<RawAddress> { -public: - BdAddr(const RawAddress& bd_addr) : BtPropertySimple<RawAddress>(BT_PROPERTY_BDADDR, bd_addr) {} - - static std::shared_ptr<BdAddr> Create(const RawAddress& bd_addr); -}; - -class Uuids : public BtPropertyVector<bluetooth::Uuid> { -public: - Uuids(const std::vector<bluetooth::Uuid>& uuids) - : BtPropertyVector<bluetooth::Uuid>(BT_PROPERTY_UUIDS, uuids) {} - - static std::shared_ptr<Uuids> Create(const std::vector<bluetooth::Uuid>& uuids); -}; - -class ClassOfDevice : public BtPropertySimple<uint32_t> { -public: - ClassOfDevice(const uint32_t& cod) - : BtPropertySimple<uint32_t>(BT_PROPERTY_CLASS_OF_DEVICE, cod) {} - static std::shared_ptr<ClassOfDevice> Create(const uint32_t& bd_addr); -}; - -class TypeOfDevice : public BtPropertySimple<bt_device_type_t> { -public: - TypeOfDevice(const bt_device_type_t& device_type) - : BtPropertySimple<bt_device_type_t>(BT_PROPERTY_TYPE_OF_DEVICE, device_type) {} - static std::shared_ptr<TypeOfDevice> Create(const bt_device_type_t& device_type); -}; - -class ServiceRecord : public BtPropertySimple<bt_service_record_t> { -public: - ServiceRecord(const bt_service_record_t& record) - : BtPropertySimple<bt_service_record_t>(BT_PROPERTY_SERVICE_RECORD, record) {} - static std::shared_ptr<ServiceRecord> Create(const bt_service_record_t& record); -}; - -class AdapterBondedDevices : public BtPropertyVector<RawAddress> { -public: - AdapterBondedDevices(const RawAddress* bd_addr, size_t len) - : BtPropertyVector<RawAddress>(BT_PROPERTY_ADAPTER_BONDED_DEVICES, bd_addr, len) {} - - static std::shared_ptr<AdapterBondedDevices> Create(const RawAddress* bd_addr, size_t len); -}; - -class AdapterDiscoverableTimeout : public BtPropertySimple<uint32_t> { -public: - AdapterDiscoverableTimeout(const uint32_t& timeout) - : BtPropertySimple<uint32_t>(BT_PROPERTY_ADAPTER_DISCOVERABLE_TIMEOUT, timeout) {} - - static std::shared_ptr<AdapterDiscoverableTimeout> Create(const uint32_t& timeout); -}; - -class RemoteFriendlyName : public BtPropertyVectorWithPad<uint8_t> { -public: - RemoteFriendlyName(const uint8_t bd_name[], size_t len) - : BtPropertyVectorWithPad<uint8_t>(BT_PROPERTY_REMOTE_FRIENDLY_NAME, bd_name, len, - kBdNameDelim) {} - - static std::shared_ptr<RemoteFriendlyName> Create(const uint8_t bd_name[], size_t len); -}; - -class RemoteRSSI : public BtPropertySimple<int8_t> { -public: - RemoteRSSI(const int8_t& rssi) : BtPropertySimple<int8_t>(BT_PROPERTY_REMOTE_RSSI, rssi) {} - - static std::shared_ptr<RemoteRSSI> Create(const int8_t& rssi); -}; - -class RemoteVersionInfo : public BtPropertySimple<bt_remote_version_t> { -public: - RemoteVersionInfo(const bt_remote_version_t& info) - : BtPropertySimple<bt_remote_version_t>(BT_PROPERTY_REMOTE_VERSION_INFO, info) {} - - static std::shared_ptr<RemoteVersionInfo> Create(const bt_remote_version_t& info); -}; - -class LocalLeFeatures : public BtPropertySimple<bt_local_le_features_t> { -public: - LocalLeFeatures(const bt_local_le_features_t& features) - : BtPropertySimple<bt_local_le_features_t>(BT_PROPERTY_LOCAL_LE_FEATURES, features) {} - - static std::shared_ptr<LocalLeFeatures> Create(const bt_local_le_features_t& features); -}; - -class RemoteIsCoordinatedSetMember : public BtPropertySimple<bool> { -public: - RemoteIsCoordinatedSetMember(const bool& is_set_member) - : BtPropertySimple<bool>(BT_PROPERTY_REMOTE_IS_COORDINATED_SET_MEMBER, is_set_member) {} - - static std::shared_ptr<RemoteIsCoordinatedSetMember> Create(const bool& is_set_member); -}; - -class Appearance : public BtPropertySimple<uint16_t> { -public: - Appearance(const uint16_t& appearance) - : BtPropertySimple<uint16_t>(BT_PROPERTY_APPEARANCE, appearance) {} - - static std::shared_ptr<Appearance> Create(const uint16_t& appearance); -}; - -class VendorProductInfo : public BtPropertySimple<bt_vendor_product_info_t> { -public: - VendorProductInfo(const bt_vendor_product_info_t& info) - : BtPropertySimple<bt_vendor_product_info_t>(BT_PROPERTY_VENDOR_PRODUCT_INFO, info) {} - - static std::shared_ptr<VendorProductInfo> Create(const bt_vendor_product_info_t& info); -}; - -class RemoteASHACapability : public BtPropertySimple<int16_t> { -public: - RemoteASHACapability(const int16_t capability) - : BtPropertySimple<int16_t>(BT_PROPERTY_REMOTE_ASHA_CAPABILITY, capability) {} - - static std::shared_ptr<RemoteASHACapability> Create(const int16_t& capability); -}; - -class RemoteASHATruncatedHiSyncId : public BtPropertySimple<uint32_t> { -public: - RemoteASHATruncatedHiSyncId(const uint32_t id) - : BtPropertySimple<uint32_t>(BT_PROPERTY_REMOTE_ASHA_TRUNCATED_HISYNCID, id) {} - - static std::shared_ptr<RemoteASHATruncatedHiSyncId> Create(const uint32_t& id); -}; - -class RemoteModelNum : public BtPropertyVectorWithPad<uint8_t> { -public: - RemoteModelNum(const bt_bdname_t& name) - : BtPropertyVectorWithPad<uint8_t>(BT_PROPERTY_REMOTE_MODEL_NUM, name.name, - sizeof(bt_bdname_t) - sizeof(kBdNameDelim), kBdNameDelim) { - } - - static std::shared_ptr<RemoteModelNum> Create(const bt_bdname_t& name); -}; - -class RemoteAddrType : public BtPropertySimple<uint8_t> { -public: - RemoteAddrType(const uint8_t& type) - : BtPropertySimple<uint8_t>(BT_PROPERTY_REMOTE_ADDR_TYPE, type) {} - - static std::shared_ptr<RemoteAddrType> Create(const uint8_t& type); -}; - -class RemoteDeviceTimestamp : public BtPropertySimple<int> { -public: - RemoteDeviceTimestamp(const int& timestamp) - : BtPropertySimple<int>(BT_PROPERTY_REMOTE_DEVICE_TIMESTAMP, timestamp) {} - - static std::shared_ptr<RemoteDeviceTimestamp> Create(const int& timestamp); -}; - -} // namespace property -} // namespace bluetooth diff --git a/system/gd/discovery/device/bt_property_unittest.cc b/system/gd/discovery/device/bt_property_unittest.cc deleted file mode 100644 index 557e018199..0000000000 --- a/system/gd/discovery/device/bt_property_unittest.cc +++ /dev/null @@ -1,843 +0,0 @@ -/* - * Copyright 2024 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "discovery/device/bt_property.h" - -#include <cstdint> -#include <future> - -#include "gtest/gtest.h" -#include "hardware/bluetooth.h" -#include "os/log.h" -#include "stack/include/bt_name.h" - -using namespace bluetooth::property; - -namespace { - -constexpr size_t kNumberTestedProperties = 20; - -constexpr size_t kBdPropNameLength = kBdNameLength + sizeof(kBdNameDelim); - -constexpr uint8_t kReallyLongName[kBdPropNameLength] = - "aaaaaaaaaAaaaaaaaaaAaaaaaaaaaAaaaaaaaaaAaaaaaaaaaAaaaaaaaaaAaaaaaaaaaAaaaaaaaaaAaaaaaaaaaA" - "aaaa" - "aaaaaAaaaaaaaaaAaaaaaaaaaAaaaaaaaaaAaaaaaaaaaAaaaaaaaaaAaaaaaaaaaAaaaaaaaaaAaaaaaaaaaAaaaa" - "aaaa" - "aAaaaaaaaaaAaaaaaaaaaAaaaaaaaaaAaaaaaaaaaAaaaaaaaaaAaaaaaaaa"; - -// BT_PROPERTY_BDNAME -constexpr BD_NAME kBdName{'k', 'B', 'd', 'N', 'a', 'm', 'e', '\0'}; - -// BT_PROPERTY_BDADDR -const RawAddress kRawAddress{{0x11, 0x22, 0x33, 0x44, 0x55, 0x66}}; - -// BT_PROPERTY_UUIDS -const bluetooth::Uuid uuids[] = { - {bluetooth::Uuid::FromString("00000001-1001-1000-8000-00805f9b34fb")}, - {bluetooth::Uuid::FromString("00000001-1002-1000-8000-00805f9b34fb")}, - {bluetooth::Uuid::FromString("00000001-1003-1000-8000-00805f9b34fb")}, -}; -const std::vector<bluetooth::Uuid> kUuids(uuids, uuids + sizeof(uuids) / sizeof(uuids[0])); - -// BT_PROPERTY_CLASS_OF_DEVICE -constexpr uint32_t kClassOfDevice{0x99663300}; - -// BT_PROPERTY_TYPE_OF_DEVICE -constexpr bt_device_type_t kTypeOfDevice{BT_DEVICE_DEVTYPE_BREDR}; - -// BT_PROPERTY_SERVICE_RECORD -const bt_service_record_t kServiceRecord{ - .uuid = uuids[0], - .channel = 0x1234, - .name = {'k', 'S', 'e', 'r', 'v', 'i', 'c', 'e', 'R', 'e', - 'c', 'o', 'r', 'd', '.', 'n', 'a', 'm', 'e', '\0'}, -}; - -// BT_PROPERTY_ADAPTER_BONDED_DEVICES -const RawAddress kAdapterBondedDevices[] = { - {{0x11, 0x22, 0x33, 0x44, 0x55}}, {{0x12, 0x22, 0x33, 0x44, 0x55}}, - {{0x13, 0x22, 0x33, 0x44, 0x55}}, {{0x14, 0x22, 0x33, 0x44, 0x55}}, - {{0x15, 0x22, 0x33, 0x44, 0x55}}, -}; -constexpr size_t kNumBondedDevices = - sizeof(kAdapterBondedDevices) / sizeof(kAdapterBondedDevices[0]); - -// BT_PROPERTY_ADAPTER_DISCOVERABLE_TIMEOUT -constexpr uint32_t kAdapterDiscoverableTimeout{0x4488cc00}; - -// BT_PROPERTY_REMOTE_FRIENDLY_NAME -const uint8_t kRemoteFriendlyName[] = {'k', 'R', 'e', 'm', 'o', 't', 'e', 'F', 'r', 'i', - 'e', 'n', 'd', 'l', 'y', 'N', 'a', 'm', 'e', '\0'}; - -// BT_PROPERTY_REMOTE_RSSI -constexpr int8_t kRemoteRssi{0x10}; - -// BT_PROPERTY_REMOTE_VERSION_INFO -bt_remote_version_t kRemoteVersionInfo{ - .version = 1, - .sub_ver = 2, - .manufacturer = 3, -}; - -// BT_PROPERTY_LOCAL_LE_FEATURES -constexpr bt_local_le_features_t kLocalLeFeatures{ - .version_supported = 0x1234, - .local_privacy_enabled = 0x11, - .max_adv_instance = 0x22, - .rpa_offload_supported = 0x33, - .max_irk_list_size = 0x44, - .max_adv_filter_supported = 0x55, - .activity_energy_info_supported = 0x66, - .scan_result_storage_size = 0x5678, - .total_trackable_advertisers = 0x9abc, - .extended_scan_support = true, - .debug_logging_supported = true, - .le_2m_phy_supported = true, - .le_coded_phy_supported = true, - .le_extended_advertising_supported = true, - .le_periodic_advertising_supported = true, - .le_maximum_advertising_data_length = 0x1357, - .dynamic_audio_buffer_supported = 0x22446688, - .le_periodic_advertising_sync_transfer_sender_supported = true, - .le_connected_isochronous_stream_central_supported = true, - .le_isochronous_broadcast_supported = true, - .le_periodic_advertising_sync_transfer_recipient_supported = true, - .adv_filter_extended_features_mask = 0x3366, - .le_channel_sounding_supported = true, -}; - -// BT_PROPERTY_RESERVED_0F -// BT_PROPERTY_DYNAMIC_AUDIO_BUFFER - -// BT_PROPERTY_REMOTE_IS_COORDINATED_SET_MEMBER -constexpr bool kRemoteIsCoordinatedSetMember{true}; - -// BT_PROPERTY_APPEARANCE -constexpr uint16_t kAppearance{0x44}; - -// BT_PROPERTY_VENDOR_PRODUCT_INFO -constexpr bt_vendor_product_info_t kVendorProductInfo{ - .vendor_id_src = 0x02, - .vendor_id = 0x1235, - .product_id = 0x5679, - .version = 0x9abd, -}; - -// BT_PROPERTY_REMOTE_ASHA_CAPABILITY -constexpr int16_t kRemoteAshaCapability{0x89}; - -// BT_PROPERTY_REMOTE_ASHA_TRUNCATED_HISYNCID -constexpr uint32_t kRemoteAshaTruncatedHisyncId{0x22446688}; - -// BT_PROPERTY_REMOTE_MODEL_NUM -constexpr bt_bdname_t kRemoteModelNum{ - .name = {'k', 'R', 'e', 'm', 'o', 't', 'e', 'M', 'o', 'd', 'e', 'l', 'N', 'u', 'm', '\0'}, -}; - -// BT_PROPERTY_REMOTE_ADDR_TYPE -constexpr uint8_t kRemoteAddrType{0x55}; - -// BT_PROPERTY_REMOTE_DEVICE_TIMESTAMP -constexpr int kRemoteDeviceTimestamp{0x12345678}; - -// Fill the given property type with the well known property data set -void fill_property(const bt_property_type_t& type, - std::vector<std::shared_ptr<BtProperty>>& properties) { - switch (type) { - case BT_PROPERTY_BDNAME: { - properties.push_back(BdName::Create(kBdName)); - ASSERT_EQ(kBdPropNameLength, properties.back()->Size()); - } break; - - case BT_PROPERTY_BDADDR: - properties.push_back(BdAddr::Create(kRawAddress)); - ASSERT_EQ(sizeof(RawAddress), properties.back()->Size()); - break; - - case BT_PROPERTY_UUIDS: { - properties.push_back(Uuids::Create(kUuids)); - ASSERT_EQ(sizeof(bluetooth::Uuid) * kUuids.size(), properties.back()->Size()); - } break; - - case BT_PROPERTY_CLASS_OF_DEVICE: - properties.push_back(ClassOfDevice::Create(kClassOfDevice)); - ASSERT_EQ(sizeof(uint32_t), properties.back()->Size()); - break; - - case BT_PROPERTY_TYPE_OF_DEVICE: - properties.push_back(TypeOfDevice::Create(kTypeOfDevice)); - ASSERT_EQ(sizeof(bt_device_type_t), properties.back()->Size()); - break; - - case BT_PROPERTY_SERVICE_RECORD: - properties.push_back(ServiceRecord::Create(kServiceRecord)); - ASSERT_EQ(sizeof(bt_service_record_t), properties.back()->Size()); - break; - - case BT_PROPERTY_ADAPTER_BONDED_DEVICES: { - properties.push_back(AdapterBondedDevices::Create(kAdapterBondedDevices, kNumBondedDevices)); - ASSERT_EQ(sizeof(RawAddress) * kNumBondedDevices, properties.back()->Size()); - } break; - - case BT_PROPERTY_ADAPTER_DISCOVERABLE_TIMEOUT: - properties.push_back(AdapterDiscoverableTimeout::Create(kAdapterDiscoverableTimeout)); - ASSERT_EQ(sizeof(uint32_t), properties.back()->Size()); - break; - - case BT_PROPERTY_REMOTE_FRIENDLY_NAME: { - properties.push_back( - RemoteFriendlyName::Create(kRemoteFriendlyName, sizeof(kRemoteFriendlyName))); - ASSERT_EQ(sizeof(kRemoteFriendlyName) + sizeof(kBdNameDelim), properties.back()->Size()); - } break; - - case BT_PROPERTY_REMOTE_RSSI: - properties.push_back(RemoteRSSI::Create(kRemoteRssi)); - ASSERT_EQ(sizeof(int8_t), properties.back()->Size()); - break; - - case BT_PROPERTY_REMOTE_VERSION_INFO: - properties.push_back(RemoteVersionInfo::Create(kRemoteVersionInfo)); - ASSERT_EQ(sizeof(bt_remote_version_t), properties.back()->Size()); - break; - - case BT_PROPERTY_LOCAL_LE_FEATURES: - properties.push_back(LocalLeFeatures::Create(kLocalLeFeatures)); - ASSERT_EQ(sizeof(kLocalLeFeatures), properties.back()->Size()); - break; - - case BT_PROPERTY_RESERVED_0E: - case BT_PROPERTY_RESERVED_0F: - case BT_PROPERTY_DYNAMIC_AUDIO_BUFFER: - break; - - case BT_PROPERTY_REMOTE_IS_COORDINATED_SET_MEMBER: - properties.push_back(RemoteIsCoordinatedSetMember::Create(kRemoteIsCoordinatedSetMember)); - ASSERT_EQ(sizeof(kRemoteIsCoordinatedSetMember), properties.back()->Size()); - break; - - case BT_PROPERTY_APPEARANCE: - properties.push_back(Appearance::Create(kAppearance)); - ASSERT_EQ(sizeof(kAppearance), properties.back()->Size()); - break; - - case BT_PROPERTY_VENDOR_PRODUCT_INFO: - properties.push_back(VendorProductInfo::Create(kVendorProductInfo)); - ASSERT_EQ(sizeof(kVendorProductInfo), properties.back()->Size()); - break; - - case BT_PROPERTY_REMOTE_ASHA_CAPABILITY: - properties.push_back(RemoteASHACapability::Create(kRemoteAshaCapability)); - ASSERT_EQ(sizeof(kRemoteAshaCapability), properties.back()->Size()); - break; - - case BT_PROPERTY_REMOTE_ASHA_TRUNCATED_HISYNCID: - properties.push_back(RemoteASHATruncatedHiSyncId::Create(kRemoteAshaTruncatedHisyncId)); - ASSERT_EQ(sizeof(kRemoteAshaTruncatedHisyncId), properties.back()->Size()); - break; - - case BT_PROPERTY_REMOTE_MODEL_NUM: { - properties.push_back(RemoteModelNum::Create(kRemoteModelNum)); - ASSERT_EQ(sizeof(kRemoteModelNum), properties.back()->Size()); - } break; - - case BT_PROPERTY_REMOTE_ADDR_TYPE: - properties.push_back(RemoteAddrType::Create(kRemoteAddrType)); - ASSERT_EQ(sizeof(kRemoteAddrType), properties.back()->Size()); - break; - - case BT_PROPERTY_REMOTE_DEVICE_TIMESTAMP: - properties.push_back(RemoteDeviceTimestamp::Create(kRemoteDeviceTimestamp)); - ASSERT_EQ(sizeof(kRemoteDeviceTimestamp), properties.back()->Size()); - break; - - default: - FAIL() << "Illegal property type:" << type; - break; - } -} - -// Verify the given property type with the well known property data set -void verify_property(const bt_property_type_t& type, const bt_property_t& property) { - ASSERT_EQ(type, property.type); - switch (property.type) { - case BT_PROPERTY_BDNAME: - ASSERT_EQ((int)kBdPropNameLength, property.len); - ASSERT_STREQ((const char*)kBdName, (const char*)property.val); - break; - - case BT_PROPERTY_BDADDR: - ASSERT_EQ((int)sizeof(RawAddress), property.len); - ASSERT_EQ(kRawAddress, *((RawAddress*)property.val)); - break; - - case BT_PROPERTY_UUIDS: { - ASSERT_EQ((int)(sizeof(bluetooth::Uuid) * kUuids.size()), property.len); - const bluetooth::Uuid* uuid = (const bluetooth::Uuid*)property.val; - ASSERT_EQ(uuids[0], *uuid++); - ASSERT_EQ(uuids[1], *uuid++); - ASSERT_EQ(uuids[2], *uuid++); - } break; - - case BT_PROPERTY_CLASS_OF_DEVICE: - ASSERT_EQ((int)sizeof(uint32_t), property.len); - ASSERT_EQ(kClassOfDevice, *((uint32_t*)property.val)); - break; - - case BT_PROPERTY_TYPE_OF_DEVICE: - ASSERT_EQ((int)sizeof(uint32_t), property.len); - ASSERT_EQ(kTypeOfDevice, *((uint32_t*)property.val)); - break; - - case BT_PROPERTY_SERVICE_RECORD: - ASSERT_EQ((int)sizeof(bt_service_record_t), property.len); - ASSERT_EQ(kServiceRecord.uuid, ((bt_service_record_t*)property.val)->uuid); - ASSERT_EQ(kServiceRecord.channel, ((bt_service_record_t*)property.val)->channel); - ASSERT_STREQ(kServiceRecord.name, ((bt_service_record_t*)property.val)->name); - break; - - case BT_PROPERTY_ADAPTER_BONDED_DEVICES: { - ASSERT_EQ((int)sizeof(kAdapterBondedDevices), property.len); - const RawAddress* raw_address = static_cast<RawAddress*>(property.val); - for (size_t i = 0; i < kNumBondedDevices; i++, raw_address++) { - ASSERT_EQ(kAdapterBondedDevices[i], *raw_address); - } - } break; - - case BT_PROPERTY_ADAPTER_DISCOVERABLE_TIMEOUT: - ASSERT_EQ((int)sizeof(uint32_t), property.len); - ASSERT_EQ(kAdapterDiscoverableTimeout, *((uint32_t*)property.val)); - break; - - case BT_PROPERTY_REMOTE_FRIENDLY_NAME: - ASSERT_EQ((int)(sizeof(kRemoteFriendlyName) + sizeof(kBdNameDelim)), property.len); - ASSERT_STREQ((const char*)kRemoteFriendlyName, (const char*)property.val); - break; - - case BT_PROPERTY_REMOTE_RSSI: - ASSERT_EQ((int)sizeof(int8_t), property.len); - ASSERT_EQ(kRemoteRssi, *((int8_t*)property.val)); - break; - - case BT_PROPERTY_REMOTE_VERSION_INFO: - ASSERT_EQ((int)sizeof(bt_remote_version_t), property.len); - ASSERT_EQ(kRemoteVersionInfo.version, ((bt_remote_version_t*)property.val)->version); - ASSERT_EQ(kRemoteVersionInfo.sub_ver, ((bt_remote_version_t*)property.val)->sub_ver); - ASSERT_EQ(kRemoteVersionInfo.manufacturer, - ((bt_remote_version_t*)property.val)->manufacturer); - break; - - case BT_PROPERTY_LOCAL_LE_FEATURES: - ASSERT_EQ((int)sizeof(bt_local_le_features_t), property.len); - ASSERT_EQ(kLocalLeFeatures.version_supported, - ((bt_local_le_features_t*)property.val)->version_supported); - ASSERT_EQ(kLocalLeFeatures.local_privacy_enabled, - ((bt_local_le_features_t*)property.val)->local_privacy_enabled); - ASSERT_EQ(kLocalLeFeatures.local_privacy_enabled, - ((bt_local_le_features_t*)property.val)->local_privacy_enabled); - ASSERT_EQ(kLocalLeFeatures.max_adv_instance, - ((bt_local_le_features_t*)property.val)->max_adv_instance); - ASSERT_EQ(kLocalLeFeatures.rpa_offload_supported, - ((bt_local_le_features_t*)property.val)->rpa_offload_supported); - ASSERT_EQ(kLocalLeFeatures.max_irk_list_size, - ((bt_local_le_features_t*)property.val)->max_irk_list_size); - ASSERT_EQ(kLocalLeFeatures.max_adv_filter_supported, - ((bt_local_le_features_t*)property.val)->max_adv_filter_supported); - ASSERT_EQ(kLocalLeFeatures.activity_energy_info_supported, - ((bt_local_le_features_t*)property.val)->activity_energy_info_supported); - ASSERT_EQ(kLocalLeFeatures.scan_result_storage_size, - ((bt_local_le_features_t*)property.val)->scan_result_storage_size); - ASSERT_EQ(kLocalLeFeatures.total_trackable_advertisers, - ((bt_local_le_features_t*)property.val)->total_trackable_advertisers); - ASSERT_EQ(kLocalLeFeatures.extended_scan_support, - ((bt_local_le_features_t*)property.val)->extended_scan_support); - ASSERT_EQ(kLocalLeFeatures.debug_logging_supported, - ((bt_local_le_features_t*)property.val)->debug_logging_supported); - ASSERT_EQ(kLocalLeFeatures.le_2m_phy_supported, - ((bt_local_le_features_t*)property.val)->le_2m_phy_supported); - ASSERT_EQ(kLocalLeFeatures.le_coded_phy_supported, - ((bt_local_le_features_t*)property.val)->le_coded_phy_supported); - ASSERT_EQ(kLocalLeFeatures.le_extended_advertising_supported, - ((bt_local_le_features_t*)property.val)->le_extended_advertising_supported); - ASSERT_EQ(kLocalLeFeatures.le_periodic_advertising_supported, - ((bt_local_le_features_t*)property.val)->le_periodic_advertising_supported); - ASSERT_EQ(kLocalLeFeatures.le_maximum_advertising_data_length, - ((bt_local_le_features_t*)property.val)->le_maximum_advertising_data_length); - ASSERT_EQ(kLocalLeFeatures.dynamic_audio_buffer_supported, - ((bt_local_le_features_t*)property.val)->dynamic_audio_buffer_supported); - ASSERT_EQ(kLocalLeFeatures.le_periodic_advertising_sync_transfer_sender_supported, - ((bt_local_le_features_t*)property.val) - ->le_periodic_advertising_sync_transfer_sender_supported); - ASSERT_EQ(kLocalLeFeatures.le_connected_isochronous_stream_central_supported, - ((bt_local_le_features_t*)property.val) - ->le_connected_isochronous_stream_central_supported); - ASSERT_EQ(kLocalLeFeatures.le_isochronous_broadcast_supported, - ((bt_local_le_features_t*)property.val)->le_isochronous_broadcast_supported); - ASSERT_EQ(kLocalLeFeatures.le_periodic_advertising_sync_transfer_recipient_supported, - ((bt_local_le_features_t*)property.val) - ->le_periodic_advertising_sync_transfer_recipient_supported); - ASSERT_EQ(kLocalLeFeatures.adv_filter_extended_features_mask, - ((bt_local_le_features_t*)property.val)->adv_filter_extended_features_mask); - ASSERT_EQ(kLocalLeFeatures.le_channel_sounding_supported, - ((bt_local_le_features_t*)property.val)->le_channel_sounding_supported); - break; - - case BT_PROPERTY_RESERVED_0E: - case BT_PROPERTY_RESERVED_0F: - case BT_PROPERTY_DYNAMIC_AUDIO_BUFFER: - break; - - case BT_PROPERTY_REMOTE_IS_COORDINATED_SET_MEMBER: - ASSERT_EQ((int)sizeof(bool), property.len); - ASSERT_EQ(kRemoteIsCoordinatedSetMember, *((bool*)property.val)); - break; - - case BT_PROPERTY_APPEARANCE: - ASSERT_EQ((int)sizeof(uint16_t), property.len); - ASSERT_EQ(kAppearance, *((uint16_t*)property.val)); - break; - - case BT_PROPERTY_VENDOR_PRODUCT_INFO: - ASSERT_EQ((int)sizeof(bt_vendor_product_info_t), property.len); - ASSERT_EQ(kVendorProductInfo.vendor_id_src, - ((bt_vendor_product_info_t*)property.val)->vendor_id_src); - ASSERT_EQ(kVendorProductInfo.vendor_id, ((bt_vendor_product_info_t*)property.val)->vendor_id); - ASSERT_EQ(kVendorProductInfo.product_id, - ((bt_vendor_product_info_t*)property.val)->product_id); - ASSERT_EQ(kVendorProductInfo.version, ((bt_vendor_product_info_t*)property.val)->version); - break; - - case BT_PROPERTY_REMOTE_ASHA_CAPABILITY: - ASSERT_EQ((int)sizeof(int16_t), property.len); - ASSERT_EQ(kRemoteAshaCapability, *((int16_t*)property.val)); - break; - - case BT_PROPERTY_REMOTE_ASHA_TRUNCATED_HISYNCID: - ASSERT_EQ((int)sizeof(uint32_t), property.len); - ASSERT_EQ(kRemoteAshaTruncatedHisyncId, *((uint32_t*)property.val)); - break; - - case BT_PROPERTY_REMOTE_MODEL_NUM: - ASSERT_EQ((int)sizeof(kRemoteModelNum.name), property.len); - ASSERT_STREQ((const char*)kRemoteModelNum.name, ((const char*)property.val)); - break; - - case BT_PROPERTY_REMOTE_ADDR_TYPE: - ASSERT_EQ((int)sizeof(uint8_t), property.len); - ASSERT_EQ(kRemoteAddrType, *((uint8_t*)property.val)); - break; - - case BT_PROPERTY_REMOTE_DEVICE_TIMESTAMP: - ASSERT_EQ((int)sizeof(int), property.len); - ASSERT_EQ(kRemoteDeviceTimestamp, *((int*)property.val)); - break; - - default: - FAIL() << "Illegal property type:" << type; - break; - } -} - -// Fill a property container with all possible property types -void fill_properties(std::vector<std::shared_ptr<BtProperty>>& properties) { - fill_property(BT_PROPERTY_BDNAME, properties); - fill_property(BT_PROPERTY_BDADDR, properties); - fill_property(BT_PROPERTY_UUIDS, properties); - fill_property(BT_PROPERTY_CLASS_OF_DEVICE, properties); - fill_property(BT_PROPERTY_TYPE_OF_DEVICE, properties); - fill_property(BT_PROPERTY_SERVICE_RECORD, properties); - fill_property(BT_PROPERTY_ADAPTER_BONDED_DEVICES, properties); - fill_property(BT_PROPERTY_ADAPTER_DISCOVERABLE_TIMEOUT, properties); - fill_property(BT_PROPERTY_REMOTE_FRIENDLY_NAME, properties); - fill_property(BT_PROPERTY_REMOTE_RSSI, properties); - fill_property(BT_PROPERTY_REMOTE_VERSION_INFO, properties); - fill_property(BT_PROPERTY_LOCAL_LE_FEATURES, properties); - fill_property(BT_PROPERTY_REMOTE_IS_COORDINATED_SET_MEMBER, properties); - fill_property(BT_PROPERTY_APPEARANCE, properties); - fill_property(BT_PROPERTY_VENDOR_PRODUCT_INFO, properties); - fill_property(BT_PROPERTY_REMOTE_ASHA_CAPABILITY, properties); - fill_property(BT_PROPERTY_REMOTE_ASHA_TRUNCATED_HISYNCID, properties); - fill_property(BT_PROPERTY_REMOTE_MODEL_NUM, properties); - fill_property(BT_PROPERTY_REMOTE_ADDR_TYPE, properties); - fill_property(BT_PROPERTY_REMOTE_DEVICE_TIMESTAMP, properties); - ASSERT_EQ(kNumberTestedProperties, properties.size()); -} - -} // namespace - // -class BtPropertyTest : public testing::Test { -protected: - void SetUp() override {} - void TearDown() override {} -}; - -TEST_F(BtPropertyTest, bt_property_text_test) { - { - bt_property_t prop = { - .type = BT_PROPERTY_BDNAME, - .len = (int)sizeof(kBdName), - .val = (void*)kBdName, - }; - ASSERT_STREQ("type:BT_PROPERTY_BDNAME name:kBdName", bt_property_text(prop).c_str()); - } - - { - bt_property_t prop = { - .type = BT_PROPERTY_BDADDR, - .len = (int)sizeof(kRawAddress), - .val = (void*)&kRawAddress, - }; - ASSERT_STREQ("type:BT_PROPERTY_BDADDR addr:11:22:33:44:55:66", bt_property_text(prop).c_str()); - } - - { - bt_property_t prop = { - .type = BT_PROPERTY_UUIDS, - .len = (int)(sizeof(bluetooth::Uuid) * kUuids.size()), - .val = (void*)&kUuids[0], - }; - ASSERT_STREQ( - "type:BT_PROPERTY_UUIDS uuids:00000001-1001-1000-8000-00805f9b34fb " - "00000001-1002-1000-8000-00805f9b34fb 00000001-1003-1000-8000-00805f9b34fb", - bt_property_text(prop).c_str()); - } - - { - bt_property_t prop = { - .type = BT_PROPERTY_CLASS_OF_DEVICE, - .len = (int)sizeof(kClassOfDevice), - .val = (void*)&kClassOfDevice, - }; - ASSERT_STREQ("type:BT_PROPERTY_CLASS_OF_DEVICE cod:0x99663300", bt_property_text(prop).c_str()); - } - - { - bt_property_t prop = { - .type = BT_PROPERTY_TYPE_OF_DEVICE, - .len = (int)sizeof(kTypeOfDevice), - .val = (void*)&kTypeOfDevice, - }; - ASSERT_STREQ("type:BT_PROPERTY_TYPE_OF_DEVICE type_of_device:1", - bt_property_text(prop).c_str()); - } - - { - bt_property_t prop = { - .type = BT_PROPERTY_SERVICE_RECORD, - .len = (int)sizeof(kServiceRecord), - .val = (void*)&kServiceRecord, - }; - ASSERT_STREQ( - "type:BT_PROPERTY_SERVICE_RECORD uuid:00000001-1001-1000-8000-00805f9b34fb " - "channel:4660 " - "name:\"kServiceRecord.name\"", - bt_property_text(prop).c_str()); - } - - { - bt_property_t prop = { - .type = BT_PROPERTY_ADAPTER_BONDED_DEVICES, - .len = (int)(sizeof(kAdapterBondedDevices)), - .val = (void*)kAdapterBondedDevices, - }; - ASSERT_STREQ( - "type:BT_PROPERTY_ADAPTER_BONDED_DEVICES addrs:11:22:33:44:55:00 12:22:33:44:55:00 " - "13:22:33:44:55:00 14:22:33:44:55:00 15:22:33:44:55:00", - bt_property_text(prop).c_str()); - } - - { - bt_property_t prop = { - .type = BT_PROPERTY_ADAPTER_DISCOVERABLE_TIMEOUT, - .len = (int)sizeof(kAdapterDiscoverableTimeout), - .val = (void*)&kAdapterDiscoverableTimeout, - }; - ASSERT_STREQ("type:BT_PROPERTY_ADAPTER_DISCOVERABLE_TIMEOUT discoverable_timeout:1149815808", - bt_property_text(prop).c_str()); - } - - { - bt_bdname_t bd_name; - bd_name_from_char_pointer(bd_name.name, (const char*)kRemoteFriendlyName); - bt_property_t prop = { - .type = BT_PROPERTY_REMOTE_FRIENDLY_NAME, - .len = (int)sizeof(bd_name.name), - .val = (void*)&bd_name.name, - }; - ASSERT_STREQ("type:BT_PROPERTY_REMOTE_FRIENDLY_NAME remote_friendly_name:kRemoteFriendlyName", - bt_property_text(prop).c_str()); - } - - { - bt_property_t prop = { - .type = BT_PROPERTY_REMOTE_RSSI, - .len = (int)sizeof(kRemoteRssi), - .val = (void*)&kRemoteRssi, - }; - ASSERT_STREQ("type:BT_PROPERTY_REMOTE_RSSI rssi:16", bt_property_text(prop).c_str()); - } - - { - bt_property_t prop = { - .type = BT_PROPERTY_REMOTE_VERSION_INFO, - .len = (int)sizeof(kRemoteVersionInfo), - .val = (void*)&kRemoteVersionInfo, - }; - ASSERT_STREQ("type:BT_PROPERTY_REMOTE_VERSION_INFO version:1 sub:2 mfr:3", - bt_property_text(prop).c_str()); - } - - { - bt_property_t prop = { - .type = BT_PROPERTY_LOCAL_LE_FEATURES, - .len = (int)sizeof(kLocalLeFeatures), - .val = (void*)&kLocalLeFeatures, - }; - ASSERT_STREQ( - "type:BT_PROPERTY_LOCAL_LE_FEATURES version_supported:4660 local_privacy_enabled:17 " - "max_adv_instance:34 rpa_offload_supported:51 max_irk_list_size:68 " - "max_adv_filter_supported:85 activity_energy_info_supported:102 " - "scan_result_storage_size:22136 total_trackable_advertisers:39612 " - "extended_scan_support:1 " - "debug_logging_supported:1 le_2m_phy_supported:1 le_coded_phy_supported:1 " - "le_extended_advertising_supported:1 le_periodic_advertising_supported:1 " - "le_maximum_advertising_data_length:4951 dynamic_audio_buffer_supported:574908040 " - "le_periodic_advertising_sync_transfer_sender_supported:1 " - "le_connected_isochronous_stream_central_supported:1 " - "le_isochronous_broadcast_supported:1 " - "le_periodic_advertising_sync_transfer_recipient_supported:1 " - "adv_filter_extended_features_mask:13158" - "le_channel_sounding_supported:1 ", - bt_property_text(prop).c_str()); - } - - { - bt_property_t prop = { - .type = BT_PROPERTY_REMOTE_IS_COORDINATED_SET_MEMBER, - .len = (int)sizeof(kRemoteIsCoordinatedSetMember), - .val = (void*)&kRemoteIsCoordinatedSetMember, - }; - ASSERT_STREQ("type:BT_PROPERTY_REMOTE_IS_COORDINATED_SET_MEMBER is_coordinated_set_member:true", - bt_property_text(prop).c_str()); - } - - { - bt_property_t prop = { - .type = BT_PROPERTY_APPEARANCE, - .len = (int)sizeof(kAppearance), - .val = (void*)&kAppearance, - }; - ASSERT_STREQ("type:BT_PROPERTY_APPEARANCE appearance:0x44", bt_property_text(prop).c_str()); - } - - { - bt_property_t prop = { - .type = BT_PROPERTY_VENDOR_PRODUCT_INFO, - .len = (int)sizeof(kVendorProductInfo), - .val = (void*)&kVendorProductInfo, - }; - ASSERT_STREQ( - "type:BT_PROPERTY_VENDOR_PRODUCT_INFO vendor_id_src:2 vendor_id:4661 product_id:22137 " - "version:39613", - bt_property_text(prop).c_str()); - } - - { - bt_property_t prop = { - .type = BT_PROPERTY_REMOTE_ASHA_CAPABILITY, - .len = (int)sizeof(kRemoteAshaCapability), - .val = (void*)&kRemoteAshaCapability, - }; - ASSERT_STREQ("type:BT_PROPERTY_REMOTE_ASHA_CAPABILITY remote_asha_capability:137", - bt_property_text(prop).c_str()); - } - - { - bt_property_t prop = { - .type = BT_PROPERTY_REMOTE_ASHA_TRUNCATED_HISYNCID, - .len = (int)sizeof(kRemoteAshaTruncatedHisyncId), - .val = (void*)&kRemoteAshaTruncatedHisyncId, - }; - ASSERT_STREQ( - "type:BT_PROPERTY_REMOTE_ASHA_TRUNCATED_HISYNCID " - "remote_asha_truncated_hisyncid:574908040", - bt_property_text(prop).c_str()); - } - - { - bt_property_t prop = { - .type = BT_PROPERTY_REMOTE_MODEL_NUM, - .len = (int)sizeof(kRemoteModelNum.name), - .val = (void*)kRemoteModelNum.name, - }; - ASSERT_STREQ("type:BT_PROPERTY_REMOTE_MODEL_NUM remote_model_num:kRemoteModelNum", - bt_property_text(prop).c_str()); - } - - { - bt_property_t prop = { - .type = BT_PROPERTY_REMOTE_ADDR_TYPE, - .len = (int)sizeof(kRemoteAddrType), - .val = (void*)&kRemoteAddrType, - }; - ASSERT_STREQ("type:BT_PROPERTY_REMOTE_ADDR_TYPE remote_asha_truncated_hisyncid:0x55", - bt_property_text(prop).c_str()); - } - - { - bt_property_t prop = { - .type = BT_PROPERTY_REMOTE_DEVICE_TIMESTAMP, - .len = (int)sizeof(kRemoteDeviceTimestamp), - .val = (void*)&kRemoteDeviceTimestamp, - }; - ASSERT_STREQ("type:BT_PROPERTY_REMOTE_DEVICE_TIMESTAMP", bt_property_text(prop).c_str()); - } -} - -TEST_F(BtPropertyTest, verify_property_sizes) { - std::vector<std::shared_ptr<BtProperty>> properties; - fill_properties(properties); -} - -TEST_F(BtPropertyTest, fill_and_serialize) { - std::vector<std::shared_ptr<BtProperty>> properties; - fill_properties(properties); - - BtPropertyLegacy legacy(properties); - - ASSERT_EQ(kNumberTestedProperties, legacy.NumProperties()); -} - -TEST_F(BtPropertyTest, serialize_and_verify) { - std::vector<std::shared_ptr<BtProperty>> properties; - fill_properties(properties); - - BtPropertyLegacy legacy(properties); - - for (const auto p : legacy.Properties()) { - verify_property(p.type, p); - } -} - -TEST_F(BtPropertyTest, name_too_long) { - std::vector<std::shared_ptr<BtProperty>> properties; - BD_NAME bd_name; - for (size_t i = 0; i < kBdPropNameLength; i++) { - bd_name[i] = ((i + 1) % 10) ? 'a' : 'A'; - } - - properties.push_back(BdName::Create(bd_name)); - BtPropertyLegacy legacy(properties); - ASSERT_EQ(1U, legacy.NumProperties()); - - bt_property_t bt_properties[1]; - legacy.Export(bt_properties, 1U); - - ASSERT_STREQ((const char*)kReallyLongName, (const char*)bt_properties[0].val); -} - -class BtPropertyArrayTest : public testing::Test { -protected: - void SetUp() override { fill_properties(properties); } - void TearDown() override {} - std::vector<std::shared_ptr<BtProperty>> properties; - bt_property_t props[kNumberTestedProperties]; -}; - -TEST_F(BtPropertyArrayTest, serialize_and_verify) { - BtPropertyLegacy legacy(properties); - - for (const auto p : legacy.Properties()) { - verify_property(p.type, p); - } -} - -TEST_F(BtPropertyArrayTest, async_data) { - auto future = std::async(std::launch::async, []() { - std::vector<std::shared_ptr<BtProperty>> properties; - fill_properties(properties); - return properties; - }); - - auto properties = future.get(); - - BtPropertyLegacy legacy(properties); - - for (const auto p : legacy.Properties()) { - verify_property(p.type, p); - } -} - -class BtPropertyDynamicArrayTest : public testing::Test { -protected: - void SetUp() override { - fill_properties(properties); - props = (bt_property_t*)malloc(sizeof(bt_property_t) * properties.size()); - } - void TearDown() override { free(props); } - - bt_property_t* props{nullptr}; - std::vector<std::shared_ptr<BtProperty>> properties; -}; - -TEST_F(BtPropertyDynamicArrayTest, serialize_and_verify) { - BtPropertyLegacy legacy(properties); - // Legacy now has complete copy of properties - properties.clear(); - - legacy.Export(props, kNumberTestedProperties); - - bt_property_t* p = props; - for (size_t i = 0; i < kNumberTestedProperties; i++) { - verify_property(p->type, *p); - } -} - -class BtPropertyMultiAllocationTest : public testing::Test { -protected: - static constexpr size_t kNumProperties = 1; - static constexpr size_t kNumThreads = 20; - - void SetUp() override {} - void TearDown() override {} - - std::vector<std::future<std::vector<std::shared_ptr<BtProperty>>>> future_vector; - - bt_property_t bt_properties[kNumThreads][kNumberTestedProperties] = {}; - - std::vector<std::shared_ptr<BtProperty>> properties; -}; - -TEST_F(BtPropertyMultiAllocationTest, async_data_multi) { - for (size_t i = 0; i < kNumThreads; i++) { - future_vector.push_back(std::async(std::launch::async, [i]() { - std::vector<std::shared_ptr<BtProperty>> properties; - properties.emplace_back(RemoteDeviceTimestamp::Create((uint32_t)i)); - return properties; - })); - } - - for (size_t i = 0; i < kNumThreads; i++) { - std::vector<std::shared_ptr<BtProperty>> props = future_vector[i].get(); - BtPropertyLegacy legacy(props); - memcpy(bt_properties[i], (const void*)legacy.Ptr(), - (size_t)legacy.Len() * sizeof(bt_property_t)); - - ASSERT_EQ(BT_PROPERTY_REMOTE_DEVICE_TIMESTAMP, (int)bt_properties[i]->type); - ASSERT_EQ((int)sizeof(uint32_t), bt_properties[i]->len); - ASSERT_EQ((int)i, *(int*)bt_properties[i]->val); - } -} diff --git a/system/gd/discovery/device/data_parser.cc b/system/gd/discovery/device/data_parser.cc deleted file mode 100644 index 7439be07dd..0000000000 --- a/system/gd/discovery/device/data_parser.cc +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2024 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "discovery/device/data_parser.h" - -#include "hci/hci_packets.h" -#include "packet/iterator.h" - -using namespace bluetooth; - -using namespace bluetooth::hci; -using namespace bluetooth::packet; - -namespace bluetooth::discovery::device { - -DataParser::DataParser(const std::vector<uint8_t>& data) { - auto it = Iterator<kLittleEndian>(std::make_shared<std::vector<uint8_t>>(data)); - - while (it.NumBytesRemaining()) { - GapData gap_data; - it = GapData::Parse(&gap_data, it); - gap_data_.push_back(gap_data); - } -} - -size_t DataParser::GetNumGapData() const { return gap_data_.size(); } - -std::vector<hci::GapData> DataParser::GetData() const { - return std::vector<hci::GapData>(gap_data_); -} - -std::vector<hci::GapDataType> DataParser::GetDataTypes() const { - std::vector<hci::GapDataType> types; - for (const auto& gap_data : gap_data_) { - types.push_back(gap_data.data_type_); - } - return types; -} - -} // namespace bluetooth::discovery::device diff --git a/system/gd/discovery/device/data_parser_unittest.cc b/system/gd/discovery/device/data_parser_unittest.cc deleted file mode 100644 index 89e375d0c8..0000000000 --- a/system/gd/discovery/device/data_parser_unittest.cc +++ /dev/null @@ -1,258 +0,0 @@ -/* - * Copyright 2024 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "discovery/device/data_parser.h" - -#include <bluetooth/log.h> - -#include <algorithm> - -#include "gtest/gtest.h" -#include "hci/hci_packets.h" - -using namespace bluetooth::hci; -using bluetooth::discovery::device::DataParser; - -namespace { -constexpr uint8_t kOneFlag32Data[] = { - 0x5, static_cast<uint8_t>(GapDataType::FLAGS), 0xde, 0xad, 0xbe, 0xef}; -constexpr uint8_t kTwoFlag32Data[] = { - 0x5, static_cast<uint8_t>(GapDataType::FLAGS), 0xde, 0xad, 0xbe, 0xef, - 0x5, static_cast<uint8_t>(GapDataType::FLAGS), 0x11, 0x22, 0x33, 0x44}; -constexpr uint8_t kNoUuid16Data[] = {0x2, - static_cast<uint8_t>(GapDataType::COMPLETE_LIST_16_BIT_UUIDS)}; -constexpr uint8_t kPartialUuid16Data[] = { - 0x2, static_cast<uint8_t>(GapDataType::COMPLETE_LIST_16_BIT_UUIDS), 0x12}; -constexpr uint8_t kOneUuid16Data[] = { - 0x3, static_cast<uint8_t>(GapDataType::COMPLETE_LIST_16_BIT_UUIDS), 0x12, 0x34}; - -uint32_t toLeInt(const std::vector<uint8_t>& v) { - return v[3] | (v[2] << 8) | (v[1] << 16) | (v[0] << 24); -} - -} // namespace - -TEST(DataParserTest, no_data) { - auto data = std::make_shared<std::vector<uint8_t>>(); - - auto it = Iterator<kLittleEndian>(data); - GapData gap_data; - it = GapData::Parse(&gap_data, it); - - ASSERT_EQ(it.NumBytesRemaining(), 0U); -} - -TEST(DataParserTest, one_element_data) { - auto data = std::make_shared<std::vector<uint8_t>>(1); - data->push_back(0xff); - - auto it = Iterator<kLittleEndian>(data); - GapData gap_data; - it = GapData::Parse(&gap_data, it); - - ASSERT_EQ(it.NumBytesRemaining(), 0U); -} - -TEST(DataParserTest, two_element_data) { - auto data = std::make_shared<std::vector<uint8_t>>(2); - data->push_back(0xff); - data->push_back(0xff); - - auto it = Iterator<kLittleEndian>(data); - GapData gap_data; - it = GapData::Parse(&gap_data, it); - - ASSERT_EQ(it.NumBytesRemaining(), 0U); -} - -TEST(DataParserTest, all_ones_data) { - auto data = std::make_shared<std::vector<uint8_t>>(256); - std::fill(data->begin(), data->end(), 0xff); - - auto it = Iterator<kLittleEndian>(data); - GapData gap_data; - it = GapData::Parse(&gap_data, it); - - ASSERT_EQ(it.NumBytesRemaining(), 0U); -} - -TEST(DataParserTest, simple_flag) { - auto data = std::make_shared<std::vector<uint8_t>>(kOneFlag32Data, - kOneFlag32Data + sizeof(kOneFlag32Data)); - - auto it = Iterator<kLittleEndian>(data); - GapData gap_data; - it = GapData::Parse(&gap_data, it); - - ASSERT_EQ(it.NumBytesRemaining(), 0U); - ASSERT_EQ(gap_data.data_type_, GapDataType::FLAGS); - ASSERT_EQ(0xdeadbeef, toLeInt(gap_data.data_)); -} - -TEST(DataParserTest, two_flags) { - auto data = std::make_shared<std::vector<uint8_t>>(kTwoFlag32Data, - kTwoFlag32Data + sizeof(kTwoFlag32Data)); - - auto it = Iterator<kLittleEndian>(data); - GapData gap_data[2]; - it = GapData::Parse(&gap_data[0], it); - - ASSERT_EQ(it.NumBytesRemaining(), 1U /* length */ + 1U /* type */ + 4U /* data */); - ASSERT_EQ(gap_data[0].data_type_, GapDataType::FLAGS); - ASSERT_EQ((unsigned)0xdeadbeef, toLeInt(gap_data[0].data_)); - - it = GapData::Parse(&gap_data[1], it); - - ASSERT_EQ(it.NumBytesRemaining(), 0U); - ASSERT_EQ(gap_data[1].data_type_, GapDataType::FLAGS); - ASSERT_EQ((unsigned)0x11223344, toLeInt(gap_data[1].data_)); -} - -TEST(DataParserTest, no_uuid16) { - auto data = std::make_shared<std::vector<uint8_t>>(kNoUuid16Data, - kNoUuid16Data + sizeof(kNoUuid16Data)); - - auto it = Iterator<kLittleEndian>(data); - GapData gap_data; - it = GapData::Parse(&gap_data, it); - - ASSERT_EQ(it.NumBytesRemaining(), 0U); - ASSERT_EQ(gap_data.data_type_, GapDataType::COMPLETE_LIST_16_BIT_UUIDS); - ASSERT_EQ(0U, gap_data.data_.size()); -} - -TEST(DataParserTest, partial_uuid16) { - auto data = std::make_shared<std::vector<uint8_t>>( - kPartialUuid16Data, kPartialUuid16Data + sizeof(kPartialUuid16Data)); - - auto it = Iterator<kLittleEndian>(data); - GapData gap_data; - it = GapData::Parse(&gap_data, it); - - ASSERT_EQ(it.NumBytesRemaining(), 0U); - ASSERT_EQ(gap_data.data_type_, GapDataType::COMPLETE_LIST_16_BIT_UUIDS); - ASSERT_EQ(1U, gap_data.data_.size()); -} - -TEST(DataParserTest, one_uuid16) { - auto data = std::make_shared<std::vector<uint8_t>>(kOneUuid16Data, - kOneUuid16Data + sizeof(kOneUuid16Data)); - auto it = Iterator<kLittleEndian>(data); - GapData gap_data; - it = GapData::Parse(&gap_data, it); - - ASSERT_EQ(it.NumBytesRemaining(), 0U); - ASSERT_EQ(gap_data.data_type_, GapDataType::COMPLETE_LIST_16_BIT_UUIDS); - ASSERT_EQ(2U, gap_data.data_.size()); -} - -TEST(DataParserTest, simple_data_parser) { - std::vector<uint8_t> v(kTwoFlag32Data, kTwoFlag32Data + sizeof(kTwoFlag32Data)); - DataParser data_parser(v); - ASSERT_EQ(2U, data_parser.GetNumGapData()); - - std::vector<bluetooth::hci::GapData> flags; - std::vector<bluetooth::hci::GapData> gap_data = data_parser.GetData(); - for (const auto& data : gap_data) { - ASSERT_EQ(bluetooth::hci::GapDataType::FLAGS, data.data_type_); - flags.push_back(data); - } - - ASSERT_EQ(2U, flags.size()); - uint32_t value[2] = { - toLeInt(flags[0].data_), - toLeInt(flags[1].data_), - }; - ASSERT_EQ((unsigned)0xdeadbeef, value[0]); - ASSERT_EQ((unsigned)0x11223344, value[1]); -} - -TEST(DataParserTest, two_flags_backing_store_cleared) { - std::vector<uint8_t>* v = new std::vector<uint8_t>(sizeof(kTwoFlag32Data)); - std::copy(kTwoFlag32Data, kTwoFlag32Data + sizeof(kTwoFlag32Data), v->begin()); - DataParser data_parser(*v); - v->clear(); - ASSERT_EQ(2U, data_parser.GetNumGapData()); - - std::vector<bluetooth::hci::GapData> flags; - std::vector<bluetooth::hci::GapData> gap_data = data_parser.GetData(); - for (const auto& data : gap_data) { - ASSERT_EQ(bluetooth::hci::GapDataType::FLAGS, data.data_type_); - flags.push_back(data); - } - - ASSERT_EQ(2U, flags.size()); - uint32_t value[2] = { - toLeInt(flags[0].data_), - toLeInt(flags[1].data_), - }; - ASSERT_EQ((unsigned)0xdeadbeef, value[0]); - ASSERT_EQ((unsigned)0x11223344, value[1]); - - delete v; -} - -TEST(DataParserTest, backing_store_freed) { - uint8_t* data = (uint8_t*)malloc(sizeof(kTwoFlag32Data)); - std::copy(kTwoFlag32Data, kTwoFlag32Data + sizeof(kTwoFlag32Data), data); - DataParser data_parser(std::vector<uint8_t>(data, data + sizeof(kTwoFlag32Data))); - free(data); - ASSERT_EQ(2U, data_parser.GetNumGapData()); - - std::vector<bluetooth::hci::GapData> flags; - std::vector<bluetooth::hci::GapData> gap_data = data_parser.GetData(); - for (const auto& data : gap_data) { - ASSERT_EQ(bluetooth::hci::GapDataType::FLAGS, data.data_type_); - flags.push_back(data); - } - - ASSERT_EQ(2U, flags.size()); - uint32_t value[2] = { - toLeInt(flags[0].data_), - toLeInt(flags[1].data_), - }; - ASSERT_EQ((unsigned)0xdeadbeef, value[0]); - ASSERT_EQ((unsigned)0x11223344, value[1]); -} - -std::string GapDataToString(const GapData& data) { - std::stringstream ss; - ss << std::hex << std::showbase << "LengthAndData { "; - ss << "data = " << "VECTOR["; - for (size_t index = 0; index < data.data_.size(); index++) { - ss << ((index == 0) ? "" : ", ") << static_cast<uint64_t>(data.data_[index]); - } - ss << "]"; - ss << " }"; - return ss.str(); -} - -TEST(DataParserTest, random) { - constexpr int kMaxLoop = 1000; - auto data = std::vector<uint8_t>(512); - - for (int i = 0; i < kMaxLoop; i++) { - size_t size = rand() % 512; - for (size_t i = 0; i < size; i++) { - data[i] = rand() % 256; - } - DataParser data_parser(data); - - if (((i + 1) % 100) == 0) { - bluetooth::log::info("loop {}", i); - } - } -} diff --git a/system/gd/discovery/device/eir_data.cc b/system/gd/discovery/device/eir_data.cc deleted file mode 100644 index 3e8f765e82..0000000000 --- a/system/gd/discovery/device/eir_data.cc +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Copyright 2024 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "discovery/device/eir_data.h" - -#include <algorithm> -#include <array> -#include <iterator> -#include <vector> - -#include "hci/hci_packets.h" -#include "hci/uuid.h" - -using namespace bluetooth; - -using namespace bluetooth::hci; -using namespace bluetooth::packet; - -namespace bluetooth::discovery::device { - -EirData::EirData(const std::vector<uint8_t>& data) : DataParser(data) {} - -bool EirData::GetCompleteNames(std::vector<std::array<uint8_t, 240>>& names) const { - for (const auto& gap_data : gap_data_) { - if (gap_data.data_type_ == hci::GapDataType::COMPLETE_LOCAL_NAME) { - std::array<uint8_t, 240> array; - std::copy(gap_data.data_.begin(), gap_data.data_.end(), array.begin()); - names.push_back(array); - } - } - return !names.empty(); -} - -bool EirData::GetShortenedNames(std::vector<std::array<uint8_t, 240>>& names) const { - for (const auto& gap_data : gap_data_) { - if (gap_data.data_type_ == hci::GapDataType::SHORTENED_LOCAL_NAME) { - std::array<uint8_t, 240> array; - std::copy(gap_data.data_.begin(), gap_data.data_.end(), array.begin()); - names.push_back(array); - } - } - return !names.empty(); -} - -bool EirData::GetUuids16(std::vector<uint16_t>& uuids) const { - for (const auto& gap_data : gap_data_) { - if (gap_data.data_type_ == hci::GapDataType::COMPLETE_LIST_16_BIT_UUIDS) { - auto it = gap_data.data_.begin(); - while (std::distance(it, gap_data.data_.end()) >= (signed)Uuid::kNumBytes16) { - uuids.push_back(*it | *(it + 1) << 8); - it += Uuid::kNumBytes16; - } - } - } - return !uuids.empty(); -} - -bool EirData::GetUuidsIncomplete16(std::vector<uint16_t>& uuids) const { - for (const auto& gap_data : gap_data_) { - if (gap_data.data_type_ == hci::GapDataType::INCOMPLETE_LIST_16_BIT_UUIDS) { - auto it = gap_data.data_.begin(); - while (std::distance(it, gap_data.data_.end()) >= (signed)Uuid::kNumBytes16) { - uuids.push_back(*it | *(it + 1) << 8); - it += Uuid::kNumBytes16; - } - } - } - return !uuids.empty(); -} - -bool EirData::GetUuids32(std::vector<uint32_t>& uuids) const { - for (const auto& gap_data : gap_data_) { - if (gap_data.data_type_ == hci::GapDataType::COMPLETE_LIST_32_BIT_UUIDS) { - auto it = gap_data.data_.begin(); - while (std::distance(it, gap_data.data_.end()) >= (signed)Uuid::kNumBytes32) { - uuids.push_back(*it | *(it + 1) << 8 | *(it + 2) << 16 | *(it + 3) << 24); - it += Uuid::kNumBytes32; - } - } - } - return !uuids.empty(); -} - -bool EirData::GetUuidsIncomplete32(std::vector<uint32_t>& uuids) const { - for (const auto& gap_data : gap_data_) { - if (gap_data.data_type_ == hci::GapDataType::INCOMPLETE_LIST_32_BIT_UUIDS) { - auto it = gap_data.data_.begin(); - while (std::distance(it, gap_data.data_.end()) >= (signed)Uuid::kNumBytes32) { - uuids.push_back(*it | *(it + 1) << 8 | *(it + 2) << 16 | *(it + 3) << 24); - it += Uuid::kNumBytes32; - } - } - } - return !uuids.empty(); -} - -bool EirData::GetUuids128(std::vector<hci::Uuid>& uuids) const { - for (const auto& gap_data : gap_data_) { - if (gap_data.data_type_ == hci::GapDataType::COMPLETE_LIST_128_BIT_UUIDS) { - auto it = gap_data.data_.begin(); - while (std::distance(it, gap_data.data_.end()) >= (long)Uuid::kNumBytes128) { - auto uuid = bluetooth::hci::Uuid::From128BitLE(&it[0]); - uuids.push_back(uuid); - it += Uuid::kNumBytes128; - } - } - } - return !uuids.empty(); -} - -bool EirData::GetUuidsIncomplete128(std::vector<hci::Uuid>& uuids) const { - for (const auto& gap_data : gap_data_) { - if (gap_data.data_type_ == hci::GapDataType::INCOMPLETE_LIST_128_BIT_UUIDS) { - auto it = gap_data.data_.begin(); - while (std::distance(it, gap_data.data_.end()) >= (long)Uuid::kNumBytes128) { - auto uuid = bluetooth::hci::Uuid::From128BitLE(&it[0]); - uuids.push_back(uuid); - it += Uuid::kNumBytes128; - } - } - } - return !uuids.empty(); -} - -bool EirData::GetDeviceId(std::vector<std::vector<uint8_t>>& device_ids) const { - for (const auto& gap_data : gap_data_) { - if (gap_data.data_type_ == hci::GapDataType::DEVICE_ID) { - device_ids.push_back(gap_data.data_); - } - } - return !device_ids.empty(); -} - -bool EirData::GetManufacturerSpecificData(std::vector<std::vector<uint8_t>>& data) const { - for (const auto& gap_data : gap_data_) { - if (gap_data.data_type_ == hci::GapDataType::MANUFACTURER_SPECIFIC_DATA) { - data.push_back(gap_data.data_); - } - } - return !data.empty(); -} - -bool EirData::GetSecurityManagerOobFlags(std::vector<std::vector<uint8_t>>& flags) const { - for (const auto& gap_data : gap_data_) { - if (gap_data.data_type_ == hci::GapDataType::SECURITY_MANAGER_OOB_FLAGS) { - flags.push_back(gap_data.data_); - } - } - return !flags.empty(); -} - -bool EirData::GetServiceUuuids16(std::vector<service_uuid16_t>& uuids) const { - for (const auto& gap_data : gap_data_) { - if (gap_data.data_type_ == hci::GapDataType::SERVICE_DATA_16_BIT_UUIDS) { - if (gap_data.data_.size() < Uuid::kNumBytes16) { - continue; - } - auto it = gap_data.data_.begin(); - uuids.push_back({ - .uuid = (uint16_t)(*it | *(it + 1) << 8), - .data = std::vector<uint8_t>(it + Uuid::kNumBytes16, gap_data.data_.end()), - }); - } - } - return !uuids.empty(); -} - -bool EirData::GetServiceUuuids32(std::vector<service_uuid32_t>& uuids) const { - for (const auto& gap_data : gap_data_) { - if (gap_data.data_type_ == hci::GapDataType::SERVICE_DATA_32_BIT_UUIDS) { - if (gap_data.data_.size() < Uuid::kNumBytes32) { - continue; - } - auto it = gap_data.data_.begin(); - uuids.push_back({ - .uuid = (uint32_t)(*it | *(it + 1) << 8 | *(it + 2) << 16 | *(it + 3) << 24), - .data = std::vector<uint8_t>(it + Uuid::kNumBytes32, gap_data.data_.end()), - }); - } - } - return !uuids.empty(); -} - -bool EirData::GetTxPowerLevel(std::vector<int8_t>& tx_power_level) const { - for (const auto& gap_data : gap_data_) { - if (gap_data.data_type_ == hci::GapDataType::TX_POWER_LEVEL) { - if (gap_data.data_.size() == 1U) { - tx_power_level.push_back(static_cast<int8_t>(gap_data.data_[0])); - } - } - } - return !tx_power_level.empty(); -} - -} // namespace bluetooth::discovery::device diff --git a/system/gd/discovery/device/eir_data.h b/system/gd/discovery/device/eir_data.h deleted file mode 100644 index 90657cdeaf..0000000000 --- a/system/gd/discovery/device/eir_data.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2024 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include <cstdint> -#include <vector> - -#include "discovery/device/data_parser.h" -#include "hci/uuid.h" - -namespace bluetooth { -namespace discovery { -namespace device { - -struct service_uuid16_t { - uint16_t uuid; - std::vector<uint8_t> data; -}; - -struct service_uuid32_t { - uint32_t uuid; - std::vector<uint8_t> data; -}; - -class EirData : public DataParser { -public: - EirData(const std::vector<uint8_t>& data); - - bool GetCompleteNames(std::vector<std::array<uint8_t, 240>>&) const; - bool GetShortenedNames(std::vector<std::array<uint8_t, 240>>&) const; - - bool GetUuids16(std::vector<uint16_t>&) const; - bool GetUuidsIncomplete16(std::vector<uint16_t>&) const; - bool GetUuids32(std::vector<uint32_t>&) const; - bool GetUuidsIncomplete32(std::vector<uint32_t>&) const; - bool GetUuids128(std::vector<hci::Uuid>&) const; - bool GetUuidsIncomplete128(std::vector<hci::Uuid>&) const; - - bool GetDeviceId(std::vector<std::vector<uint8_t>>&) const; - - bool GetManufacturerSpecificData(std::vector<std::vector<uint8_t>>&) const; - - bool GetSecurityManagerOobFlags(std::vector<std::vector<uint8_t>>&) const; - bool GetServiceUuuids16(std::vector<service_uuid16_t>&) const; - bool GetServiceUuuids32(std::vector<service_uuid32_t>&) const; - bool GetTxPowerLevel(std::vector<int8_t>&) const; -}; - -} // namespace device -} // namespace discovery -} // namespace bluetooth diff --git a/system/gd/discovery/device/eir_data_unittest.cc b/system/gd/discovery/device/eir_data_unittest.cc deleted file mode 100644 index 202e4aad6a..0000000000 --- a/system/gd/discovery/device/eir_data_unittest.cc +++ /dev/null @@ -1,241 +0,0 @@ -/* - * Copyright 2024 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "discovery/device/eir_data.h" - -#include <bluetooth/log.h> - -#include "discovery/device/eir_test_data_packets.h" -#include "gmock/gmock.h" -#include "gtest/gtest.h" -#include "hci/hci_packets.h" -#include "os/log.h" - -using namespace bluetooth; -using bluetooth::discovery::device::EirData; - -namespace { -constexpr uint8_t kPartialUuid16Data[] = { - 0x2, static_cast<uint8_t>(hci::GapDataType::COMPLETE_LIST_16_BIT_UUIDS), 0x34}; -constexpr uint8_t kOneUuid16Data[] = { - 0x3, static_cast<uint8_t>(hci::GapDataType::COMPLETE_LIST_16_BIT_UUIDS), 0x34, 0x12}; -constexpr char kAudiMmi9962[] = "Audi_MMI_9962"; -constexpr char kChromeBoxForMeetings[] = "Chromebox for Meetings"; - -} // namespace - -namespace debug { -void LogUuids16(const std::vector<uint16_t>& uuids16) { - for (const auto& uuid : uuids16) { - log::info("uuid:0x{:x}", uuid); - } -} - -void LogUuids128(const std::vector<hci::Uuid>& uuids128) { - for (const auto& uuid : uuids128) { - log::info("uuid:{}", uuid.ToString()); - } -} -} // namespace debug - -TEST(EirDataTest, partial_uuid16) { - const EirData eir_data(std::vector<uint8_t>(kPartialUuid16Data, - kPartialUuid16Data + sizeof(kPartialUuid16Data))); - - std::vector<uint16_t> uuids; - ASSERT_FALSE(eir_data.GetUuids16(uuids)); -} - -TEST(EirDataTest, one_uuid16) { - const EirData eir_data( - std::vector<uint8_t>(kOneUuid16Data, kOneUuid16Data + sizeof(kOneUuid16Data))); - - std::vector<uint16_t> uuids; - ASSERT_TRUE(eir_data.GetUuids16(uuids)); - ASSERT_EQ(1U, uuids.size()); - ASSERT_EQ(0x1234, uuids[0]); -} - -TEST(EirDataTest, test_data_packets__data_type) { - ASSERT_EQ(1U, selected_packets.count("pkt34639")); - const auto& pkt = selected_packets["pkt34639"]; - const EirData eir_data(std::vector<uint8_t>(&pkt[kEirOffset], &pkt[kEirOffset] + kEirSize)); - - std::vector<hci::GapDataType> gap_data_types = eir_data.GetDataTypes(); - ASSERT_EQ(6U, gap_data_types.size()); -} - -TEST(EirDataTest, test_data_packets__complete_name) { - ASSERT_EQ(1U, selected_packets.count("pkt34639")); - const auto& pkt = selected_packets["pkt34639"]; - const EirData eir_data(std::vector<uint8_t>(&pkt[kEirOffset], &pkt[kEirOffset] + kEirSize)); - - std::vector<std::array<uint8_t, kEirSize>> names; - ASSERT_TRUE(eir_data.GetCompleteNames(names)); - ASSERT_EQ(1U, names.size()); - std::string name(names[0].begin(), names[0].end()); - ASSERT_STREQ(kAudiMmi9962, name.c_str()); -} - -TEST(EirDataTest, test_data_packets__uuids16) { - ASSERT_EQ(1U, selected_packets.count("pkt34639")); - const auto& pkt = selected_packets["pkt34639"]; - const EirData eir_data(std::vector<uint8_t>(&pkt[kEirOffset], &pkt[kEirOffset] + kEirSize)); - - std::vector<uint16_t> uuids16; - ASSERT_TRUE(eir_data.GetUuids16(uuids16)); - ASSERT_EQ(14U, uuids16.size()); - ASSERT_EQ(0x112e, uuids16[0]); - ASSERT_EQ(0x180a, uuids16[13]); -} - -TEST(EirDataTest, test_data_packets__uuids16_incomplete) { - ASSERT_EQ(1U, selected_packets.count("pkt19200")); - const auto& pkt = selected_packets["pkt19200"]; - const EirData eir_data(std::vector<uint8_t>(&pkt[kEirOffset], &pkt[kEirOffset] + kEirSize)); - - std::vector<uint16_t> uuids16; - ASSERT_TRUE(eir_data.GetUuidsIncomplete16(uuids16)); - ASSERT_EQ(7U, uuids16.size()); - ASSERT_EQ(0x110d, uuids16[0]); - ASSERT_EQ(0x1131, uuids16[6]); -} - -TEST(EirDataTest, test_data_packets__device_id) { - ASSERT_EQ(1U, selected_packets.count("pkt2062")); - const auto& pkt = selected_packets["pkt2062"]; - const EirData eir_data(std::vector<uint8_t>(&pkt[kEirOffset], &pkt[kEirOffset] + kEirSize)); - - std::vector<std::vector<uint8_t>> device_ids; - ASSERT_TRUE(eir_data.GetDeviceId(device_ids)); - ASSERT_EQ(1U, device_ids.size()); - ASSERT_EQ(0x01, device_ids[0][0]); -} - -TEST(EirDataTest, test_data_packets__manufacturer_data) { - ASSERT_EQ(1U, selected_packets.count("pkt26171")); - const auto& pkt = selected_packets["pkt26171"]; - const EirData eir_data(std::vector<uint8_t>(&pkt[kEirOffset], &pkt[kEirOffset] + kEirSize)); - - std::vector<std::vector<uint8_t>> mfr_data; - ASSERT_TRUE(eir_data.GetManufacturerSpecificData(mfr_data)); - ASSERT_EQ(1U, mfr_data.size()); - ASSERT_EQ(0, mfr_data[0][0]); -} - -TEST(EirDataTest, test_data_packets__security_manager_oob_flags) { - ASSERT_EQ(1U, selected_packets.count("pkt26171")); - const auto& pkt = selected_packets["pkt26171"]; - const EirData eir_data(std::vector<uint8_t>(&pkt[kEirOffset], &pkt[kEirOffset] + kEirSize)); - - std::vector<std::vector<uint8_t>> oob_flags; - ASSERT_TRUE(eir_data.GetManufacturerSpecificData(oob_flags)); - ASSERT_EQ(1U, oob_flags.size()); - ASSERT_EQ(0, oob_flags[0][0]); -} - -TEST(EirDataTest, test_data_packets__service_uuids16) { - ASSERT_EQ(1U, selected_packets.count("pktAsha")); - const auto& pkt = selected_packets["pktAsha"]; - const EirData eir_data(std::vector<uint8_t>(&pkt[kEirOffset], &pkt[kEirOffset] + kEirSize)); - - std::vector<discovery::device::service_uuid16_t> service_uuids16; - ASSERT_TRUE(eir_data.GetServiceUuuids16(service_uuids16)); - ASSERT_EQ(1U, service_uuids16.size()); - ASSERT_EQ(0xfdf0, service_uuids16[0].uuid); -} - -TEST(EirDataTest, test_data_packets__service_uuids32) { - for (const auto& pkt : data_packets) { - const EirData eir_data(std::vector<uint8_t>(&pkt[kEirOffset], &pkt[kEirOffset] + kEirSize)); - std::vector<discovery::device::service_uuid32_t> service_uuids32; - ASSERT_FALSE(eir_data.GetServiceUuuids32(service_uuids32)); - } -} - -TEST(EirDataTest, test_data_packets__tx_power_level) { - ASSERT_EQ(1U, selected_packets.count("pkt34639")); - const auto& pkt = selected_packets["pkt34639"]; - const EirData eir_data(std::vector<uint8_t>(&pkt[kEirOffset], &pkt[kEirOffset] + kEirSize)); - - std::vector<int8_t> levels; - ASSERT_TRUE(eir_data.GetTxPowerLevel(levels)); - ASSERT_EQ(1U, levels.size()); - ASSERT_EQ(4, levels[0]); -} - -TEST(EirDataTest, test_select_packets__pktAsha) { - ASSERT_EQ(1U, selected_packets.count("pktAsha")); - const auto& pkt = selected_packets["pktAsha"]; - const EirData eir_data(std::vector<uint8_t>(&pkt[kEirOffset], &pkt[kEirOffset] + kEirSize)); - - std::vector<std::array<uint8_t, kEirSize>> names; - ASSERT_TRUE(eir_data.GetCompleteNames(names)); - std::string name(names[0].begin(), names[0].end()); - ASSERT_STREQ(kChromeBoxForMeetings, name.c_str()); - - std::vector<int8_t> tx_power_level; - ASSERT_TRUE(eir_data.GetTxPowerLevel(tx_power_level)); - ASSERT_EQ(10, tx_power_level[0]); - - const std::vector<uint8_t> v1 = - std::vector<uint8_t>({0x01, 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x6c, 0x00}); - std::vector<std::vector<uint8_t>> device_ids; - ASSERT_TRUE(eir_data.GetDeviceId(device_ids)); - ASSERT_EQ(v1.size(), device_ids[0].size()); - ASSERT_THAT(v1, testing::ContainerEq(device_ids[0])); - - const std::vector<uint16_t> v2 = - std::vector<uint16_t>({0x1800, 0x1801, 0x180a, 0x110e, 0x110c, 0x111f, 0x110a}); - std::vector<uint16_t> uuids16; - ASSERT_TRUE(eir_data.GetUuids16(uuids16)); - ASSERT_EQ(v2.size(), uuids16.size()); - ASSERT_THAT(v2, testing::ContainerEq(uuids16)); - - std::vector<discovery::device::service_uuid16_t> service_uuids16; - ASSERT_TRUE(eir_data.GetServiceUuuids16(service_uuids16)); - ASSERT_EQ(1U, service_uuids16.size()); - ASSERT_EQ(0xfdf0, service_uuids16[0].uuid); -} - -TEST(EirDataTest, test_select_packets__pkt34639) { - ASSERT_EQ(1U, selected_packets.count("pkt34639")); - const auto& pkt = selected_packets["pkt34639"]; - const EirData eir_data(std::vector<uint8_t>(&pkt[kEirOffset], &pkt[kEirOffset] + kEirSize)); - - std::vector<uint16_t> uuids16; - ASSERT_TRUE(eir_data.GetUuids16(uuids16)); - ASSERT_EQ(14U, uuids16.size()); - ASSERT_EQ(0x112e, uuids16[0]); - ASSERT_EQ(0x180a, uuids16[13]); - - std::vector<uint32_t> uuids32; - ASSERT_FALSE(eir_data.GetUuids32(uuids32)); - ASSERT_EQ(0U, uuids32.size()); - - std::vector<hci::Uuid> uuids128; - ASSERT_TRUE(eir_data.GetUuids128(uuids128)); - - ASSERT_EQ(hci::Uuid::FromString("00000000-deca-fade-deca-deafdecacaff"), uuids128[0]); - - std::vector<int8_t> tx_power_level; - ASSERT_TRUE(eir_data.GetTxPowerLevel(tx_power_level)); - ASSERT_EQ(4, tx_power_level[0]); - - std::vector<std::array<uint8_t, 240>> names; - ASSERT_TRUE(eir_data.GetCompleteNames(names)); - ASSERT_STREQ("Audi_MMI_9962", std::string(names[0].begin(), names[0].end()).data()); -} diff --git a/system/gd/discovery/device/eir_test_data_packets.cc b/system/gd/discovery/device/eir_test_data_packets.cc deleted file mode 100644 index db37ff2430..0000000000 --- a/system/gd/discovery/device/eir_test_data_packets.cc +++ /dev/null @@ -1,13499 +0,0 @@ -/* - * Copyright 2024 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include <string> -#include <unordered_map> -#include <vector> - -// Frame (258 bytes) -static const unsigned char pkt34638[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x0b, 0x7e, 0x2c, 0x2d, // ./...~,- - 0x7c, 0x00, 0x01, 0x00, 0x3c, 0x04, 0x0c, 0xba, // |...<... - 0x0a, 0x9c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt34639[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x16, 0xaa, 0x9c, 0x85, // ./...... - 0x5a, 0x88, 0x01, 0x00, 0x08, 0x04, 0x34, 0xc7, // Z.....4. - 0x71, 0xc0, 0x1d, 0x03, 0x2e, 0x11, 0x05, 0x11, // q....... - 0x00, 0x12, 0x00, 0x18, 0x01, 0x18, 0x4c, 0xfe, // ......L. - 0x0e, 0x11, 0x0f, 0x11, 0x0c, 0x11, 0x0b, 0x11, // ........ - 0x1e, 0x11, 0x03, 0x12, 0x1f, 0x11, 0x0a, 0x18, // ........ - 0x01, 0x05, 0x31, 0x07, 0xff, 0xca, 0xca, 0xde, // ..1..... - 0xaf, 0xde, 0xca, 0xde, 0xde, 0xfa, 0xca, 0xde, // ........ - 0x00, 0x00, 0x00, 0x00, 0x66, 0x9a, 0x0c, 0x20, // ....f.. - 0x00, 0x08, 0xf4, 0xbd, 0xe6, 0x11, 0xcb, 0x52, // .......R - 0x00, 0x7a, 0xe1, 0x4d, 0xd3, 0x1f, 0xbf, 0x50, // .z.M...P - 0x5d, 0x57, 0x27, 0x97, 0xa2, 0x40, 0x41, 0xcd, // ]W'..@A. - 0x48, 0x43, 0x88, 0xec, 0x02, 0x0a, 0x04, 0x0e, // HC...... - 0x09, 0x41, 0x75, 0x64, 0x69, 0x5f, 0x4d, 0x4d, // .Audi_MM - 0x49, 0x5f, 0x39, 0x39, 0x36, 0x32, 0x00, 0x00, // I_9962.. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt2048[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x2f, 0xa9, 0x08, 0x71, // ./../..q - 0xeb, 0x50, 0x01, 0x00, 0x04, 0x01, 0x48, 0xb9, // .P....H. - 0x57, 0x7f, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // W...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x6c, 0x00, 0x0f, // .....l.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt2062[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x97, 0xa8, 0x0a, 0x71, // ./.....q - 0xeb, 0x50, 0x01, 0x00, 0x04, 0x01, 0x48, 0x49, // .P....HI - 0x42, 0x7f, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // B...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt2063[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x4f, 0xd1, 0xf1, 0x2a, // ./..O..* - 0x9a, 0xb8, 0x01, 0x00, 0x04, 0x01, 0x48, 0x5e, // ......H^ - 0x43, 0x7f, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // C...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x6c, 0x00, 0x0f, // .....l.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt2064[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x4f, 0xd1, 0xf1, 0x2a, // ./..O..* - 0x9a, 0xb8, 0x01, 0x00, 0x04, 0x01, 0x48, 0x5e, // ......H^ - 0x43, 0x7f, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // C...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x6c, 0x00, 0x0f, // .....l.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt2067[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x9c, 0xa1, 0x20, 0x23, // ./.... # - 0xce, 0xf4, 0x01, 0x00, 0x04, 0x01, 0x48, 0x93, // ......H. - 0x36, 0x7f, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // 6...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0c, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt2072[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xc6, 0x4b, 0xd8, 0xb6, // ./...K.. - 0x80, 0x5c, 0x01, 0x00, 0x04, 0x01, 0x48, 0xfb, // .\....H. - 0x41, 0x7f, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // A...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt2075[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x77, 0x08, 0x25, 0x99, // ./..w.%. - 0xec, 0x40, 0x01, 0x00, 0x04, 0x01, 0x48, 0xf4, // .@....H. - 0x18, 0x7f, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // ....Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt2076[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xc4, 0x8d, 0x25, 0x99, // ./....%. - 0xec, 0x40, 0x01, 0x00, 0x04, 0x01, 0x48, 0x41, // .@....HA - 0x5d, 0x7f, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // ]...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x6c, 0x00, 0x0f, // .....l.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt19189[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xc6, 0x4b, 0xd8, 0xb6, // ./...K.. - 0x80, 0x5c, 0x01, 0x00, 0x04, 0x01, 0x48, 0xfa, // .\....H. - 0x41, 0x7f, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // A...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt19190[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xf6, 0x8b, 0xf4, 0x2a, // ./.....* - 0x9a, 0xb8, 0x01, 0x00, 0x04, 0x01, 0x48, 0xfc, // ......H. - 0x75, 0x7f, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // u...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt19191[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x77, 0x08, 0x25, 0x99, // ./..w.%. - 0xec, 0x40, 0x01, 0x00, 0x04, 0x01, 0x48, 0xf2, // .@....H. - 0x18, 0x7f, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // ....Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt19192[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x2f, 0xa9, 0x08, 0x71, // ./../..q - 0xeb, 0x50, 0x01, 0x00, 0x04, 0x01, 0x48, 0xb8, // .P....H. - 0x57, 0x7f, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // W...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x6c, 0x00, 0x0f, // .....l.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt19193[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x4f, 0xd1, 0xf1, 0x2a, // ./..O..* - 0x9a, 0xb8, 0x01, 0x00, 0x04, 0x01, 0x48, 0x5c, // ......H - 0x43, 0x7f, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // C...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x6c, 0x00, 0x0f, // .....l.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt19194[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x5e, 0x64, 0xc3, 0x50, // ./..^d.P - 0x59, 0xa0, 0x01, 0x00, 0x04, 0x01, 0x48, 0xac, // Y.....H. - 0x5a, 0x7f, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // Z...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0c, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt19198[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xf1, 0xaf, 0xf3, 0x2a, // ./.....* - 0x9a, 0xb8, 0x01, 0x00, 0x04, 0x01, 0x48, 0xba, // ......H. - 0x10, 0x7f, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // ....Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x6c, 0x00, 0x0f, // .....l.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt19200[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x98, 0xa7, 0xcd, 0xd2, // ./...... - 0x96, 0x7c, 0x01, 0x00, 0x18, 0x04, 0x24, 0x21, // .|....$! - 0x55, 0x7f, 0x09, 0x10, 0x01, 0x00, 0x0a, 0x00, // U....... - 0xff, 0xff, 0xff, 0xff, 0x02, 0x0a, 0x04, 0x0f, // ........ - 0x02, 0x0d, 0x11, 0x0b, 0x11, 0x0e, 0x11, 0x0f, // ........ - 0x11, 0x1e, 0x11, 0x08, 0x11, 0x31, 0x11, 0x06, // .....1.. - 0x09, 0x41, 0x63, 0x72, 0x75, 0x78, 0x00, 0x00, // .Acrux.. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt19201[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x1d, 0xee, 0x9d, 0xdf, // ./...... - 0xcc, 0x90, 0x01, 0x00, 0x04, 0x01, 0x48, 0x76, // ......Hv - 0x1b, 0x7f, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // ....Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt19835[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xc6, 0x4b, 0xd8, 0xb6, // ./...K.. - 0x80, 0x5c, 0x01, 0x00, 0x04, 0x01, 0x48, 0xfa, // .\....H. - 0x41, 0xbe, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // A...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt19844[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xf6, 0x8b, 0xf4, 0x2a, // ./.....* - 0x9a, 0xb8, 0x01, 0x00, 0x04, 0x01, 0x48, 0xfb, // ......H. - 0x75, 0xb5, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // u...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt19845[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x77, 0x08, 0x25, 0x99, // ./..w.%. - 0xec, 0x40, 0x01, 0x00, 0x04, 0x01, 0x48, 0xf2, // .@....H. - 0x18, 0xb3, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // ....Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt19846[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x21, 0x51, 0xeb, 0xd5, // ./..!Q.. - 0xab, 0xd0, 0x01, 0x00, 0x04, 0x01, 0x48, 0x99, // ......H. - 0x06, 0xc6, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // ....Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt19857[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xdc, 0xd0, 0xf1, 0x2a, // ./.....* - 0x9a, 0xb8, 0x01, 0x00, 0x04, 0x01, 0x48, 0xbb, // ......H. - 0x6b, 0x13, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // k...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x6c, 0x00, 0x0f, // .....l.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt19863[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x4f, 0xd1, 0xf1, 0x2a, // ./..O..* - 0x9a, 0xb8, 0x01, 0x00, 0x04, 0x01, 0x48, 0x5c, // ......H - 0x43, 0xb7, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // C...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x6c, 0x00, 0x0f, // .....l.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt19871[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xf1, 0xaf, 0xf3, 0x2a, // ./.....* - 0x9a, 0xb8, 0x01, 0x00, 0x04, 0x01, 0x48, 0xb8, // ......H. - 0x10, 0xaf, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // ....Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x6c, 0x00, 0x0f, // .....l.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt19885[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xa1, 0x7b, 0x78, 0x83, // ./...{x. - 0xf8, 0xd8, 0x01, 0x00, 0x04, 0x01, 0x48, 0x80, // ......H. - 0x7f, 0xae, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // ....Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt19886[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x1d, 0xee, 0x9d, 0xdf, // ./...... - 0xcc, 0x90, 0x01, 0x00, 0x04, 0x01, 0x48, 0x75, // ......Hu - 0x1b, 0xa7, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // ....Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt19898[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xe0, 0x76, 0x2f, 0xd5, // ./...v/. - 0xab, 0xd0, 0x01, 0x00, 0x04, 0x01, 0x48, 0xcc, // ......H. - 0x13, 0xad, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // ....Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt19899[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x87, 0xa8, 0xf1, 0x2a, // ./.....* - 0x9a, 0xb8, 0x01, 0x00, 0x04, 0x01, 0x48, 0xf1, // ......H. - 0x15, 0xa7, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // ....Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt19904[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x09, 0x1e, 0x87, 0x83, // ./...... - 0xf8, 0xd8, 0x01, 0x00, 0x04, 0x01, 0x48, 0x1b, // ......H. - 0x4d, 0x9f, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // M...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt19908[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xc4, 0x8d, 0x25, 0x99, // ./....%. - 0xec, 0x40, 0x01, 0x00, 0x04, 0x01, 0x48, 0x40, // .@....H@ - 0x5d, 0xb5, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // ]...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x6c, 0x00, 0x0f, // .....l.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt33190[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x98, 0xa7, 0xcd, 0xd2, // ./...... - 0x96, 0x7c, 0x01, 0x00, 0x18, 0x04, 0x24, 0xc0, // .|....$. - 0x46, 0xd1, 0x09, 0x10, 0x01, 0x00, 0x0a, 0x00, // F....... - 0xff, 0xff, 0xff, 0xff, 0x02, 0x0a, 0x04, 0x0f, // ........ - 0x02, 0x0d, 0x11, 0x0b, 0x11, 0x0e, 0x11, 0x0f, // ........ - 0x11, 0x1e, 0x11, 0x08, 0x11, 0x31, 0x11, 0x06, // .....1.. - 0x09, 0x41, 0x63, 0x72, 0x75, 0x78, 0x00, 0x00, // .Acrux.. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt33191[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x1a, 0x02, 0xd8, 0xb6, // ./...... - 0x80, 0x5c, 0x01, 0x00, 0x04, 0x01, 0x48, 0xff, // .\....H. - 0x06, 0xa4, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // ....Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x6c, 0x00, 0x0f, // .....l.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt33217[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xc4, 0x8d, 0x25, 0x99, // ./....%. - 0xec, 0x40, 0x01, 0x00, 0x04, 0x01, 0x48, 0x3f, // .@....H? - 0x5d, 0xb6, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // ]...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x6c, 0x00, 0x0f, // .....l.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt34019[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xa1, 0x7b, 0x78, 0x83, // ./...{x. - 0xf8, 0xd8, 0x01, 0x00, 0x04, 0x01, 0x48, 0x7e, // ......H~ - 0x7f, 0xa9, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // ....Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt34020[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x98, 0xa7, 0xcd, 0xd2, // ./...... - 0x96, 0x7c, 0x01, 0x00, 0x18, 0x04, 0x24, 0xa7, // .|....$. - 0x42, 0xd0, 0x09, 0x10, 0x01, 0x00, 0x0a, 0x00, // B....... - 0xff, 0xff, 0xff, 0xff, 0x02, 0x0a, 0x04, 0x0f, // ........ - 0x02, 0x0d, 0x11, 0x0b, 0x11, 0x0e, 0x11, 0x0f, // ........ - 0x11, 0x1e, 0x11, 0x08, 0x11, 0x31, 0x11, 0x06, // .....1.. - 0x09, 0x41, 0x63, 0x72, 0x75, 0x78, 0x00, 0x00, // .Acrux.. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt19975[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x72, 0x5f, 0x1e, 0x2a, // ./..r_.* - 0x9a, 0xb8, 0x01, 0x00, 0x04, 0x01, 0x48, 0xa0, // ......H. - 0x04, 0xa9, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // ....Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x6c, 0x00, 0x0f, // .....l.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt19988[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x03, 0xe3, 0x63, 0x83, // ./....c. - 0x1c, 0x40, 0x01, 0x00, 0x04, 0x01, 0x48, 0x2c, // .@....H, - 0x27, 0xaf, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // '...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x72, 0x00, 0x0f, // .....r.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt20036[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x83, 0x35, 0x3c, 0x4b, // ./...5<K - 0xcf, 0x04, 0x01, 0x00, 0x04, 0x01, 0x48, 0x17, // ......H. - 0x6f, 0xa5, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // o...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0b, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x6c, 0x00, 0x0f, // .....l.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt575[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xa8, 0xc7, 0xb3, 0x4b, // ./.....K - 0x04, 0x00, 0x01, 0x00, 0x24, 0x04, 0x28, 0x4c, // ....$.(L - 0x26, 0x21, 0x07, 0x09, 0x53, 0x68, 0x69, 0x65, // &!..Shie - 0x6c, 0x64, 0x09, 0x03, 0x0a, 0x11, 0x0c, 0x11, // ld...... - 0x0e, 0x11, 0x00, 0x12, 0x01, 0x05, 0x81, 0x07, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt764[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x4c, 0xd6, 0x93, 0xd5, // ./..L... - 0xd6, 0x48, 0x01, 0x00, 0x00, 0x04, 0x24, 0x93, // .H....$. - 0x78, 0x7f, 0x09, 0x09, 0x48, 0x6f, 0x6d, 0x65, // x...Home - 0x20, 0x4d, 0x61, 0x78, 0x09, 0x03, 0x0b, 0x11, // Max.... - 0x0c, 0x11, 0x0e, 0x11, 0x00, 0x12, 0x01, 0x05, // ........ - 0x01, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt29692[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xa8, 0xc7, 0xb3, 0x4b, // ./.....K - 0x04, 0x00, 0x01, 0x00, 0x24, 0x04, 0x28, 0x32, // ....$.(2 - 0x27, 0xc6, 0x07, 0x09, 0x53, 0x68, 0x69, 0x65, // '...Shie - 0x6c, 0x64, 0x09, 0x03, 0x0a, 0x11, 0x0c, 0x11, // ld...... - 0x0e, 0x11, 0x00, 0x12, 0x01, 0x05, 0x81, 0x07, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt29730[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x4c, 0xd6, 0x93, 0xd5, // ./..L... - 0xd6, 0x48, 0x01, 0x00, 0x00, 0x04, 0x24, 0x78, // .H....$x - 0x79, 0xc8, 0x09, 0x09, 0x48, 0x6f, 0x6d, 0x65, // y...Home - 0x20, 0x4d, 0x61, 0x78, 0x09, 0x03, 0x0b, 0x11, // Max.... - 0x0c, 0x11, 0x0e, 0x11, 0x00, 0x12, 0x01, 0x05, // ........ - 0x01, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt29777[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xa8, 0xc7, 0xb3, 0x4b, // ./.....K - 0x04, 0x00, 0x01, 0x00, 0x24, 0x04, 0x28, 0x32, // ....$.(2 - 0x27, 0xbe, 0x07, 0x09, 0x53, 0x68, 0x69, 0x65, // '...Shie - 0x6c, 0x64, 0x09, 0x03, 0x0a, 0x11, 0x0c, 0x11, // ld...... - 0x0e, 0x11, 0x00, 0x12, 0x01, 0x05, 0x81, 0x07, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt29785[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x4c, 0xd6, 0x93, 0xd5, // ./..L... - 0xd6, 0x48, 0x01, 0x00, 0x00, 0x04, 0x24, 0x78, // .H....$x - 0x79, 0xcc, 0x09, 0x09, 0x48, 0x6f, 0x6d, 0x65, // y...Home - 0x20, 0x4d, 0x61, 0x78, 0x09, 0x03, 0x0b, 0x11, // Max.... - 0x0c, 0x11, 0x0e, 0x11, 0x00, 0x12, 0x01, 0x05, // ........ - 0x01, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt29830[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xa8, 0xc7, 0xb3, 0x4b, // ./.....K - 0x04, 0x00, 0x01, 0x00, 0x24, 0x04, 0x28, 0x32, // ....$.(2 - 0x27, 0x20, 0x07, 0x09, 0x53, 0x68, 0x69, 0x65, // ' ..Shie - 0x6c, 0x64, 0x09, 0x03, 0x0a, 0x11, 0x0c, 0x11, // ld...... - 0x0e, 0x11, 0x00, 0x12, 0x01, 0x05, 0x81, 0x07, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt29836[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x4c, 0xd6, 0x93, 0xd5, // ./..L... - 0xd6, 0x48, 0x01, 0x00, 0x00, 0x04, 0x24, 0x78, // .H....$x - 0x79, 0xcb, 0x09, 0x09, 0x48, 0x6f, 0x6d, 0x65, // y...Home - 0x20, 0x4d, 0x61, 0x78, 0x09, 0x03, 0x0b, 0x11, // Max.... - 0x0c, 0x11, 0x0e, 0x11, 0x00, 0x12, 0x01, 0x05, // ........ - 0x01, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt29922[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xa8, 0xc7, 0xb3, 0x4b, // ./.....K - 0x04, 0x00, 0x01, 0x00, 0x24, 0x04, 0x28, 0x32, // ....$.(2 - 0x27, 0x7f, 0x07, 0x09, 0x53, 0x68, 0x69, 0x65, // '...Shie - 0x6c, 0x64, 0xff, 0x11, 0x00, 0x00, 0x00, 0x00, // ld...... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x24, // .......$ - 0xb8, 0xcb, 0xed, 0x03, 0xe5, 0x3e, 0x01, 0x05, // .....>.. - 0x01, 0x07, 0xe1, 0xb5, 0x0b, 0x70, 0x00, 0x00, // .....p.. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt29927[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x4c, 0xd6, 0x93, 0xd5, // ./..L... - 0xd6, 0x48, 0x01, 0x00, 0x00, 0x04, 0x24, 0x78, // .H....$x - 0x79, 0xc3, 0x07, 0x09, 0x53, 0x68, 0x69, 0x65, // y...Shie - 0x6c, 0x64, 0xff, 0x11, 0x00, 0x00, 0x00, 0x00, // ld...... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x24, // .......$ - 0xb8, 0xcb, 0xed, 0x03, 0xe5, 0x3e, 0x01, 0x05, // .....>.. - 0x01, 0x07, 0xe1, 0xb5, 0x0b, 0x70, 0x00, 0x00, // .....p.. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt29928[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xa8, 0xc7, 0xb3, 0x4b, // ./.....K - 0x04, 0x00, 0x01, 0x00, 0x24, 0x04, 0x28, 0x32, // ....$.(2 - 0x27, 0xc7, 0x07, 0x09, 0x53, 0x68, 0x69, 0x65, // '...Shie - 0x6c, 0x64, 0x09, 0x03, 0x0a, 0x11, 0x0c, 0x11, // ld...... - 0x0e, 0x11, 0x00, 0x12, 0x01, 0x05, 0x81, 0x07, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt29931[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x4c, 0xd6, 0x93, 0xd5, // ./..L... - 0xd6, 0x48, 0x01, 0x00, 0x00, 0x04, 0x24, 0x78, // .H....$x - 0x79, 0xc8, 0x09, 0x09, 0x48, 0x6f, 0x6d, 0x65, // y...Home - 0x20, 0x4d, 0x61, 0x78, 0x09, 0x03, 0x0b, 0x11, // Max.... - 0x0c, 0x11, 0x0e, 0x11, 0x00, 0x12, 0x01, 0x05, // ........ - 0x01, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt23904[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xf9, 0xe8, 0xa0, 0x26, // ./.....& - 0xe5, 0xee, 0x01, 0x00, 0x04, 0x44, 0x24, 0x4b, // .....D$K - 0x1e, 0xb6, 0x0e, 0x09, 0x4c, 0x52, 0x31, 0x30, // ....LR10 - 0x5f, 0x4e, 0x46, 0x46, 0x5f, 0x65, 0x38, 0x66, // _NFF_e8f - 0x39, 0x09, 0x03, 0x0b, 0x11, 0x0c, 0x11, 0x0e, // 9....... - 0x11, 0x1e, 0x11, 0x51, 0x07, 0xb5, 0xf7, 0x08, // ...Q.... - 0xa7, 0x64, 0xf7, 0x51, 0x89, 0x4c, 0x4c, 0xce, // .d.Q.LL. - 0x24, 0xf7, 0x7f, 0xe9, 0x25, 0x7c, 0x92, 0x67, // $...%|.g - 0x4d, 0x2c, 0xf1, 0x86, 0x88, 0xdb, 0x4f, 0x15, // M,....O. - 0x25, 0x2c, 0xfe, 0x21, 0xdf, 0xb4, 0xf7, 0x08, // %,.!.... - 0xa7, 0x64, 0xf7, 0x51, 0x89, 0x4c, 0x4c, 0xce, // .d.Q.LL. - 0x24, 0xf7, 0x7f, 0xe9, 0x25, 0x85, 0x98, 0xa9, // $...%... - 0x83, 0x48, 0xfe, 0x2f, 0x85, 0x15, 0x41, 0xe5, // .H./..A. - 0xd5, 0x65, 0xcc, 0xe6, 0xfb, 0xf5, 0x21, 0x01, // .e....!. - 0xeb, 0x59, 0x9d, 0x19, 0x86, 0x36, 0x47, 0x26, // .Y...6G& - 0xce, 0xf0, 0x0b, 0x27, 0x4b, 0x00, 0x00, 0x00, // ...'K... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt24033[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xf1, 0x53, 0xf3, 0xfe, // ./...S.. - 0x72, 0x70, 0x01, 0x00, 0x0c, 0x01, 0x28, 0xa0, // rp....(. - 0x2b, 0xc6, 0x1c, 0x09, 0x4d, 0x6f, 0x72, 0x74, // +...Mort - 0x65, 0x7a, 0x61, 0xe2, 0x80, 0x99, 0x73, 0x20, // eza...s - 0x4d, 0x61, 0x63, 0x42, 0x6f, 0x6f, 0x6b, 0x20, // MacBook - 0x50, 0x72, 0x6f, 0x20, 0x28, 0x32, 0x29, 0x0b, // Pro (2). - 0x03, 0x00, 0x12, 0x1f, 0x11, 0x0a, 0x11, 0x0c, // ........ - 0x11, 0x01, 0x18, 0x01, 0x05, 0x01, 0x07, 0x27, // .......' - 0xff, 0x00, 0x4c, 0x02, 0x24, 0x02, 0x00, 0x00, // ..L.$... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt24158[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x5c, 0xfa, 0x47, 0x2c, // ./..\.G, - 0x3a, 0xd4, 0x01, 0x00, 0x0c, 0x42, 0x5a, 0x04, // :....BZ. - 0x72, 0xd6, 0x0b, 0x09, 0x48, 0x69, 0x20, 0x72, // r...Hi r - 0x65, 0x6e, 0x65, 0x73, 0x61, 0x73, 0x19, 0x03, // enesas.. - 0x05, 0x11, 0x0a, 0x11, 0x0c, 0x11, 0x0e, 0x11, // ........ - 0x12, 0x11, 0x15, 0x11, 0x16, 0x11, 0x1f, 0x11, // ........ - 0x2d, 0x11, 0x2f, 0x11, 0x00, 0x12, 0x32, 0x11, // -./...2. - 0x01, 0x05, 0x81, 0x07, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt24446[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x6f, 0xff, 0xf6, 0x11, // ./..o... - 0x8c, 0xfc, 0x01, 0x00, 0x0c, 0x41, 0x2a, 0x03, // .....A*. - 0x64, 0xcc, 0x09, 0x09, 0x4d, 0x53, 0x46, 0x54, // d...MSFT - 0x55, 0x50, 0x46, 0x31, 0x02, 0x0a, 0x0b, 0x0d, // UPF1.... - 0x03, 0x0a, 0x11, 0x0b, 0x11, 0x0c, 0x11, 0x0e, // ........ - 0x11, 0x1f, 0x11, 0x1e, 0x11, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt24658[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xdf, 0xf4, 0x7f, 0x79, // ./.....y - 0x50, 0x7c, 0x01, 0x00, 0x0c, 0x41, 0x2a, 0x66, // P|...A*f - 0x51, 0xc1, 0x10, 0x09, 0x44, 0x45, 0x53, 0x4b, // Q...DESK - 0x54, 0x4f, 0x50, 0x2d, 0x48, 0x4c, 0x48, 0x46, // TOP-HLHF - 0x52, 0x30, 0x49, 0x02, 0x0a, 0x0c, 0x0d, 0x03, // R0I..... - 0x0a, 0x11, 0x0b, 0x11, 0x0c, 0x11, 0x0e, 0x11, // ........ - 0x1f, 0x11, 0x1e, 0x11, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt25745[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xaa, 0xcc, 0x40, 0x6a, // ./....@j - 0x01, 0x43, 0x01, 0x00, 0x04, 0x44, 0x24, 0x82, // .C...D$. - 0x37, 0xc5, 0x06, 0x09, 0x61, 0x34, 0x63, 0x63, // 7...a4cc - 0x63, 0x09, 0x03, 0x0b, 0x11, 0x0c, 0x11, 0x0e, // c....... - 0x11, 0x1e, 0x11, 0x51, 0x07, 0xfb, 0x34, 0x9b, // ...Q..4. - 0x5f, 0x80, 0x00, 0x00, 0x80, 0x00, 0x10, 0x00, // _....... - 0x00, 0x01, 0x11, 0x00, 0x00, 0x7c, 0x92, 0x67, // .....|.g - 0x4d, 0x2c, 0xf1, 0x86, 0x88, 0xdb, 0x4f, 0x15, // M,....O. - 0x25, 0x2c, 0xfe, 0x21, 0xdf, 0x95, 0xa8, 0x7e, // %,.!...~ - 0x16, 0x9f, 0xa6, 0x6d, 0x97, 0x40, 0x4e, 0xe3, // ...m.@N. - 0xb2, 0x66, 0xd6, 0x34, 0x12, 0x15, 0x0e, 0x33, // .f.4...3 - 0xc9, 0x96, 0xff, 0x24, 0x80, 0x34, 0x43, 0x66, // ...$.4Cf - 0x79, 0xe4, 0xfb, 0xd1, 0xf8, 0x51, 0x33, 0x59, // y....Q3Y - 0x88, 0xf9, 0x05, 0xff, 0xa1, 0x3e, 0x44, 0x91, // .....>D. - 0x05, 0x2a, 0xe7, 0xc2, 0x81, 0x00, 0x00, 0x00, // .*...... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt25751[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x15, 0xb8, 0xde, 0xea, // ./...... - 0x5f, 0xac, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x93, // _.....Z. - 0x42, 0xb5, 0x0b, 0x09, 0x4f, 0x6e, 0x65, 0x50, // B...OneP - 0x6c, 0x75, 0x73, 0x20, 0x38, 0x54, 0x17, 0x03, // lus 8T.. - 0x05, 0x11, 0x0a, 0x11, 0x0c, 0x11, 0x0e, 0x11, // ........ - 0x12, 0x11, 0x15, 0x11, 0x16, 0x11, 0x1f, 0x11, // ........ - 0x2f, 0x11, 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, // /...2... - 0x81, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt26171[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xf1, 0x53, 0xf3, 0xfe, // ./...S.. - 0x72, 0x70, 0x01, 0x00, 0x0c, 0x01, 0x28, 0xa1, // rp....(. - 0x2b, 0xb9, 0x1c, 0x09, 0x4d, 0x6f, 0x72, 0x74, // +...Mort - 0x65, 0x7a, 0x61, 0xe2, 0x80, 0x99, 0x73, 0x20, // eza...s - 0x4d, 0x61, 0x63, 0x42, 0x6f, 0x6f, 0x6b, 0x20, // MacBook - 0x50, 0x72, 0x6f, 0x20, 0x28, 0x32, 0x29, 0x0b, // Pro (2). - 0x03, 0x00, 0x12, 0x1f, 0x11, 0x0a, 0x11, 0x0c, // ........ - 0x11, 0x01, 0x18, 0x01, 0x05, 0x01, 0x07, 0x27, // .......' - 0xff, 0x00, 0x4c, 0x02, 0x24, 0x02, 0x00, 0x00, // ..L.$... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt26175[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x51, 0x33, 0x33, 0x22, // ./..Q33" - 0x11, 0x11, 0x01, 0x00, 0x04, 0x44, 0x24, 0xeb, // .....D$. - 0x43, 0xbc, 0x0a, 0x09, 0x42, 0x45, 0x53, 0x2d, // C...BES- - 0x42, 0x52, 0x45, 0x44, 0x52, 0x15, 0x03, 0x01, // BREDR... - 0x00, 0x0e, 0x11, 0x0f, 0x11, 0x0c, 0x11, 0x0b, // ........ - 0x11, 0x1e, 0x11, 0x03, 0x12, 0x08, 0x11, 0x03, // ........ - 0x12, 0x01, 0x11, 0x01, 0x05, 0x01, 0x07, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt26328[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x02, 0x00, 0xf4, 0x35, // ./.....5 - 0x23, 0x48, 0x00, 0x00, 0x18, 0x04, 0x00, 0x3a, // #H.....: - 0x33, 0xc0, 0x0a, 0x09, 0x41, 0x70, 0x70, 0x32, // 3...App2 - 0x5f, 0x30, 0x30, 0x30, 0x32, 0x00, 0x00, 0x00, // _0002... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt26463[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x9f, 0x73, 0x56, 0x2c, // ./...sV, - 0x3a, 0xd4, 0x01, 0x00, 0x0c, 0x42, 0x5a, 0xa5, // :....BZ. - 0x2d, 0xad, 0x08, 0x09, 0x50, 0x69, 0x78, 0x65, // -...Pixe - 0x6c, 0x20, 0x38, 0x19, 0x03, 0x05, 0x11, 0x0a, // l 8..... - 0x11, 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, // ........ - 0x11, 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, // .....-./ - 0x11, 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, // ...2.... - 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt34640[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xd5, 0x29, 0xa3, 0x34, // ./...).4 - 0x29, 0x24, 0x01, 0x00, 0x04, 0x44, 0x24, 0xbf, // )$...D$. - 0x78, 0xcf, 0x1a, 0x09, 0x73, 0x69, 0x64, 0x68, // x...sidh - 0x74, 0x65, 0x73, 0x74, 0x27, 0x73, 0x20, 0x2a, // test's * - 0x2a, 0x2a, 0x2a, 0x2a, 0x20, 0x2a, 0x2a, 0x2a, // **** *** - 0x2a, 0x20, 0x2a, 0x2a, 0x2a, 0x09, 0x03, 0x0b, // * ***... - 0x11, 0x0c, 0x11, 0x0e, 0x11, 0x1e, 0x11, 0x51, // .......Q - 0x07, 0xb5, 0xf7, 0x08, 0xa7, 0x64, 0xf7, 0x51, // .....d.Q - 0x89, 0x4c, 0x4c, 0xce, 0x24, 0xf7, 0x7f, 0xe9, // .LL.$... - 0x25, 0x7c, 0x92, 0x67, 0x4d, 0x2c, 0xf1, 0x86, // %|.gM,.. - 0x88, 0xdb, 0x4f, 0x15, 0x25, 0x2c, 0xfe, 0x21, // ..O.%,.! - 0xdf, 0xb4, 0xf7, 0x08, 0xa7, 0x64, 0xf7, 0x51, // .....d.Q - 0x89, 0x4c, 0x4c, 0xce, 0x24, 0xf7, 0x7f, 0xe9, // .LL.$... - 0x25, 0x15, 0x0e, 0x33, 0xc9, 0x96, 0xff, 0x24, // %..3...$ - 0x80, 0x34, 0x43, 0x66, 0x79, 0xe4, 0xfb, 0xd1, // .4Cfy... - 0xf8, 0x51, 0x33, 0x59, 0x88, 0xf9, 0x05, 0xff, // .Q3Y.... - 0xa1, 0x3e, 0x44, 0x91, 0x05, 0x2a, 0xe7, 0xc2, // .>D..*.. - 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt34666[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x7f, 0xf4, 0xc3, 0x46, // ./.....F - 0x74, 0x74, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x1d, // tt....Z. - 0x6d, 0xc1, 0x08, 0x09, 0x50, 0x69, 0x78, 0x65, // m...Pixe - 0x6c, 0x20, 0x36, 0x19, 0x03, 0x05, 0x11, 0x0a, // l 6..... - 0x11, 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, // ........ - 0x11, 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, // .....-./ - 0x11, 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, // ...2.... - 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt34778[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x7f, 0xf4, 0xc3, 0x46, // ./.....F - 0x74, 0x74, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x1c, // tt....Z. - 0x6d, 0xbf, 0x08, 0x09, 0x50, 0x69, 0x78, 0x65, // m...Pixe - 0x6c, 0x20, 0x36, 0x19, 0x03, 0x05, 0x11, 0x0a, // l 6..... - 0x11, 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, // ........ - 0x11, 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, // .....-./ - 0x11, 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, // ...2.... - 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt34779[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xd5, 0x29, 0xa3, 0x34, // ./...).4 - 0x29, 0x24, 0x01, 0x00, 0x04, 0x44, 0x24, 0xbf, // )$...D$. - 0x78, 0xd1, 0x1a, 0x09, 0x73, 0x69, 0x64, 0x68, // x...sidh - 0x74, 0x65, 0x73, 0x74, 0x27, 0x73, 0x20, 0x2a, // test's * - 0x2a, 0x2a, 0x2a, 0x2a, 0x20, 0x2a, 0x2a, 0x2a, // **** *** - 0x2a, 0x20, 0x2a, 0x2a, 0x2a, 0x09, 0x03, 0x0b, // * ***... - 0x11, 0x0c, 0x11, 0x0e, 0x11, 0x1e, 0x11, 0x51, // .......Q - 0x07, 0xb5, 0xf7, 0x08, 0xa7, 0x64, 0xf7, 0x51, // .....d.Q - 0x89, 0x4c, 0x4c, 0xce, 0x24, 0xf7, 0x7f, 0xe9, // .LL.$... - 0x25, 0x7c, 0x92, 0x67, 0x4d, 0x2c, 0xf1, 0x86, // %|.gM,.. - 0x88, 0xdb, 0x4f, 0x15, 0x25, 0x2c, 0xfe, 0x21, // ..O.%,.! - 0xdf, 0xb4, 0xf7, 0x08, 0xa7, 0x64, 0xf7, 0x51, // .....d.Q - 0x89, 0x4c, 0x4c, 0xce, 0x24, 0xf7, 0x7f, 0xe9, // .LL.$... - 0x25, 0x15, 0x0e, 0x33, 0xc9, 0x96, 0xff, 0x24, // %..3...$ - 0x80, 0x34, 0x43, 0x66, 0x79, 0xe4, 0xfb, 0xd1, // .4Cfy... - 0xf8, 0x51, 0x33, 0x59, 0x88, 0xf9, 0x05, 0xff, // .Q3Y.... - 0xa1, 0x3e, 0x44, 0x91, 0x05, 0x2a, 0xe7, 0xc2, // .>D..*.. - 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt34843[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xd5, 0x29, 0xa3, 0x34, // ./...).4 - 0x29, 0x24, 0x01, 0x00, 0x04, 0x44, 0x24, 0xc0, // )$...D$. - 0x78, 0xd3, 0x1a, 0x09, 0x73, 0x69, 0x64, 0x68, // x...sidh - 0x74, 0x65, 0x73, 0x74, 0x27, 0x73, 0x20, 0x2a, // test's * - 0x2a, 0x2a, 0x2a, 0x2a, 0x20, 0x2a, 0x2a, 0x2a, // **** *** - 0x2a, 0x20, 0x2a, 0x2a, 0x2a, 0x09, 0x03, 0x0b, // * ***... - 0x11, 0x0c, 0x11, 0x0e, 0x11, 0x1e, 0x11, 0x51, // .......Q - 0x07, 0xb5, 0xf7, 0x08, 0xa7, 0x64, 0xf7, 0x51, // .....d.Q - 0x89, 0x4c, 0x4c, 0xce, 0x24, 0xf7, 0x7f, 0xe9, // .LL.$... - 0x25, 0x7c, 0x92, 0x67, 0x4d, 0x2c, 0xf1, 0x86, // %|.gM,.. - 0x88, 0xdb, 0x4f, 0x15, 0x25, 0x2c, 0xfe, 0x21, // ..O.%,.! - 0xdf, 0xb4, 0xf7, 0x08, 0xa7, 0x64, 0xf7, 0x51, // .....d.Q - 0x89, 0x4c, 0x4c, 0xce, 0x24, 0xf7, 0x7f, 0xe9, // .LL.$... - 0x25, 0x15, 0x0e, 0x33, 0xc9, 0x96, 0xff, 0x24, // %..3...$ - 0x80, 0x34, 0x43, 0x66, 0x79, 0xe4, 0xfb, 0xd1, // .4Cfy... - 0xf8, 0x51, 0x33, 0x59, 0x88, 0xf9, 0x05, 0xff, // .Q3Y.... - 0xa1, 0x3e, 0x44, 0x91, 0x05, 0x2a, 0xe7, 0xc2, // .>D..*.. - 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt34847[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x7f, 0xf4, 0xc3, 0x46, // ./.....F - 0x74, 0x74, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x1d, // tt....Z. - 0x6d, 0xc0, 0x08, 0x09, 0x50, 0x69, 0x78, 0x65, // m...Pixe - 0x6c, 0x20, 0x36, 0x19, 0x03, 0x05, 0x11, 0x0a, // l 6..... - 0x11, 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, // ........ - 0x11, 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, // .....-./ - 0x11, 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, // ...2.... - 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt34848[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x8b, 0x6e, 0xf0, 0x85, // ./...n.. - 0xe0, 0x50, 0x01, 0x00, 0x04, 0x01, 0x48, 0x85, // .P....H. - 0x7a, 0xb3, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // z...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt34875[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x7f, 0xf4, 0xc3, 0x46, // ./.....F - 0x74, 0x74, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x1c, // tt....Z. - 0x6d, 0xbd, 0x08, 0x09, 0x50, 0x69, 0x78, 0x65, // m...Pixe - 0x6c, 0x20, 0x36, 0x19, 0x03, 0x05, 0x11, 0x0a, // l 6..... - 0x11, 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, // ........ - 0x11, 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, // .....-./ - 0x11, 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, // ...2.... - 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt19294[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xcb, 0x29, 0xa3, 0x34, // ./...).4 - 0x29, 0x24, 0x01, 0x00, 0x04, 0x44, 0x24, 0x97, // )$...D$. - 0x19, 0xd3, 0x0c, 0x09, 0x41, 0x31, 0x31, 0x5f, // ....A11_ - 0x46, 0x46, 0x5f, 0x32, 0x39, 0x63, 0x62, 0x09, // FF_29cb. - 0x03, 0x0b, 0x11, 0x0c, 0x11, 0x0e, 0x11, 0x1e, // ........ - 0x11, 0x51, 0x07, 0xb5, 0xf7, 0x08, 0xa7, 0x64, // .Q.....d - 0xf7, 0x51, 0x89, 0x4c, 0x4c, 0xce, 0x24, 0xf7, // .Q.LL.$. - 0x7f, 0xe9, 0x25, 0x7c, 0x92, 0x67, 0x4d, 0x2c, // ..%|.gM, - 0xf1, 0x86, 0x88, 0xdb, 0x4f, 0x15, 0x25, 0x2c, // ....O.%, - 0xfe, 0x21, 0xdf, 0xb4, 0xf7, 0x08, 0xa7, 0x64, // .!.....d - 0xf7, 0x51, 0x89, 0x4c, 0x4c, 0xce, 0x24, 0xf7, // .Q.LL.$. - 0x7f, 0xe9, 0x25, 0x15, 0x0e, 0x33, 0xc9, 0x96, // ..%..3.. - 0xff, 0x24, 0x80, 0x34, 0x43, 0x66, 0x79, 0xe4, // .$.4Cfy. - 0xfb, 0xd1, 0xf8, 0x51, 0x33, 0x59, 0x88, 0xf9, // ...Q3Y.. - 0x05, 0xff, 0xa1, 0x3e, 0x44, 0x91, 0x05, 0x2a, // ...>D..* - 0xe7, 0xc2, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt4073[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x52, 0xb4, 0x2e, 0x13, // ./..R... - 0xc4, 0x0c, 0x01, 0x00, 0x0c, 0x42, 0x5a, 0xac, // .....BZ. - 0x1c, 0xd5, 0x4d, 0x09, 0x49, 0x7a, 0x6b, 0x33, // ..M.Izk3 - 0x55, 0x6c, 0x6a, 0x38, 0x6e, 0x31, 0x34, 0x41, // Ulj8n14A - 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, // AAAAAAAA - 0x4b, 0x53, 0x49, 0x66, 0x39, 0x54, 0x71, 0x61, // KSIf9Tqa - 0x51, 0x7a, 0x79, 0x6a, 0x36, 0x78, 0x32, 0x72, // Qzyj6x2r - 0x67, 0x35, 0x46, 0x50, 0x52, 0x50, 0x70, 0x5f, // g5FPRPp_ - 0x46, 0x31, 0x4a, 0x46, 0x51, 0x30, 0x56, 0x4a, // F1JFQ0VJ - 0x56, 0x6b, 0x56, 0x53, 0x4c, 0x54, 0x49, 0x30, // VkVSLTI0 - 0x4d, 0x54, 0x4d, 0x78, 0x52, 0x6b, 0x52, 0x49, // MTMxRkRI - 0x4d, 0x6a, 0x41, 0x77, 0x4d, 0x44, 0x5a, 0x4d, // MjAwMDZM - 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, 0x0c, 0x11, // ........ - 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, 0x16, 0x11, // ........ - 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, 0x00, 0x12, // ..-./... - 0x32, 0x11, 0x01, 0x05, 0x71, 0x06, 0x5a, 0x6c, // 2...q.Zl - 0xb1, 0xa7, 0x6d, 0xf1, 0xbc, 0x9b, 0xde, 0x3d, // ..m....= - 0x5c, 0xae, 0x21, 0xfa, 0x2e, 0xa8, 0x00, 0x00, // \.!..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt4075[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x36, 0x1a, 0x37, 0x08, // ./..6.7. - 0x9e, 0x08, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0xff, // ......Z. - 0x08, 0xd0, 0x4d, 0x09, 0x49, 0x7a, 0x4e, 0x42, // ..M.IzNB - 0x52, 0x31, 0x6a, 0x38, 0x6e, 0x31, 0x34, 0x41, // R1j8n14A - 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, // AAAAAAAA - 0x4b, 0x53, 0x4c, 0x6e, 0x58, 0x75, 0x31, 0x73, // KSLnXu1s - 0x6d, 0x64, 0x54, 0x55, 0x65, 0x4d, 0x50, 0x43, // mdTUeMPC - 0x63, 0x32, 0x35, 0x67, 0x2d, 0x6e, 0x5a, 0x6f, // c25g-nZo - 0x46, 0x31, 0x4a, 0x46, 0x51, 0x30, 0x56, 0x4a, // F1JFQ0VJ - 0x56, 0x6b, 0x56, 0x53, 0x4c, 0x54, 0x41, 0x7a, // VkVSLTAz - 0x4d, 0x54, 0x49, 0x78, 0x53, 0x6b, 0x56, 0x44, // MTIxSkVD - 0x4d, 0x6a, 0x41, 0x77, 0x4d, 0x44, 0x59, 0x31, // MjAwMDY1 - 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, 0x0c, 0x11, // ........ - 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, 0x16, 0x11, // ........ - 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, 0x00, 0x12, // ..-./... - 0x32, 0x11, 0x01, 0x05, 0x71, 0x06, 0x5a, 0x6c, // 2...q.Zl - 0xb1, 0xa7, 0x6d, 0xf1, 0xbc, 0x9b, 0xde, 0x3d, // ..m....= - 0x5c, 0xae, 0x21, 0xfa, 0x2e, 0xa8, 0x00, 0x00, // \.!..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt4883[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x52, 0xb4, 0x2e, 0x13, // ./..R... - 0xc4, 0x0c, 0x01, 0x00, 0x0c, 0x42, 0x5a, 0xac, // .....BZ. - 0x1c, 0xd4, 0x4d, 0x09, 0x49, 0x7a, 0x6b, 0x33, // ..M.Izk3 - 0x55, 0x6c, 0x6a, 0x38, 0x6e, 0x31, 0x34, 0x41, // Ulj8n14A - 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, // AAAAAAAA - 0x4b, 0x53, 0x49, 0x37, 0x31, 0x59, 0x74, 0x6f, // KSI71Yto - 0x4a, 0x52, 0x6b, 0x31, 0x74, 0x72, 0x51, 0x79, // JRk1trQy - 0x4a, 0x77, 0x53, 0x71, 0x65, 0x35, 0x44, 0x45, // JwSqe5DE - 0x46, 0x31, 0x4a, 0x46, 0x51, 0x30, 0x56, 0x4a, // F1JFQ0VJ - 0x56, 0x6b, 0x56, 0x53, 0x4c, 0x54, 0x49, 0x30, // VkVSLTI0 - 0x4d, 0x54, 0x4d, 0x78, 0x52, 0x6b, 0x52, 0x49, // MTMxRkRI - 0x4d, 0x6a, 0x41, 0x77, 0x4d, 0x44, 0x5a, 0x4d, // MjAwMDZM - 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, 0x0c, 0x11, // ........ - 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, 0x16, 0x11, // ........ - 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, 0x00, 0x12, // ..-./... - 0x32, 0x11, 0x01, 0x05, 0x71, 0x06, 0x5a, 0x6c, // 2...q.Zl - 0xb1, 0xa7, 0x6d, 0xf1, 0xbc, 0x9b, 0xde, 0x3d, // ..m....= - 0x5c, 0xae, 0x21, 0xfa, 0x2e, 0xa8, 0x00, 0x00, // \.!..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt7384[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x36, 0x1a, 0x37, 0x08, // ./..6.7. - 0x9e, 0x08, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x00, // ......Z. - 0x09, 0xd1, 0x4d, 0x09, 0x49, 0x30, 0x63, 0x33, // ..M.I0c3 - 0x53, 0x46, 0x6e, 0x38, 0x6e, 0x31, 0x34, 0x41, // SFn8n14A - 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, // AAAAAAAA - 0x4b, 0x53, 0x4c, 0x4e, 0x4b, 0x47, 0x35, 0x41, // KSLNKG5A - 0x43, 0x7a, 0x6a, 0x44, 0x35, 0x4e, 0x43, 0x38, // CzjD5NC8 - 0x68, 0x78, 0x55, 0x45, 0x61, 0x5f, 0x36, 0x74, // hxUEa_6t - 0x46, 0x31, 0x4a, 0x46, 0x51, 0x30, 0x56, 0x4a, // F1JFQ0VJ - 0x56, 0x6b, 0x56, 0x53, 0x4c, 0x54, 0x41, 0x7a, // VkVSLTAz - 0x4d, 0x54, 0x49, 0x78, 0x53, 0x6b, 0x56, 0x44, // MTIxSkVD - 0x4d, 0x6a, 0x41, 0x77, 0x4d, 0x44, 0x59, 0x31, // MjAwMDY1 - 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, 0x0c, 0x11, // ........ - 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, 0x16, 0x11, // ........ - 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, 0x00, 0x12, // ..-./... - 0x32, 0x11, 0x01, 0x05, 0x71, 0x06, 0x5a, 0x6c, // 2...q.Zl - 0xb1, 0xa7, 0x6d, 0xf1, 0xbc, 0x9b, 0xde, 0x3d, // ..m....= - 0x5c, 0xae, 0x21, 0xfa, 0x2e, 0xa8, 0x00, 0x00, // \.!..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt7385[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x52, 0xb4, 0x2e, 0x13, // ./..R... - 0xc4, 0x0c, 0x01, 0x00, 0x0c, 0x42, 0x5a, 0xad, // .....BZ. - 0x1c, 0xd6, 0x4d, 0x09, 0x49, 0x7a, 0x4a, 0x56, // ..M.IzJV - 0x4e, 0x45, 0x6a, 0x38, 0x6e, 0x31, 0x34, 0x41, // NEj8n14A - 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, // AAAAAAAA - 0x4b, 0x53, 0x4a, 0x54, 0x43, 0x67, 0x54, 0x59, // KSJTCgTY - 0x30, 0x34, 0x55, 0x61, 0x54, 0x71, 0x57, 0x37, // 04UaTqW7 - 0x39, 0x78, 0x62, 0x76, 0x5f, 0x37, 0x69, 0x73, // 9xbv_7is - 0x46, 0x31, 0x4a, 0x46, 0x51, 0x30, 0x56, 0x4a, // F1JFQ0VJ - 0x56, 0x6b, 0x56, 0x53, 0x4c, 0x54, 0x49, 0x30, // VkVSLTI0 - 0x4d, 0x54, 0x4d, 0x78, 0x52, 0x6b, 0x52, 0x49, // MTMxRkRI - 0x4d, 0x6a, 0x41, 0x77, 0x4d, 0x44, 0x5a, 0x4d, // MjAwMDZM - 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, 0x0c, 0x11, // ........ - 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, 0x16, 0x11, // ........ - 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, 0x00, 0x12, // ..-./... - 0x32, 0x11, 0x01, 0x05, 0x71, 0x06, 0x5a, 0x6c, // 2...q.Zl - 0xb1, 0xa7, 0x6d, 0xf1, 0xbc, 0x9b, 0xde, 0x3d, // ..m....= - 0x5c, 0xae, 0x21, 0xfa, 0x2e, 0xa8, 0x00, 0x00, // \.!..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10784[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x64, 0x6f, 0x36, 0x08, // ./..do6. - 0x9e, 0x08, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x0d, // ......Z. - 0x0c, 0xbd, 0x0f, 0x09, 0x39, 0x42, 0x32, 0x37, // ....9B27 - 0x31, 0x46, 0x51, 0x43, 0x32, 0x30, 0x30, 0x30, // 1FQC2000 - 0x37, 0x38, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 78...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10786[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xc4, 0xd3, 0x3e, 0x13, // ./....>. - 0xc4, 0x0c, 0x01, 0x00, 0x0c, 0x42, 0x5a, 0xf2, // .....BZ. - 0x6d, 0xd0, 0x0f, 0x09, 0x32, 0x36, 0x31, 0x30, // m...2610 - 0x31, 0x46, 0x44, 0x48, 0x33, 0x30, 0x30, 0x30, // 1FDH3000 - 0x43, 0x39, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // C9...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10787[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x88, 0xc6, 0xd5, 0x46, // ./.....F - 0x74, 0x74, 0x01, 0x00, 0x0c, 0x42, 0x5a, 0x4f, // tt...BZO - 0x3e, 0xe3, 0x0f, 0x09, 0x33, 0x33, 0x31, 0x33, // >...3313 - 0x31, 0x46, 0x44, 0x48, 0x53, 0x30, 0x30, 0x30, // 1FDHS000 - 0x34, 0x4b, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 4K...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10789[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x85, 0xb3, 0x7e, 0x2f, // ./....~/ - 0x95, 0x24, 0x01, 0x00, 0x10, 0x41, 0x5a, 0x3e, // .$...AZ> - 0x38, 0xd1, 0x0f, 0x09, 0x32, 0x36, 0x31, 0x30, // 8...2610 - 0x31, 0x46, 0x44, 0x48, 0x33, 0x30, 0x30, 0x30, // 1FDH3000 - 0x43, 0x39, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // C9...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10799[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x3b, 0x8e, 0x1d, 0x52, // ./..;..R - 0xcb, 0x58, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x33, // .X....Z3 - 0x2f, 0xd5, 0x0b, 0x09, 0x39, 0x33, 0x36, 0x41, // /...936A - 0x58, 0x30, 0x34, 0x57, 0x37, 0x4c, 0x19, 0x03, // X04W7L.. - 0x05, 0x11, 0x0a, 0x11, 0x0c, 0x11, 0x0e, 0x11, // ........ - 0x12, 0x11, 0x15, 0x11, 0x16, 0x11, 0x1f, 0x11, // ........ - 0x2d, 0x11, 0x2f, 0x11, 0x00, 0x12, 0x32, 0x11, // -./...2. - 0x01, 0x05, 0x81, 0x07, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10800[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xf4, 0x9a, 0x38, 0x6e, // ./....8n - 0xb7, 0x60, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x74, // .`....Zt - 0x3f, 0xd6, 0x0f, 0x09, 0x30, 0x42, 0x31, 0x31, // ?...0B11 - 0x31, 0x46, 0x51, 0x43, 0x42, 0x30, 0x30, 0x30, // 1FQCB000 - 0x36, 0x33, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 63...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10801[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x26, 0x75, 0x2f, 0x13, // ./..&u/. - 0xc4, 0x0c, 0x01, 0x00, 0x0c, 0x42, 0x5a, 0xa2, // .....BZ. - 0x6b, 0xc8, 0x0f, 0x09, 0x32, 0x36, 0x31, 0x36, // k...2616 - 0x31, 0x46, 0x44, 0x48, 0x32, 0x30, 0x30, 0x31, // 1FDH2001 - 0x35, 0x59, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 5Y...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x5a, 0x6c, 0xb1, 0xa7, 0x6d, 0xf1, 0xbc, 0x9b, // Zl..m... - 0xde, 0x3d, 0x5c, 0xae, 0x21, 0xfa, 0x2e, 0xa8, // .=\.!... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10804[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x0b, 0x06, 0x7b, 0x43, // ./....{C - 0x37, 0xac, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0xb9, // 7.....Z. - 0x22, 0xcb, 0x0d, 0x09, 0x48, 0x54, 0x36, 0x41, // "...HT6A - 0x36, 0x30, 0x32, 0x30, 0x33, 0x31, 0x33, 0x36, // 60203136 - 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, 0x0c, 0x11, // ........ - 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, 0x16, 0x11, // ........ - 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, 0x00, 0x12, // ..-./... - 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, 0x00, 0x00, // 2....... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10806[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x6f, 0x07, 0xa5, 0x46, // ./..o..F - 0x74, 0x74, 0x01, 0x00, 0x0c, 0x42, 0x5a, 0xa2, // tt...BZ. - 0x12, 0xc9, 0x0f, 0x09, 0x32, 0x37, 0x32, 0x39, // ....2729 - 0x31, 0x46, 0x51, 0x48, 0x4e, 0x30, 0x30, 0x31, // 1FQHN001 - 0x31, 0x33, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 13...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10807[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xe0, 0xd5, 0x3d, 0x1f, // ./....=. - 0x54, 0x88, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x9d, // T.....Z. - 0x6e, 0xe5, 0x0f, 0x09, 0x30, 0x34, 0x33, 0x30, // n...0430 - 0x31, 0x46, 0x51, 0x43, 0x42, 0x30, 0x30, 0x32, // 1FQCB002 - 0x36, 0x34, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 64...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10808[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xa2, 0x70, 0x36, 0x08, // ./...p6. - 0x9e, 0x08, 0x01, 0x00, 0x18, 0x04, 0x34, 0x25, // ......4% - 0x6d, 0xc5, 0x05, 0x09, 0x5a, 0x32, 0x45, 0x77, // m...Z2Ew - 0x11, 0x03, 0x05, 0x11, 0x0b, 0x11, 0x0c, 0x11, // ........ - 0x0e, 0x11, 0x1e, 0x11, 0x2e, 0x11, 0x00, 0x12, // ........ - 0x33, 0x11, 0x01, 0x05, 0x81, 0x07, 0x00, 0x00, // 3....... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10809[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xe4, 0xa5, 0xd5, 0x46, // ./.....F - 0x74, 0x74, 0x01, 0x00, 0x0c, 0x42, 0x5a, 0x49, // tt...BZI - 0x2c, 0xe1, 0x0f, 0x09, 0x33, 0x33, 0x30, 0x37, // ,...3307 - 0x31, 0x46, 0x44, 0x48, 0x53, 0x30, 0x30, 0x30, // 1FDHS000 - 0x36, 0x48, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 6H...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10816[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x86, 0x4b, 0x99, 0x3b, // ./...K.; - 0x22, 0x14, 0x01, 0x00, 0x04, 0x07, 0x2a, 0x3c, // ".....*< - 0x2f, 0xbc, 0x13, 0x09, 0x47, 0x6f, 0x6f, 0x67, // /...Goog - 0x6c, 0x65, 0x20, 0x50, 0x69, 0x78, 0x65, 0x6c, // le Pixel - 0x20, 0x57, 0x61, 0x74, 0x63, 0x68, 0x0d, 0x03, // Watch.. - 0x0a, 0x11, 0x0c, 0x11, 0x0e, 0x11, 0x1e, 0x11, // ........ - 0x1f, 0x11, 0x00, 0x12, 0x01, 0x05, 0x81, 0x07, // ........ - 0x66, 0x9a, 0x0c, 0x20, 0x00, 0x08, 0xe2, 0xa5, // f.. .... - 0xe3, 0x11, 0x25, 0x95, 0xb0, 0x45, 0x89, 0x5e, // ..%..E.^ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10818[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x03, 0xf1, 0xdc, 0x20, // ./..... - 0x8d, 0x3c, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x53, // .<....ZS - 0x16, 0xba, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10821[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x70, 0x30, 0xf4, 0x2b, // ./..p0.+ - 0x1a, 0xf8, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x86, // ......Z. - 0x78, 0xcc, 0x0f, 0x09, 0x32, 0x31, 0x30, 0x36, // x...2106 - 0x31, 0x46, 0x51, 0x47, 0x52, 0x30, 0x30, 0x31, // 1FQGR001 - 0x30, 0x33, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 03...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10823[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x70, 0x31, 0xf4, 0x2b, // ./..p1.+ - 0x1a, 0xf8, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x1c, // ......Z. - 0x61, 0xcd, 0x0f, 0x09, 0x32, 0x31, 0x30, 0x36, // a...2106 - 0x31, 0x46, 0x51, 0x47, 0x52, 0x30, 0x30, 0x31, // 1FQGR001 - 0x30, 0x32, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 02...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10826[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x0d, 0xa2, 0xd5, 0x46, // ./.....F - 0x74, 0x74, 0x01, 0x00, 0x0c, 0x42, 0x5a, 0x9a, // tt...BZ. - 0x14, 0xd8, 0x0f, 0x09, 0x33, 0x33, 0x30, 0x36, // ....3306 - 0x31, 0x46, 0x44, 0x48, 0x53, 0x30, 0x30, 0x30, // 1FDHS000 - 0x37, 0x42, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 7B...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10838[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x61, 0x4a, 0xdd, 0x20, // ./..aJ. - 0x8d, 0x3c, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x03, // .<....Z. - 0x01, 0xbb, 0x0b, 0x09, 0x38, 0x42, 0x4c, 0x41, // ....8BLA - 0x59, 0x30, 0x30, 0x44, 0x55, 0x43, 0x19, 0x03, // Y00DUC.. - 0x05, 0x11, 0x0a, 0x11, 0x0c, 0x11, 0x0e, 0x11, // ........ - 0x12, 0x11, 0x15, 0x11, 0x16, 0x11, 0x1f, 0x11, // ........ - 0x2d, 0x11, 0x2f, 0x11, 0x00, 0x12, 0x32, 0x11, // -./...2. - 0x01, 0x05, 0x81, 0x07, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10839[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x98, 0xc3, 0xf3, 0x2b, // ./.....+ - 0x1a, 0xf8, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x8e, // ......Z. - 0x71, 0xcd, 0x0f, 0x09, 0x32, 0x31, 0x30, 0x36, // q...2106 - 0x31, 0x46, 0x51, 0x47, 0x52, 0x30, 0x30, 0x31, // 1FQGR001 - 0x36, 0x33, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 63...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x5a, 0x6c, 0xb1, 0xa7, 0x6d, 0xf1, 0xbc, 0x9b, // Zl..m... - 0xde, 0x3d, 0x5c, 0xae, 0x21, 0xfa, 0x2e, 0xa8, // .=\.!... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10840[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xda, 0xb2, 0x0a, 0x1f, // ./...... - 0x54, 0x88, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x60, // T.....Z` - 0x34, 0xd2, 0x0f, 0x09, 0x30, 0x34, 0x31, 0x36, // 4...0416 - 0x31, 0x46, 0x51, 0x43, 0x42, 0x30, 0x30, 0x30, // 1FQCB000 - 0x31, 0x32, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 12...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10841[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xaa, 0xb2, 0x0a, 0x1f, // ./...... - 0x54, 0x88, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x96, // T.....Z. - 0x00, 0xd2, 0x0f, 0x09, 0x30, 0x34, 0x31, 0x33, // ....0413 - 0x31, 0x46, 0x51, 0x43, 0x42, 0x30, 0x30, 0x34, // 1FQCB004 - 0x36, 0x36, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 66...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10842[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x6c, 0x9c, 0xdc, 0x5b, // ./..l..[ - 0xe5, 0xdc, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0xfc, // ......Z. - 0x2b, 0xc1, 0x0f, 0x09, 0x31, 0x39, 0x32, 0x30, // +...1920 - 0x31, 0x46, 0x44, 0x45, 0x45, 0x30, 0x30, 0x38, // 1FDEE008 - 0x33, 0x44, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 3D...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x5a, 0x6c, 0xb1, 0xa7, 0x6d, 0xf1, 0xbc, 0x9b, // Zl..m... - 0xde, 0x3d, 0x5c, 0xae, 0x21, 0xfa, 0x2e, 0xa8, // .=\.!... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10843[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x9b, 0xee, 0x36, 0x08, // ./....6. - 0x9e, 0x08, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0xea, // ......Z. - 0x55, 0xd2, 0x0f, 0x09, 0x30, 0x37, 0x32, 0x38, // U...0728 - 0x31, 0x4a, 0x45, 0x43, 0x42, 0x30, 0x30, 0x33, // 1JECB003 - 0x35, 0x37, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 57...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10845[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x10, 0xbe, 0xf3, 0x2b, // ./.....+ - 0x1a, 0xf8, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x53, // ......ZS - 0x51, 0xd0, 0x0f, 0x09, 0x32, 0x31, 0x30, 0x36, // Q...2106 - 0x31, 0x46, 0x51, 0x47, 0x52, 0x30, 0x30, 0x31, // 1FQGR001 - 0x36, 0x34, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 64...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10857[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xaf, 0x05, 0x7b, 0x43, // ./....{C - 0x37, 0xac, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x6b, // 7.....Zk - 0x5f, 0xcc, 0x0d, 0x09, 0x48, 0x54, 0x36, 0x41, // _...HT6A - 0x36, 0x30, 0x32, 0x30, 0x33, 0x31, 0x32, 0x37, // 60203127 - 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, 0x0c, 0x11, // ........ - 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, 0x16, 0x11, // ........ - 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, 0x00, 0x12, // ..-./... - 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, 0x00, 0x00, // 2....... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10858[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x24, 0x4c, 0xd4, 0x29, // ./..$L.) - 0x24, 0x58, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x47, // $X....ZG - 0x41, 0xc0, 0x0f, 0x09, 0x31, 0x37, 0x30, 0x37, // A...1707 - 0x31, 0x46, 0x44, 0x45, 0x45, 0x30, 0x30, 0x32, // 1FDEE002 - 0x33, 0x47, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 3G...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x5a, 0x6c, 0xb1, 0xa7, 0x6d, 0xf1, 0xbc, 0x9b, // Zl..m... - 0xde, 0x3d, 0x5c, 0xae, 0x21, 0xfa, 0x2e, 0xa8, // .=\.!... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10859[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x81, 0x6a, 0x2f, 0x13, // ./...j/. - 0xc4, 0x0c, 0x01, 0x00, 0x0c, 0x42, 0x5a, 0xdc, // .....BZ. - 0x1b, 0xca, 0x0f, 0x09, 0x32, 0x36, 0x31, 0x35, // ....2615 - 0x31, 0x46, 0x44, 0x48, 0x32, 0x30, 0x30, 0x30, // 1FDH2000 - 0x5a, 0x4d, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // ZM...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x5a, 0x6c, 0xb1, 0xa7, 0x6d, 0xf1, 0xbc, 0x9b, // Zl..m... - 0xde, 0x3d, 0x5c, 0xae, 0x21, 0xfa, 0x2e, 0xa8, // .=\.!... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10860[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xe1, 0xd1, 0x3e, 0x13, // ./....>. - 0xc4, 0x0c, 0x01, 0x00, 0x0c, 0x42, 0x5a, 0x40, // .....BZ@ - 0x1a, 0xcc, 0x0f, 0x09, 0x32, 0x36, 0x31, 0x31, // ....2611 - 0x31, 0x46, 0x44, 0x48, 0x33, 0x30, 0x30, 0x30, // 1FDH3000 - 0x34, 0x41, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 4A...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10871[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xac, 0xb8, 0xd5, 0x46, // ./.....F - 0x74, 0x74, 0x01, 0x00, 0x0c, 0x42, 0x5a, 0x44, // tt...BZD - 0x65, 0xe4, 0x0f, 0x09, 0x33, 0x33, 0x30, 0x36, // e...3306 - 0x31, 0x46, 0x44, 0x48, 0x53, 0x30, 0x30, 0x30, // 1FDHS000 - 0x34, 0x45, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 4E...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10872[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xe7, 0x2e, 0xf4, 0x2b, // ./.....+ - 0x1a, 0xf8, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0xf2, // ......Z. - 0x5b, 0xd4, 0x0f, 0x09, 0x32, 0x31, 0x30, 0x36, // [...2106 - 0x31, 0x46, 0x51, 0x47, 0x52, 0x30, 0x30, 0x31, // 1FQGR001 - 0x32, 0x30, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 20...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10874[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x69, 0x98, 0x38, 0x6e, // ./..i.8n - 0xb7, 0x60, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0xe6, // .`....Z. - 0x0a, 0xcc, 0x0f, 0x09, 0x30, 0x42, 0x31, 0x31, // ....0B11 - 0x31, 0x46, 0x51, 0x43, 0x42, 0x30, 0x30, 0x31, // 1FQCB001 - 0x30, 0x38, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 08...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x5a, 0x6c, 0xb1, 0xa7, 0x6d, 0xf1, 0xbc, 0x9b, // Zl..m... - 0xde, 0x3d, 0x5c, 0xae, 0x21, 0xfa, 0x2e, 0xa8, // .=\.!... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10876[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x98, 0x6b, 0x36, 0x08, // ./...... - 0x9e, 0x08, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x65, // ......Ze - 0x27, 0xc9, 0x0f, 0x09, 0x39, 0x42, 0x32, 0x37, // '...9B27 - 0x31, 0x46, 0x51, 0x43, 0x32, 0x30, 0x30, 0x32, // 1FQC2002 - 0x34, 0x37, 0x17, 0x03, 0x05, 0x11, 0x0a, 0x11, // 47...... - 0x0c, 0x11, 0x12, 0x11, 0x15, 0x11, 0x16, 0x11, // ........ - 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, 0x00, 0x12, // ..-./... - 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, 0x00, 0x00, // 2....... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10877[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x73, 0x94, 0xf3, 0x2b, // ./..s..+ - 0x1a, 0xf8, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0xab, // ......Z. - 0x12, 0xd6, 0x0f, 0x09, 0x31, 0x39, 0x32, 0x37, // ....1927 - 0x31, 0x46, 0x51, 0x47, 0x52, 0x30, 0x30, 0x30, // 1FQGR000 - 0x32, 0x38, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 28...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x5a, 0x6c, 0xb1, 0xa7, 0x6d, 0xf1, 0xbc, 0x9b, // Zl..m... - 0xde, 0x3d, 0x5c, 0xae, 0x21, 0xfa, 0x2e, 0xa8, // .=\.!... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10887[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xe9, 0x6e, 0x36, 0x08, // ./...n6. - 0x9e, 0x08, 0x01, 0x00, 0x18, 0x04, 0x34, 0x62, // ......4b - 0x35, 0xc6, 0x05, 0x09, 0x4b, 0x6c, 0x54, 0x76, // 5...KlTv - 0x11, 0x03, 0x05, 0x11, 0x0b, 0x11, 0x0c, 0x11, // ........ - 0x0e, 0x11, 0x1e, 0x11, 0x2e, 0x11, 0x00, 0x12, // ........ - 0x33, 0x11, 0x01, 0x05, 0x81, 0x07, 0x00, 0x00, // 3....... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10888[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x72, 0x70, 0x36, 0x08, // ./..rp6. - 0x9e, 0x08, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x7b, // ......Z{ - 0x39, 0xcd, 0x0f, 0x09, 0x39, 0x43, 0x30, 0x34, // 9...9C04 - 0x31, 0x46, 0x51, 0x43, 0x32, 0x30, 0x30, 0x33, // 1FQC2003 - 0x30, 0x38, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 08...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x5a, 0x6c, 0xb1, 0xa7, 0x6d, 0xf1, 0xbc, 0x9b, // Zl..m... - 0xde, 0x3d, 0x5c, 0xae, 0x21, 0xfa, 0x2e, 0xa8, // .=\.!... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10890[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x5a, 0x6d, 0x36, 0x08, // ./..Zm6. - 0x9e, 0x08, 0x01, 0x00, 0x18, 0x04, 0x34, 0xc4, // ......4. - 0x5c, 0xc8, 0x05, 0x09, 0x50, 0x4e, 0x54, 0x39, // \...PNT9 - 0x11, 0x03, 0x05, 0x11, 0x0b, 0x11, 0x0c, 0x11, // ........ - 0x0e, 0x11, 0x1e, 0x11, 0x2e, 0x11, 0x00, 0x12, // ........ - 0x33, 0x11, 0x01, 0x05, 0x81, 0x07, 0x00, 0x00, // 3....... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10891[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xd8, 0x8b, 0x3e, 0x13, // ./....>. - 0xc4, 0x0c, 0x01, 0x00, 0x0c, 0x42, 0x5a, 0x26, // .....BZ& - 0x3c, 0xc5, 0x0f, 0x09, 0x32, 0x36, 0x31, 0x31, // <...2611 - 0x31, 0x46, 0x44, 0x48, 0x33, 0x30, 0x30, 0x30, // 1FDH3000 - 0x31, 0x38, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 18...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10893[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x36, 0xcc, 0xa4, 0x46, // ./..6..F - 0x74, 0x74, 0x01, 0x00, 0x0c, 0x42, 0x5a, 0xe3, // tt...BZ. - 0x38, 0xcd, 0x0f, 0x09, 0x32, 0x39, 0x30, 0x38, // 8...2908 - 0x31, 0x46, 0x51, 0x48, 0x4e, 0x30, 0x30, 0x31, // 1FQHN001 - 0x35, 0x34, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 54...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10895[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x59, 0x80, 0x36, 0x08, // ./..Y.6. - 0x9e, 0x08, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x47, // ......ZG - 0x17, 0xcd, 0x0f, 0x09, 0x39, 0x43, 0x31, 0x32, // ....9C12 - 0x31, 0x46, 0x51, 0x43, 0x32, 0x30, 0x30, 0x32, // 1FQC2002 - 0x33, 0x32, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 32...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10904[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x5f, 0xc8, 0xdc, 0x20, // ./.._.. - 0x8d, 0x3c, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x8f, // .<....Z. - 0x1c, 0xc3, 0x0b, 0x09, 0x38, 0x39, 0x4e, 0x41, // ....89NA - 0x58, 0x30, 0x30, 0x36, 0x45, 0x4a, 0x19, 0x03, // X006EJ.. - 0x05, 0x11, 0x0a, 0x11, 0x0c, 0x11, 0x0e, 0x11, // ........ - 0x12, 0x11, 0x15, 0x11, 0x16, 0x11, 0x1f, 0x11, // ........ - 0x2d, 0x11, 0x2f, 0x11, 0x00, 0x12, 0x32, 0x11, // -./...2. - 0x01, 0x05, 0x81, 0x07, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10906[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xad, 0xad, 0x36, 0x08, // ./....6. - 0x9e, 0x08, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x73, // ......Zs - 0x44, 0xdf, 0x0f, 0x09, 0x30, 0x31, 0x30, 0x38, // D...0108 - 0x31, 0x46, 0x51, 0x43, 0x32, 0x30, 0x30, 0x37, // 1FQC2007 - 0x34, 0x37, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 47...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10910[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x5d, 0x39, 0x57, 0x2c, // ./..]9W, - 0x3a, 0xd4, 0x01, 0x00, 0x0c, 0x42, 0x5a, 0x5b, // :....BZ[ - 0x71, 0xc7, 0x0f, 0x09, 0x33, 0x33, 0x31, 0x34, // q...3314 - 0x31, 0x46, 0x44, 0x4a, 0x47, 0x30, 0x30, 0x30, // 1FDJG000 - 0x50, 0x41, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // PA...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10911[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xf8, 0x4a, 0xd4, 0x29, // ./...J.) - 0x24, 0x58, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x0d, // $X....Z. - 0x1a, 0xd1, 0x0f, 0x09, 0x31, 0x37, 0x30, 0x37, // ....1707 - 0x31, 0x46, 0x44, 0x45, 0x45, 0x30, 0x30, 0x32, // 1FDEE002 - 0x34, 0x47, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 4G...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x5a, 0x6c, 0xb1, 0xa7, 0x6d, 0xf1, 0xbc, 0x9b, // Zl..m... - 0xde, 0x3d, 0x5c, 0xae, 0x21, 0xfa, 0x2e, 0xa8, // .=\.!... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10915[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x93, 0x02, 0xd4, 0x29, // ./.....) - 0x24, 0x58, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x24, // $X....Z$ - 0x77, 0xd2, 0x0f, 0x09, 0x31, 0x34, 0x32, 0x38, // w...1428 - 0x31, 0x46, 0x44, 0x45, 0x45, 0x30, 0x30, 0x30, // 1FDEE000 - 0x44, 0x47, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // DG...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x5a, 0x6c, 0xb1, 0xa7, 0x6d, 0xf1, 0xbc, 0x9b, // Zl..m... - 0xde, 0x3d, 0x5c, 0xae, 0x21, 0xfa, 0x2e, 0xa8, // .=\.!... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10916[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x5a, 0x75, 0x39, 0x6e, // ./..Zu9n - 0xb7, 0x60, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x45, // .`....ZE - 0x3a, 0xdb, 0x0f, 0x09, 0x31, 0x34, 0x32, 0x30, // :...1420 - 0x31, 0x4a, 0x45, 0x43, 0x42, 0x30, 0x30, 0x32, // 1JECB002 - 0x34, 0x32, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 42...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x5a, 0x6c, 0xb1, 0xa7, 0x6d, 0xf1, 0xbc, 0x9b, // Zl..m... - 0xde, 0x3d, 0x5c, 0xae, 0x21, 0xfa, 0x2e, 0xa8, // .=\.!... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10922[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x31, 0x5b, 0x7f, 0x2f, // ./..1[./ - 0x95, 0x24, 0x01, 0x00, 0x10, 0x41, 0x5a, 0xf1, // .$...AZ. - 0x19, 0xd4, 0x0f, 0x09, 0x33, 0x32, 0x30, 0x32, // ....3202 - 0x31, 0x30, 0x35, 0x48, 0x38, 0x30, 0x33, 0x43, // 105H803C - 0x4e, 0x57, 0x13, 0x03, 0x05, 0x11, 0x0a, 0x11, // NW...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x00, 0x12, 0x01, 0x05, // ........ - 0x81, 0x07, 0x5a, 0x6c, 0xb1, 0xa7, 0x6d, 0xf1, // ..Zl..m. - 0xbc, 0x9b, 0xde, 0x3d, 0x5c, 0xae, 0x21, 0xfa, // ...=\.!. - 0x2e, 0xa8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10927[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x4d, 0x7a, 0x4f, 0x52, // ./..MzOR - 0xcb, 0x58, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0xd9, // .X....Z. - 0x45, 0xcd, 0x0b, 0x09, 0x39, 0x35, 0x39, 0x41, // E...959A - 0x58, 0x30, 0x46, 0x36, 0x4a, 0x5a, 0x19, 0x03, // X0F6JZ.. - 0x05, 0x11, 0x0a, 0x11, 0x0c, 0x11, 0x0e, 0x11, // ........ - 0x12, 0x11, 0x15, 0x11, 0x16, 0x11, 0x1f, 0x11, // ........ - 0x2d, 0x11, 0x2f, 0x11, 0x00, 0x12, 0x32, 0x11, // -./...2. - 0x01, 0x05, 0x81, 0x07, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10928[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x34, 0x64, 0x3e, 0x13, // ./..4d>. - 0xc4, 0x0c, 0x01, 0x00, 0x0c, 0x42, 0x5a, 0xc4, // .....BZ. - 0x7d, 0xd1, 0x0f, 0x09, 0x32, 0x35, 0x30, 0x35, // }...2505 - 0x31, 0x46, 0x44, 0x48, 0x33, 0x30, 0x30, 0x30, // 1FDH3000 - 0x34, 0x37, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 47...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x5a, 0x6c, 0xb1, 0xa7, 0x6d, 0xf1, 0xbc, 0x9b, // Zl..m... - 0xde, 0x3d, 0x5c, 0xae, 0x21, 0xfa, 0x2e, 0xa8, // .=\.!... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10930[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x23, 0x47, 0x04, 0x36, // ./..#G.6 - 0x4e, 0x40, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x8b, // N@....Z. - 0x45, 0xcb, 0x0d, 0x09, 0x48, 0x54, 0x37, 0x33, // E...HT73 - 0x52, 0x31, 0x41, 0x30, 0x30, 0x30, 0x30, 0x35, // R1A00005 - 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, 0x0c, 0x11, // ........ - 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, 0x16, 0x11, // ........ - 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, 0x00, 0x12, // ..-./... - 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, 0x00, 0x00, // 2....... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10931[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xb2, 0x65, 0xdd, 0x20, // ./...e. - 0x8d, 0x3c, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0xe8, // .<....Z. - 0x45, 0xc7, 0x0b, 0x09, 0x38, 0x39, 0x4e, 0x41, // E...89NA - 0x59, 0x30, 0x30, 0x38, 0x32, 0x44, 0x19, 0x03, // Y0082D.. - 0x05, 0x11, 0x0a, 0x11, 0x0c, 0x11, 0x0e, 0x11, // ........ - 0x12, 0x11, 0x15, 0x11, 0x16, 0x11, 0x1f, 0x11, // ........ - 0x2d, 0x11, 0x2f, 0x11, 0x00, 0x12, 0x32, 0x11, // -./...2. - 0x01, 0x05, 0x81, 0x07, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10932[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x62, 0x38, 0xd5, 0x46, // ./..b8.F - 0x74, 0x74, 0x01, 0x00, 0x0c, 0x42, 0x5a, 0xc7, // tt...BZ. - 0x2e, 0xca, 0x0f, 0x09, 0x33, 0x32, 0x30, 0x34, // ....3204 - 0x31, 0x46, 0x44, 0x48, 0x53, 0x30, 0x30, 0x30, // 1FDHS000 - 0x36, 0x59, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 6Y...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10934[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x06, 0x82, 0x52, 0x52, // ./....RR - 0xcb, 0x58, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x44, // .X....ZD - 0x28, 0xca, 0x0b, 0x09, 0x39, 0x36, 0x4b, 0x41, // (...96KA - 0x58, 0x30, 0x48, 0x32, 0x5a, 0x32, 0x19, 0x03, // X0H2Z2.. - 0x05, 0x11, 0x0a, 0x11, 0x0c, 0x11, 0x0e, 0x11, // ........ - 0x12, 0x11, 0x15, 0x11, 0x16, 0x11, 0x1f, 0x11, // ........ - 0x2d, 0x11, 0x2f, 0x11, 0x00, 0x12, 0x32, 0x11, // -./...2. - 0x01, 0x05, 0x81, 0x07, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10940[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x30, 0xcb, 0xd5, 0x46, // ./..0..F - 0x74, 0x74, 0x01, 0x00, 0x0c, 0x42, 0x5a, 0x8d, // tt...BZ. - 0x7c, 0xe3, 0x0f, 0x09, 0x33, 0x33, 0x31, 0x33, // |...3313 - 0x31, 0x46, 0x44, 0x48, 0x53, 0x30, 0x30, 0x30, // 1FDHS000 - 0x34, 0x35, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 45...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10952[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xae, 0xee, 0x55, 0x52, // ./....UR - 0xcb, 0x58, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0xbb, // .X....Z. - 0x1d, 0xc2, 0x0b, 0x09, 0x39, 0x39, 0x47, 0x41, // ....99GA - 0x58, 0x30, 0x4b, 0x42, 0x44, 0x31, 0x19, 0x03, // X0KBD1.. - 0x05, 0x11, 0x0a, 0x11, 0x0c, 0x11, 0x0e, 0x11, // ........ - 0x12, 0x11, 0x15, 0x11, 0x16, 0x11, 0x1f, 0x11, // ........ - 0x2d, 0x11, 0x2f, 0x11, 0x00, 0x12, 0x32, 0x11, // -./...2. - 0x01, 0x05, 0x81, 0x07, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10953[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xec, 0xd5, 0x3d, 0x1f, // ./....=. - 0x54, 0x88, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0xe7, // T.....Z. - 0x57, 0xd8, 0x0f, 0x09, 0x30, 0x34, 0x33, 0x30, // W...0430 - 0x31, 0x46, 0x51, 0x43, 0x42, 0x30, 0x30, 0x32, // 1FQCB002 - 0x36, 0x30, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 60...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10959[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xa7, 0x67, 0xdd, 0x20, // ./...g. - 0x8d, 0x3c, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0xe6, // .<....Z. - 0x0e, 0xc3, 0x0b, 0x09, 0x38, 0x39, 0x37, 0x41, // ....897A - 0x59, 0x30, 0x30, 0x31, 0x5a, 0x58, 0x17, 0x03, // Y001ZX.. - 0x05, 0x11, 0x0a, 0x11, 0x0c, 0x11, 0x12, 0x11, // ........ - 0x15, 0x11, 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, // ......-. - 0x2f, 0x11, 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, // /...2... - 0x81, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10962[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x18, 0xae, 0xdd, 0x29, // ./.....) - 0x24, 0x58, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0xbe, // $X....Z. - 0x50, 0xcc, 0x0f, 0x09, 0x31, 0x37, 0x31, 0x33, // P...1713 - 0x31, 0x46, 0x44, 0x46, 0x36, 0x30, 0x30, 0x30, // 1FDF6000 - 0x43, 0x4a, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // CJ...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10965[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x2a, 0x4e, 0xd4, 0x29, // ./..*N.) - 0x24, 0x58, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0xa1, // $X....Z. - 0x38, 0xcb, 0x0f, 0x09, 0x31, 0x37, 0x30, 0x37, // 8...1707 - 0x31, 0x46, 0x44, 0x45, 0x45, 0x30, 0x30, 0x32, // 1FDEE002 - 0x39, 0x32, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 92...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x5a, 0x6c, 0xb1, 0xa7, 0x6d, 0xf1, 0xbc, 0x9b, // Zl..m... - 0xde, 0x3d, 0x5c, 0xae, 0x21, 0xfa, 0x2e, 0xa8, // .=\.!... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10967[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xa8, 0x4f, 0xd4, 0x29, // ./...O.) - 0x24, 0x58, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x23, // $X....Z# - 0x47, 0xc4, 0x0f, 0x09, 0x31, 0x37, 0x30, 0x37, // G...1707 - 0x31, 0x46, 0x44, 0x45, 0x45, 0x30, 0x30, 0x32, // 1FDEE002 - 0x36, 0x42, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 6B...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10973[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x9f, 0x98, 0x38, 0x6e, // ./....8n - 0xb7, 0x60, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0xf4, // .`....Z. - 0x2c, 0xcf, 0x0f, 0x09, 0x30, 0x42, 0x31, 0x31, // ,...0B11 - 0x31, 0x46, 0x51, 0x43, 0x42, 0x30, 0x30, 0x30, // 1FQCB000 - 0x38, 0x39, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 89...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10976[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x85, 0x6f, 0x36, 0x08, // ./...o6. - 0x9e, 0x08, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x32, // ......Z2 - 0x0c, 0xc8, 0x0f, 0x09, 0x39, 0x42, 0x32, 0x37, // ....9B27 - 0x31, 0x46, 0x51, 0x43, 0x32, 0x30, 0x30, 0x31, // 1FQC2001 - 0x39, 0x33, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 93...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x5a, 0x6c, 0xb1, 0xa7, 0x6d, 0xf1, 0xbc, 0x9b, // Zl..m... - 0xde, 0x3d, 0x5c, 0xae, 0x21, 0xfa, 0x2e, 0xa8, // .=\.!... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10982[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x79, 0xb0, 0x7e, 0x2f, // ./..y.~/ - 0x95, 0x24, 0x01, 0x00, 0x10, 0x41, 0x5a, 0x66, // .$...AZf - 0x05, 0xca, 0x0f, 0x09, 0x33, 0x32, 0x30, 0x32, // ....3202 - 0x31, 0x30, 0x35, 0x48, 0x38, 0x30, 0x31, 0x31, // 105H8011 - 0x4e, 0x31, 0x13, 0x03, 0x05, 0x11, 0x0a, 0x11, // N1...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x00, 0x12, 0x01, 0x05, // ........ - 0x81, 0x07, 0x5a, 0x6c, 0xb1, 0xa7, 0x6d, 0xf1, // ..Zl..m. - 0xbc, 0x9b, 0xde, 0x3d, 0x5c, 0xae, 0x21, 0xfa, // ...=\.!. - 0x2e, 0xa8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10984[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x82, 0xba, 0xdc, 0x20, // ./..... - 0x8d, 0x3c, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x93, // .<....Z. - 0x47, 0xc8, 0x0b, 0x09, 0x38, 0x39, 0x4d, 0x41, // G...89MA - 0x58, 0x30, 0x30, 0x36, 0x34, 0x34, 0x19, 0x03, // X00644.. - 0x05, 0x11, 0x0a, 0x11, 0x0c, 0x11, 0x0e, 0x11, // ........ - 0x12, 0x11, 0x15, 0x11, 0x16, 0x11, 0x1f, 0x11, // ........ - 0x2d, 0x11, 0x2f, 0x11, 0x00, 0x12, 0x32, 0x11, // -./...2. - 0x01, 0x05, 0x81, 0x07, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10986[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xa9, 0x51, 0x2f, 0x13, // ./...Q/. - 0xc4, 0x0c, 0x01, 0x00, 0x0c, 0x42, 0x5a, 0xba, // .....BZ. - 0x30, 0xc3, 0x0f, 0x09, 0x32, 0x36, 0x31, 0x36, // 0...2616 - 0x31, 0x46, 0x44, 0x48, 0x32, 0x30, 0x30, 0x31, // 1FDH2001 - 0x36, 0x31, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 61...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x5a, 0x6c, 0xb1, 0xa7, 0x6d, 0xf1, 0xbc, 0x9b, // Zl..m... - 0xde, 0x3d, 0x5c, 0xae, 0x21, 0xfa, 0x2e, 0xa8, // .=\.!... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10987[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xf5, 0xd5, 0x3d, 0x1f, // ./....=. - 0x54, 0x88, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x20, // T.....Z - 0x17, 0xd9, 0x0f, 0x09, 0x30, 0x34, 0x33, 0x30, // ....0430 - 0x31, 0x46, 0x51, 0x43, 0x42, 0x30, 0x30, 0x31, // 1FQCB001 - 0x35, 0x35, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 55...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10997[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xd7, 0xb2, 0x0a, 0x1f, // ./...... - 0x54, 0x88, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0xb9, // T.....Z. - 0x08, 0xd4, 0x0f, 0x09, 0x30, 0x34, 0x31, 0x36, // ....0416 - 0x31, 0x46, 0x51, 0x43, 0x42, 0x30, 0x30, 0x31, // 1FQCB001 - 0x30, 0x32, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 02...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt10999[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xc6, 0xcf, 0x0a, 0x1f, // ./...... - 0x54, 0x88, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x7f, // T.....Z. - 0x26, 0xd7, 0x0f, 0x09, 0x30, 0x36, 0x31, 0x30, // &...0610 - 0x31, 0x46, 0x51, 0x43, 0x42, 0x30, 0x30, 0x33, // 1FQCB003 - 0x34, 0x33, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 43...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt11008[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xd6, 0xb0, 0x2e, 0x13, // ./...... - 0xc4, 0x0c, 0x01, 0x00, 0x0c, 0x42, 0x5a, 0x58, // .....BZX - 0x73, 0xd3, 0x0f, 0x09, 0x32, 0x31, 0x30, 0x35, // s...2105 - 0x31, 0x46, 0x44, 0x48, 0x32, 0x30, 0x30, 0x30, // 1FDH2000 - 0x33, 0x36, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 36...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x5a, 0x6c, 0xb1, 0xa7, 0x6d, 0xf1, 0xbc, 0x9b, // Zl..m... - 0xde, 0x3d, 0x5c, 0xae, 0x21, 0xfa, 0x2e, 0xa8, // .=\.!... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt11009[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xd9, 0x91, 0x57, 0x2c, // ./....W, - 0x3a, 0xd4, 0x01, 0x00, 0x0c, 0x42, 0x5a, 0xa9, // :....BZ. - 0x06, 0xc1, 0x0f, 0x09, 0x33, 0x33, 0x31, 0x36, // ....3316 - 0x31, 0x46, 0x44, 0x4a, 0x47, 0x30, 0x30, 0x30, // 1FDJG000 - 0x38, 0x31, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 81...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt11020[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xbc, 0x67, 0xdd, 0x20, // ./...g. - 0x8d, 0x3c, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x0e, // .<....Z. - 0x06, 0xc8, 0x0b, 0x09, 0x38, 0x39, 0x37, 0x41, // ....897A - 0x59, 0x30, 0x30, 0x32, 0x30, 0x34, 0x19, 0x03, // Y00204.. - 0x05, 0x11, 0x0a, 0x11, 0x0c, 0x11, 0x0e, 0x11, // ........ - 0x12, 0x11, 0x15, 0x11, 0x16, 0x11, 0x1f, 0x11, // ........ - 0x2d, 0x11, 0x2f, 0x11, 0x00, 0x12, 0x32, 0x11, // -./...2. - 0x01, 0x05, 0x81, 0x07, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt11021[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x88, 0x8f, 0x1d, 0x52, // ./.....R - 0xcb, 0x58, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x2a, // .X....Z* - 0x75, 0xb9, 0x0b, 0x09, 0x39, 0x33, 0x36, 0x41, // u...936A - 0x58, 0x30, 0x34, 0x55, 0x4b, 0x33, 0x19, 0x03, // X04UK3.. - 0x05, 0x11, 0x0a, 0x11, 0x0c, 0x11, 0x0e, 0x11, // ........ - 0x12, 0x11, 0x15, 0x11, 0x16, 0x11, 0x1f, 0x11, // ........ - 0x2d, 0x11, 0x2f, 0x11, 0x00, 0x12, 0x32, 0x11, // -./...2. - 0x01, 0x05, 0x81, 0x07, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt11023[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xe3, 0xd5, 0x3d, 0x1f, // ./....=. - 0x54, 0x88, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x8b, // T.....Z. - 0x5f, 0xd3, 0x0f, 0x09, 0x30, 0x34, 0x33, 0x30, // _...0430 - 0x31, 0x46, 0x51, 0x43, 0x42, 0x30, 0x30, 0x31, // 1FQCB001 - 0x33, 0x39, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 39...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt11025[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xf5, 0xdf, 0x3e, 0x13, // ./....>. - 0xc4, 0x0c, 0x01, 0x00, 0x0c, 0x42, 0x5a, 0xee, // .....BZ. - 0x37, 0xc8, 0x0f, 0x09, 0x32, 0x36, 0x31, 0x31, // 7...2611 - 0x31, 0x46, 0x44, 0x48, 0x33, 0x30, 0x30, 0x30, // 1FDH3000 - 0x33, 0x46, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 3F...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt11039[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xeb, 0xd2, 0xa4, 0x46, // ./.....F - 0x74, 0x74, 0x01, 0x00, 0x0c, 0x42, 0x5a, 0x5b, // tt...BZ[ - 0x6f, 0xcc, 0x0f, 0x09, 0x32, 0x39, 0x30, 0x38, // o...2908 - 0x31, 0x46, 0x51, 0x48, 0x4e, 0x30, 0x30, 0x31, // 1FQHN001 - 0x32, 0x34, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 24...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt11047[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x85, 0xb3, 0x7e, 0x2f, // ./....~/ - 0x95, 0x24, 0x01, 0x00, 0x10, 0x41, 0x5a, 0x3e, // .$...AZ> - 0x38, 0xce, 0x0f, 0x09, 0x33, 0x32, 0x30, 0x32, // 8...3202 - 0x31, 0x30, 0x35, 0x48, 0x38, 0x30, 0x31, 0x4c, // 105H801L - 0x47, 0x4d, 0x13, 0x03, 0x05, 0x11, 0x0a, 0x11, // GM...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x00, 0x12, 0x01, 0x05, // ........ - 0x81, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt11048[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x03, 0xf1, 0xdc, 0x20, // ./..... - 0x8d, 0x3c, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x53, // .<....ZS - 0x16, 0xb2, 0x0b, 0x09, 0x38, 0x39, 0x4d, 0x41, // ....89MA - 0x58, 0x30, 0x30, 0x35, 0x5a, 0x42, 0x19, 0x03, // X005ZB.. - 0x05, 0x11, 0x0a, 0x11, 0x0c, 0x11, 0x0e, 0x11, // ........ - 0x12, 0x11, 0x15, 0x11, 0x16, 0x11, 0x1f, 0x11, // ........ - 0x2d, 0x11, 0x2f, 0x11, 0x00, 0x12, 0x32, 0x11, // -./...2. - 0x01, 0x05, 0x81, 0x07, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt11049[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xdb, 0x04, 0x7b, 0x43, // ./....{C - 0x37, 0xac, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0xff, // 7.....Z. - 0x56, 0xce, 0x0d, 0x09, 0x48, 0x54, 0x36, 0x41, // V...HT6A - 0x36, 0x30, 0x32, 0x30, 0x33, 0x30, 0x39, 0x34, // 60203094 - 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, 0x0c, 0x11, // ........ - 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, 0x16, 0x11, // ........ - 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, 0x00, 0x12, // ..-./... - 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, 0x00, 0x00, // 2....... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt11067[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x90, 0x60, 0xdd, 0x20, // ./...`. - 0x8d, 0x3c, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x94, // .<....Z. - 0x2f, 0xbb, 0x0b, 0x09, 0x38, 0x39, 0x4c, 0x41, // /...89LA - 0x59, 0x30, 0x30, 0x37, 0x35, 0x33, 0x19, 0x03, // Y00753.. - 0x05, 0x11, 0x0a, 0x11, 0x0c, 0x11, 0x0e, 0x11, // ........ - 0x12, 0x11, 0x15, 0x11, 0x16, 0x11, 0x1f, 0x11, // ........ - 0x2d, 0x11, 0x2f, 0x11, 0x00, 0x12, 0x32, 0x11, // -./...2. - 0x01, 0x05, 0x81, 0x07, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt11080[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xdf, 0x8c, 0x1d, 0x52, // ./.....R - 0xcb, 0x58, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0xcd, // .X....Z. - 0x39, 0xbb, 0x0b, 0x09, 0x39, 0x33, 0x36, 0x41, // 9...936A - 0x58, 0x30, 0x34, 0x56, 0x31, 0x4e, 0x19, 0x03, // X04V1N.. - 0x05, 0x11, 0x0a, 0x11, 0x0c, 0x11, 0x0e, 0x11, // ........ - 0x12, 0x11, 0x15, 0x11, 0x16, 0x11, 0x1f, 0x11, // ........ - 0x2d, 0x11, 0x2f, 0x11, 0x00, 0x12, 0x32, 0x11, // -./...2. - 0x01, 0x05, 0x81, 0x07, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt11081[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x8a, 0xcf, 0x2e, 0x13, // ./...... - 0xc4, 0x0c, 0x01, 0x00, 0x0c, 0x42, 0x5a, 0xd6, // .....BZ. - 0x1b, 0xbe, 0x0f, 0x09, 0x32, 0x34, 0x32, 0x35, // ....2425 - 0x31, 0x46, 0x44, 0x48, 0x32, 0x30, 0x30, 0x31, // 1FDH2001 - 0x32, 0x58, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 2X...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt11083[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x74, 0x4b, 0x7f, 0x2f, // ./..tK./ - 0x95, 0x24, 0x01, 0x00, 0x10, 0x41, 0x5a, 0xb0, // .$...AZ. - 0x0b, 0xc4, 0x0f, 0x09, 0x33, 0x32, 0x30, 0x32, // ....3202 - 0x31, 0x30, 0x35, 0x48, 0x38, 0x30, 0x32, 0x30, // 105H8020 - 0x51, 0x4c, 0x13, 0x03, 0x05, 0x11, 0x0a, 0x11, // QL...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x00, 0x12, 0x01, 0x05, // ........ - 0x81, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt11092[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x18, 0x6d, 0x36, 0x08, // ./...m6. - 0x9e, 0x08, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x57, // ......ZW - 0x28, 0xc9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // (....... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt11093[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x5a, 0x7c, 0x36, 0x08, // ./..Z|6. - 0x9e, 0x08, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0xaa, // ......Z. - 0x4c, 0xc1, 0x0f, 0x09, 0x39, 0x43, 0x31, 0x37, // L...9C17 - 0x31, 0x46, 0x51, 0x43, 0x32, 0x30, 0x30, 0x34, // 1FQC2004 - 0x33, 0x34, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 34...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt11108[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x9c, 0x98, 0x38, 0x6e, // ./....8n - 0xb7, 0x60, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0xf3, // .`....Z. - 0x26, 0xc8, 0x0f, 0x09, 0x30, 0x42, 0x31, 0x31, // &...0B11 - 0x31, 0x46, 0x51, 0x43, 0x42, 0x30, 0x30, 0x31, // 1FQCB001 - 0x30, 0x36, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 06...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt11141[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x55, 0x11, 0x3e, 0x13, // ./..U.>. - 0xc4, 0x0c, 0x01, 0x00, 0x0c, 0x42, 0x5a, 0xfc, // .....BZ. - 0x0b, 0xc6, 0x0f, 0x09, 0x32, 0x32, 0x32, 0x34, // ....2224 - 0x31, 0x46, 0x44, 0x48, 0x33, 0x30, 0x30, 0x30, // 1FDH3000 - 0x30, 0x4b, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 0K...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x5a, 0x6c, 0xb1, 0xa7, 0x6d, 0xf1, 0xbc, 0x9b, // Zl..m... - 0xde, 0x3d, 0x5c, 0xae, 0x21, 0xfa, 0x2e, 0xa8, // .=\.!... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt11152[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x30, 0xdc, 0xa4, 0x46, // ./..0..F - 0x74, 0x74, 0x01, 0x00, 0x0c, 0x42, 0x5a, 0xbd, // tt...BZ. - 0x79, 0xcb, 0x05, 0x09, 0x4a, 0x5a, 0x6f, 0x46, // y...JZoF - 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, 0x0c, 0x11, // ........ - 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, 0x16, 0x11, // ........ - 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, 0x00, 0x12, // ..-./... - 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, 0x00, 0x00, // 2....... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt11154[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x14, 0x90, 0x2a, 0x52, // ./....*R - 0xcb, 0x58, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0xdd, // .X....Z. - 0x66, 0xc9, 0x0b, 0x09, 0x39, 0x33, 0x58, 0x41, // f...93XA - 0x58, 0x30, 0x42, 0x52, 0x57, 0x4c, 0x19, 0x03, // X0BRWL.. - 0x05, 0x11, 0x0a, 0x11, 0x0c, 0x11, 0x0e, 0x11, // ........ - 0x12, 0x11, 0x15, 0x11, 0x16, 0x11, 0x1f, 0x11, // ........ - 0x2d, 0x11, 0x2f, 0x11, 0x00, 0x12, 0x32, 0x11, // -./...2. - 0x01, 0x05, 0x81, 0x07, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt11155[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x80, 0x6b, 0x36, 0x08, // ./...... - 0x9e, 0x08, 0x01, 0x00, 0x18, 0x04, 0x34, 0xa0, // ......4. - 0x13, 0xbf, 0x05, 0x09, 0x4c, 0x34, 0x50, 0x6d, // ....L4Pm - 0x11, 0x03, 0x05, 0x11, 0x0b, 0x11, 0x0c, 0x11, // ........ - 0x0e, 0x11, 0x1e, 0x11, 0x2e, 0x11, 0x00, 0x12, // ........ - 0x33, 0x11, 0x01, 0x05, 0x81, 0x07, 0x00, 0x00, // 3....... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt11156[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xb5, 0x4b, 0x99, 0x3b, // ./...K.; - 0x22, 0x14, 0x01, 0x00, 0x04, 0x07, 0x2a, 0x10, // ".....*. - 0x77, 0xc2, 0x13, 0x09, 0x47, 0x6f, 0x6f, 0x67, // w...Goog - 0x6c, 0x65, 0x20, 0x50, 0x69, 0x78, 0x65, 0x6c, // le Pixel - 0x20, 0x57, 0x61, 0x74, 0x63, 0x68, 0x0d, 0x03, // Watch.. - 0x0a, 0x11, 0x0c, 0x11, 0x0e, 0x11, 0x1e, 0x11, // ........ - 0x1f, 0x11, 0x00, 0x12, 0x01, 0x05, 0x81, 0x07, // ........ - 0x66, 0x9a, 0x0c, 0x20, 0x00, 0x08, 0xe2, 0xa5, // f.. .... - 0xe3, 0x11, 0x25, 0x95, 0xb0, 0x45, 0x89, 0x5e, // ..%..E.^ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt11158[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x89, 0x0c, 0xa6, 0x46, // ./.....F - 0x74, 0x74, 0x01, 0x00, 0x0c, 0x42, 0x5a, 0x0d, // tt...BZ. - 0x4c, 0xd1, 0x0f, 0x09, 0x32, 0x42, 0x32, 0x31, // L...2B21 - 0x31, 0x4a, 0x45, 0x48, 0x4e, 0x30, 0x38, 0x35, // 1JEHN085 - 0x38, 0x39, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 89...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x5a, 0x6c, 0xb1, 0xa7, 0x6d, 0xf1, 0xbc, 0x9b, // Zl..m... - 0xde, 0x3d, 0x5c, 0xae, 0x21, 0xfa, 0x2e, 0xa8, // .=\.!... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt11159[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xc2, 0x09, 0x87, 0x2c, // ./....., - 0x3a, 0xd4, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0xba, // :.....Z. - 0x28, 0xc4, 0x0f, 0x09, 0x32, 0x39, 0x31, 0x39, // (...2919 - 0x31, 0x4a, 0x45, 0x47, 0x52, 0x31, 0x30, 0x34, // 1JEGR104 - 0x31, 0x34, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 14...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x5a, 0x6c, 0xb1, 0xa7, 0x6d, 0xf1, 0xbc, 0x9b, // Zl..m... - 0xde, 0x3d, 0x5c, 0xae, 0x21, 0xfa, 0x2e, 0xa8, // .=\.!... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt473[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xf8, 0xdf, 0x28, 0xf4, // ./....(. - 0x81, 0x34, 0x01, 0x00, 0x00, 0x1f, 0x00, 0x59, // .4.....Y - 0x20, 0xb8, 0x10, 0x09, 0x45, 0x54, 0x2d, 0x42, // ...ET-B - 0x54, 0x47, 0x50, 0x53, 0x2d, 0x37, 0x30, 0x39, // TGPS-709 - 0x31, 0x33, 0x38, 0x05, 0xff, 0x42, 0x4d, 0x37, // 138..BM7 - 0x38, 0x02, 0x0a, 0x02, 0x03, 0x02, 0x01, 0x11, // 8....... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt474[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xf1, 0xd6, 0x28, 0xf4, // ./....(. - 0x81, 0x34, 0x01, 0x00, 0x00, 0x1f, 0x00, 0xa6, // .4...... - 0x7b, 0xb1, 0x10, 0x09, 0x45, 0x54, 0x2d, 0x42, // {...ET-B - 0x54, 0x47, 0x50, 0x53, 0x2d, 0x37, 0x30, 0x39, // TGPS-709 - 0x31, 0x33, 0x34, 0x05, 0xff, 0x42, 0x4d, 0x37, // 134..BM7 - 0x38, 0x02, 0x0a, 0x02, 0x03, 0x02, 0x01, 0x11, // 8....... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt488[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x0e, 0x8b, 0x20, 0xa5, // ./.... . - 0x92, 0x00, 0x01, 0x00, 0x20, 0x04, 0x36, 0x9a, // .... .6. - 0x09, 0xc0, 0x0a, 0x09, 0x4d, 0x6f, 0x74, 0x72, // ....Motr - 0x65, 0x78, 0x20, 0x48, 0x55, 0x0b, 0x03, 0x0b, // ex HU... - 0x11, 0x1e, 0x11, 0x2e, 0x11, 0x00, 0x12, 0x33, // .......3 - 0x11, 0x41, 0x07, 0xd3, 0x1f, 0xbf, 0x50, 0x5d, // .A....P] - 0x57, 0x27, 0x97, 0xa2, 0x40, 0x41, 0xcd, 0x48, // W'..@A.H - 0x43, 0x88, 0xec, 0xff, 0xca, 0xca, 0xde, 0xaf, // C....... - 0xde, 0xca, 0xde, 0xde, 0xfa, 0xca, 0xde, 0x00, // ........ - 0x00, 0x00, 0x00, 0x66, 0x9a, 0x0c, 0x20, 0x00, // ...f.. . - 0x08, 0xf4, 0xbd, 0xe6, 0x11, 0xcb, 0x52, 0x00, // ......R. - 0x7a, 0xe1, 0x4d, 0x7c, 0x92, 0x67, 0x4d, 0x2c, // z.M|.gM, - 0xf1, 0x86, 0x88, 0xdb, 0x4f, 0x15, 0x25, 0x2c, // ....O.%, - 0xfe, 0x21, 0xdf, 0x02, 0x0a, 0x04, 0x00, 0x00, // .!...... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt489[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x6c, 0x53, 0xdf, 0x05, // ./..lS.. - 0x05, 0x30, 0x01, 0x00, 0x0c, 0x01, 0x08, 0x44, // .0.....D - 0x4d, 0xd5, 0x10, 0x09, 0x4d, 0x47, 0x4b, 0x52, // M...MGKR - 0x44, 0x31, 0x30, 0x2d, 0x4e, 0x41, 0x31, 0x30, // D10-NA10 - 0x4d, 0x49, 0x50, 0x02, 0x0a, 0x0b, 0x09, 0x03, // MIP..... - 0x0c, 0x11, 0x0a, 0x11, 0x0e, 0x11, 0x0b, 0x11, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt512[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x74, 0x15, 0x29, 0xf4, // ./..t.). - 0x81, 0x34, 0x01, 0x00, 0x00, 0x1f, 0x00, 0x84, // .4...... - 0x5f, 0xbf, 0x10, 0x09, 0x45, 0x54, 0x2d, 0x42, // _...ET-B - 0x54, 0x41, 0x46, 0x44, 0x2d, 0x37, 0x30, 0x39, // TAFD-709 - 0x30, 0x36, 0x33, 0x05, 0xff, 0x42, 0x4d, 0x37, // 063..BM7 - 0x38, 0x02, 0x0a, 0x02, 0x03, 0x02, 0x01, 0x11, // 8....... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt513[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x02, 0xd8, 0x28, 0xf4, // ./....(. - 0x81, 0x34, 0x01, 0x00, 0x00, 0x1f, 0x00, 0x85, // .4...... - 0x5a, 0xbf, 0x10, 0x09, 0x45, 0x54, 0x2d, 0x42, // Z...ET-B - 0x54, 0x47, 0x50, 0x53, 0x2d, 0x37, 0x30, 0x39, // TGPS-709 - 0x31, 0x34, 0x30, 0x05, 0xff, 0x42, 0x4d, 0x37, // 140..BM7 - 0x38, 0x02, 0x0a, 0x02, 0x03, 0x02, 0x01, 0x11, // 8....... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt530[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x14, 0xdc, 0x28, 0xf4, // ./....(. - 0x81, 0x34, 0x01, 0x00, 0x00, 0x1f, 0x00, 0x74, // .4.....t - 0x01, 0xb6, 0x10, 0x09, 0x45, 0x54, 0x2d, 0x42, // ....ET-B - 0x54, 0x41, 0x46, 0x44, 0x2d, 0x37, 0x30, 0x39, // TAFD-709 - 0x30, 0x38, 0x35, 0x05, 0xff, 0x42, 0x4d, 0x37, // 085..BM7 - 0x38, 0x02, 0x0a, 0x02, 0x03, 0x02, 0x01, 0x11, // 8....... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt545[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xcd, 0x7b, 0xc0, 0x68, // ./...{.h - 0x10, 0xd8, 0x01, 0x00, 0x20, 0x04, 0x74, 0xf0, // .... .t. - 0x23, 0xb5, 0x17, 0x03, 0x3b, 0x11, 0x00, 0x12, // #...;... - 0x1e, 0x11, 0x03, 0x12, 0x2e, 0x11, 0x33, 0x11, // ......3. - 0x01, 0x11, 0x0b, 0x11, 0x0e, 0x11, 0x0f, 0x11, // ........ - 0x0c, 0x11, 0x01, 0x05, 0x41, 0x07, 0x1b, 0xc5, // ....A... - 0xd5, 0xa5, 0x02, 0x00, 0xa0, 0x80, 0xe4, 0x11, // ........ - 0x16, 0xe4, 0x40, 0xed, 0x28, 0x37, 0xff, 0xca, // ..@.(7.. - 0xca, 0xde, 0xaf, 0xde, 0xca, 0xde, 0xde, 0xfa, // ........ - 0xca, 0xde, 0x00, 0x00, 0x00, 0x00, 0xec, 0x88, // ........ - 0x43, 0x48, 0xcd, 0x41, 0x40, 0xa2, 0x97, 0x27, // CH.A@..' - 0x57, 0x5d, 0x50, 0xbf, 0x1f, 0xd3, 0x66, 0x9a, // W]P...f. - 0x0c, 0x20, 0x00, 0x08, 0xf4, 0xbd, 0xe6, 0x11, // . ...... - 0xcb, 0x52, 0x00, 0x7a, 0xe1, 0x4d, 0x02, 0x0a, // .R.z.M.. - 0x06, 0x0b, 0x09, 0x4d, 0x79, 0x20, 0x56, 0x57, // ...My VW - 0x20, 0x37, 0x42, 0x43, 0x44, 0x00, 0x00, 0x00, // 7BCD... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt871[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x6c, 0x53, 0xdf, 0x05, // ./..lS.. - 0x05, 0x30, 0x01, 0x00, 0x0c, 0x01, 0x08, 0x44, // .0.....D - 0x4d, 0xd5, 0x10, 0x09, 0x4d, 0x47, 0x4b, 0x52, // M...MGKR - 0x44, 0x31, 0x30, 0x2d, 0x4e, 0x41, 0x31, 0x30, // D10-NA10 - 0x4d, 0x49, 0x50, 0x02, 0x0a, 0x0b, 0x09, 0x03, // MIP..... - 0x0c, 0x11, 0x0a, 0x11, 0x0e, 0x11, 0x0b, 0x11, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt27834[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xb8, 0x20, 0xb8, 0x68, // ./... .h - 0x10, 0xd8, 0x01, 0x00, 0x20, 0x04, 0x74, 0xda, // .... .t. - 0x68, 0xc2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // h....... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt27876[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xb8, 0x20, 0xb8, 0x68, // ./... .h - 0x10, 0xd8, 0x01, 0x00, 0x20, 0x04, 0x74, 0x6a, // .... .tj - 0x6a, 0xc4, 0x19, 0x03, 0x3b, 0x11, 0x00, 0x12, // j...;... - 0x1e, 0x11, 0x03, 0x12, 0x2e, 0x11, 0x33, 0x11, // ......3. - 0x0b, 0x11, 0x0e, 0x11, 0x0f, 0x11, 0xae, 0x7f, // ........ - 0x0c, 0x11, 0xad, 0x7f, 0x01, 0x05, 0x41, 0x07, // ......A. - 0x1b, 0xc5, 0xd5, 0xa5, 0x02, 0x00, 0xa0, 0x80, // ........ - 0xe4, 0x11, 0x16, 0xe4, 0x40, 0xed, 0x28, 0x37, // ....@.(7 - 0xff, 0xca, 0xca, 0xde, 0xaf, 0xde, 0xca, 0xde, // ........ - 0xde, 0xfa, 0xca, 0xde, 0x00, 0x00, 0x00, 0x00, // ........ - 0xec, 0x88, 0x43, 0x48, 0xcd, 0x41, 0x40, 0xa2, // ..CH.A@. - 0x97, 0x27, 0x57, 0x5d, 0x50, 0xbf, 0x1f, 0xd3, // .'W]P... - 0x66, 0x9a, 0x0c, 0x20, 0x00, 0x08, 0xf4, 0xbd, // f.. .... - 0xe6, 0x11, 0xcb, 0x52, 0x00, 0x7a, 0xe1, 0x4d, // ...R.z.M - 0x02, 0x0a, 0x04, 0x0b, 0x09, 0x4d, 0x79, 0x20, // .....My - 0x56, 0x57, 0x20, 0x32, 0x36, 0x36, 0x33, 0x00, // VW 2663. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt649[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xf6, 0xc5, 0x54, 0x1a, // ./....T. - 0x94, 0xa0, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0xfe, // ......Z. - 0x0a, 0xc5, 0x1c, 0x09, 0xe3, 0x82, 0x81, 0xe3, // ........ - 0x82, 0x81, 0xe3, 0x81, 0xbf, 0xe3, 0x81, 0xa1, // ........ - 0xe4, 0xb8, 0x96, 0xe7, 0x95, 0x8c, 0xe4, 0xb8, // ........ - 0x80, 0xe6, 0x8e, 0xa8, 0xe3, 0x81, 0x97, 0x17, // ........ - 0x03, 0x05, 0x11, 0x0a, 0x11, 0x0c, 0x11, 0x0e, // ........ - 0x11, 0x12, 0x11, 0x15, 0x11, 0x16, 0x11, 0x1f, // ........ - 0x11, 0x2f, 0x11, 0x00, 0x12, 0x32, 0x11, 0x01, // ./...2.. - 0x05, 0x81, 0x07, 0x00, 0xdf, 0x0c, 0xa9, 0x80, // ........ - 0xbb, 0x4f, 0x9f, 0x5c, 0x49, 0x06, 0xcb, 0x15, // .O.\I... - 0xaa, 0x9e, 0xa4, 0x00, 0xdf, 0x0c, 0xa9, 0x80, // ........ - 0xbb, 0x4f, 0x9f, 0x5c, 0x49, 0x06, 0xcb, 0x15, // .O.\I... - 0xcc, 0x9e, 0xa4, 0x5a, 0x6c, 0xb1, 0xa7, 0x6d, // ...Zl..m - 0xf1, 0xbc, 0x9b, 0xde, 0x3d, 0x5c, 0xae, 0x21, // ....=\.! - 0xfa, 0x2e, 0xa8, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt677[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xc9, 0xfd, 0x14, 0x45, // ./.....E - 0x0a, 0x00, 0x01, 0x00, 0x04, 0x04, 0x24, 0x66, // ......$f - 0x17, 0xb2, 0x0e, 0x09, 0x41, 0x54, 0x48, 0x2d, // ....ATH- - 0x43, 0x4b, 0x53, 0x33, 0x33, 0x30, 0x58, 0x42, // CKS330XB - 0x54, 0x15, 0x03, 0x31, 0x11, 0x08, 0x11, 0x03, // T..1.... - 0x12, 0x1e, 0x11, 0x0c, 0x11, 0x0f, 0x11, 0x0e, // ........ - 0x11, 0x0b, 0x11, 0x00, 0x12, 0x00, 0x10, 0x01, // ........ - 0x05, 0x01, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt689[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xd3, 0x4d, 0x3b, 0xe9, // ./...M;. - 0xbc, 0x4c, 0x01, 0x00, 0x3c, 0x24, 0x0c, 0xe3, // .L..<$.. - 0x49, 0xae, 0x1a, 0x09, 0x5b, 0x4c, 0x47, 0x5d, // I...[LG] - 0x20, 0x77, 0x65, 0x62, 0x4f, 0x53, 0x20, 0x54, // webOS T - 0x56, 0x20, 0x4f, 0x4c, 0x45, 0x44, 0x35, 0x35, // V OLED55 - 0x43, 0x31, 0x50, 0x53, 0x42, 0x07, 0x03, 0x0b, // C1PSB... - 0x11, 0x0e, 0x11, 0x00, 0x12, 0x01, 0x05, 0x01, // ........ - 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt709[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x6a, 0x78, 0xbf, 0x09, // ./..jx.. - 0x95, 0x3c, 0x01, 0x00, 0x0c, 0x01, 0x2a, 0xdf, // .<....*. - 0x15, 0xa6, 0x10, 0x09, 0x44, 0x45, 0x53, 0x4b, // ....DESK - 0x54, 0x4f, 0x50, 0x2d, 0x39, 0x38, 0x41, 0x31, // TOP-98A1 - 0x41, 0x42, 0x53, 0x02, 0x0a, 0x00, 0x0d, 0x03, // ABS..... - 0x0c, 0x11, 0x0a, 0x11, 0x0e, 0x11, 0x0b, 0x11, // ........ - 0x1f, 0x11, 0x1e, 0x11, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt763[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x30, 0x25, 0x92, 0xda, // ./..0%.. - 0xb0, 0xcc, 0x01, 0x00, 0x0c, 0x01, 0x2a, 0x5c, // ......* - 0x04, 0xb2, 0x0b, 0x09, 0x54, 0x32, 0x32, 0x30, // ....T220 - 0x34, 0x30, 0x2d, 0x44, 0x55, 0x54, 0x02, 0x0a, // 40-DUT.. - 0x00, 0x0d, 0x03, 0x0c, 0x11, 0x0a, 0x11, 0x0e, // ........ - 0x11, 0x0b, 0x11, 0x1f, 0x11, 0x1e, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt771[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x39, 0xf0, 0x33, 0xd3, // ./..9.3. - 0x5f, 0x98, 0x01, 0x00, 0x0c, 0x01, 0x2a, 0xb0, // _.....*. - 0x20, 0xcc, 0x10, 0x09, 0x44, 0x45, 0x53, 0x4b, // ...DESK - 0x54, 0x4f, 0x50, 0x2d, 0x56, 0x38, 0x30, 0x41, // TOP-V80A - 0x51, 0x4a, 0x34, 0x02, 0x0a, 0x04, 0x0d, 0x03, // QJ4..... - 0x0c, 0x11, 0x0a, 0x11, 0x0e, 0x11, 0x0b, 0x11, // ........ - 0x1f, 0x11, 0x1e, 0x11, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt795[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x44, 0xc6, 0xee, 0x6b, // ./..D..k - 0x21, 0x00, 0x01, 0x00, 0x0c, 0x01, 0x2a, 0xe5, // !.....*. - 0x62, 0xa7, 0x0b, 0x09, 0x31, 0x31, 0x30, 0x30, // b...1100 - 0x30, 0x37, 0x2d, 0x44, 0x55, 0x54, 0x02, 0x0a, // 07-DUT.. - 0x0c, 0x0b, 0x03, 0x0a, 0x11, 0x0c, 0x11, 0x0e, // ........ - 0x11, 0x1f, 0x11, 0x1e, 0x11, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt951[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xf6, 0xc5, 0x54, 0x1a, // ./....T. - 0x94, 0xa0, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0xff, // ......Z. - 0x0a, 0xc6, 0x1c, 0x09, 0xe3, 0x82, 0x81, 0xe3, // ........ - 0x82, 0x81, 0xe3, 0x81, 0xbf, 0xe3, 0x81, 0xa1, // ........ - 0xe4, 0xb8, 0x96, 0xe7, 0x95, 0x8c, 0xe4, 0xb8, // ........ - 0x80, 0xe6, 0x8e, 0xa8, 0xe3, 0x81, 0x97, 0x17, // ........ - 0x03, 0x05, 0x11, 0x0a, 0x11, 0x0c, 0x11, 0x0e, // ........ - 0x11, 0x12, 0x11, 0x15, 0x11, 0x16, 0x11, 0x1f, // ........ - 0x11, 0x2f, 0x11, 0x00, 0x12, 0x32, 0x11, 0x01, // ./...2.. - 0x05, 0x81, 0x07, 0x00, 0xdf, 0x0c, 0xa9, 0x80, // ........ - 0xbb, 0x4f, 0x9f, 0x5c, 0x49, 0x06, 0xcb, 0x15, // .O.\I... - 0xaa, 0x9e, 0xa4, 0x00, 0xdf, 0x0c, 0xa9, 0x80, // ........ - 0xbb, 0x4f, 0x9f, 0x5c, 0x49, 0x06, 0xcb, 0x15, // .O.\I... - 0xcc, 0x9e, 0xa4, 0x5a, 0x6c, 0xb1, 0xa7, 0x6d, // ...Zl..m - 0xf1, 0xbc, 0x9b, 0xde, 0x3d, 0x5c, 0xae, 0x21, // ....=\.! - 0xfa, 0x2e, 0xa8, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt952[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x39, 0xf0, 0x33, 0xd3, // ./..9.3. - 0x5f, 0x98, 0x01, 0x00, 0x0c, 0x01, 0x2a, 0xb0, // _.....*. - 0x20, 0xd1, 0x10, 0x09, 0x44, 0x45, 0x53, 0x4b, // ...DESK - 0x54, 0x4f, 0x50, 0x2d, 0x56, 0x38, 0x30, 0x41, // TOP-V80A - 0x51, 0x4a, 0x34, 0x02, 0x0a, 0x04, 0x0d, 0x03, // QJ4..... - 0x0c, 0x11, 0x0a, 0x11, 0x0e, 0x11, 0x0b, 0x11, // ........ - 0x1f, 0x11, 0x1e, 0x11, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt953[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xd3, 0x4d, 0x3b, 0xe9, // ./...M;. - 0xbc, 0x4c, 0x01, 0x00, 0x3c, 0x24, 0x0c, 0xe3, // .L..<$.. - 0x49, 0xb2, 0x1a, 0x09, 0x5b, 0x4c, 0x47, 0x5d, // I...[LG] - 0x20, 0x77, 0x65, 0x62, 0x4f, 0x53, 0x20, 0x54, // webOS T - 0x56, 0x20, 0x4f, 0x4c, 0x45, 0x44, 0x35, 0x35, // V OLED55 - 0x43, 0x31, 0x50, 0x53, 0x42, 0x07, 0x03, 0x0b, // C1PSB... - 0x11, 0x0e, 0x11, 0x00, 0x12, 0x01, 0x05, 0x01, // ........ - 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt954[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x6a, 0x78, 0xbf, 0x09, // ./..jx.. - 0x95, 0x3c, 0x01, 0x00, 0x0c, 0x01, 0x2a, 0xdf, // .<....*. - 0x15, 0xad, 0x10, 0x09, 0x44, 0x45, 0x53, 0x4b, // ....DESK - 0x54, 0x4f, 0x50, 0x2d, 0x39, 0x38, 0x41, 0x31, // TOP-98A1 - 0x41, 0x42, 0x53, 0x02, 0x0a, 0x00, 0x0d, 0x03, // ABS..... - 0x0c, 0x11, 0x0a, 0x11, 0x0e, 0x11, 0x0b, 0x11, // ........ - 0x1f, 0x11, 0x1e, 0x11, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt451[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xf6, 0xc5, 0x54, 0x1a, // ./....T. - 0x94, 0xa0, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x98, // ......Z. - 0x44, 0xc5, 0x1c, 0x09, 0xe3, 0x82, 0x81, 0xe3, // D....... - 0x82, 0x81, 0xe3, 0x81, 0xbf, 0xe3, 0x81, 0xa1, // ........ - 0xe4, 0xb8, 0x96, 0xe7, 0x95, 0x8c, 0xe4, 0xb8, // ........ - 0x80, 0xe6, 0x8e, 0xa8, 0xe3, 0x81, 0x97, 0x17, // ........ - 0x03, 0x05, 0x11, 0x0a, 0x11, 0x0c, 0x11, 0x0e, // ........ - 0x11, 0x12, 0x11, 0x15, 0x11, 0x16, 0x11, 0x1f, // ........ - 0x11, 0x2f, 0x11, 0x00, 0x12, 0x32, 0x11, 0x01, // ./...2.. - 0x05, 0x81, 0x07, 0x00, 0xdf, 0x0c, 0xa9, 0x80, // ........ - 0xbb, 0x4f, 0x9f, 0x5c, 0x49, 0x06, 0xcb, 0x15, // .O.\I... - 0xaa, 0x9e, 0xa4, 0x00, 0xdf, 0x0c, 0xa9, 0x80, // ........ - 0xbb, 0x4f, 0x9f, 0x5c, 0x49, 0x06, 0xcb, 0x15, // .O.\I... - 0xcc, 0x9e, 0xa4, 0x5a, 0x6c, 0xb1, 0xa7, 0x6d, // ...Zl..m - 0xf1, 0xbc, 0x9b, 0xde, 0x3d, 0x5c, 0xae, 0x21, // ....=\.! - 0xfa, 0x2e, 0xa8, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt482[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x30, 0x25, 0x92, 0xda, // ./..0%.. - 0xb0, 0xcc, 0x01, 0x00, 0x0c, 0x01, 0x2a, 0xf9, // ......*. - 0x3d, 0xbe, 0x0b, 0x09, 0x54, 0x32, 0x32, 0x30, // =...T220 - 0x34, 0x30, 0x2d, 0x44, 0x55, 0x54, 0x02, 0x0a, // 40-DUT.. - 0x00, 0x0d, 0x03, 0x0c, 0x11, 0x0a, 0x11, 0x0e, // ........ - 0x11, 0x0b, 0x11, 0x1f, 0x11, 0x1e, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt496[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x44, 0xc6, 0xee, 0x6b, // ./..D..k - 0x21, 0x00, 0x01, 0x00, 0x0c, 0x01, 0x2a, 0x7e, // !.....*~ - 0x1c, 0xaf, 0x0b, 0x09, 0x31, 0x31, 0x30, 0x30, // ....1100 - 0x30, 0x37, 0x2d, 0x44, 0x55, 0x54, 0x02, 0x0a, // 07-DUT.. - 0x0c, 0x0b, 0x03, 0x0a, 0x11, 0x0c, 0x11, 0x0e, // ........ - 0x11, 0x1f, 0x11, 0x1e, 0x11, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt511[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xd3, 0x4d, 0x3b, 0xe9, // ./...M;. - 0xbc, 0x4c, 0x01, 0x00, 0x3c, 0x24, 0x0c, 0x8b, // .L..<$.. - 0x03, 0xae, 0x1a, 0x09, 0x5b, 0x4c, 0x47, 0x5d, // ....[LG] - 0x20, 0x77, 0x65, 0x62, 0x4f, 0x53, 0x20, 0x54, // webOS T - 0x56, 0x20, 0x4f, 0x4c, 0x45, 0x44, 0x35, 0x35, // V OLED55 - 0x43, 0x31, 0x50, 0x53, 0x42, 0x07, 0x03, 0x0b, // C1PSB... - 0x11, 0x0e, 0x11, 0x00, 0x12, 0x01, 0x05, 0x01, // ........ - 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt523[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xc9, 0xfd, 0x14, 0x45, // ./.....E - 0x0a, 0x00, 0x01, 0x00, 0x04, 0x04, 0x24, 0x16, // ......$. - 0x51, 0xbe, 0x0e, 0x09, 0x41, 0x54, 0x48, 0x2d, // Q...ATH- - 0x43, 0x4b, 0x53, 0x33, 0x33, 0x30, 0x58, 0x42, // CKS330XB - 0x54, 0x15, 0x03, 0x31, 0x11, 0x08, 0x11, 0x03, // T..1.... - 0x12, 0x1e, 0x11, 0x0c, 0x11, 0x0f, 0x11, 0x0e, // ........ - 0x11, 0x0b, 0x11, 0x00, 0x12, 0x00, 0x10, 0x01, // ........ - 0x05, 0x01, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt534[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x6a, 0x78, 0xbf, 0x09, // ./..jx.. - 0x95, 0x3c, 0x01, 0x00, 0x0c, 0x01, 0x2a, 0x7c, // .<....*| - 0x4f, 0xbb, 0x10, 0x09, 0x44, 0x45, 0x53, 0x4b, // O...DESK - 0x54, 0x4f, 0x50, 0x2d, 0x39, 0x38, 0x41, 0x31, // TOP-98A1 - 0x41, 0x42, 0x53, 0x02, 0x0a, 0x00, 0x0d, 0x03, // ABS..... - 0x0c, 0x11, 0x0a, 0x11, 0x0e, 0x11, 0x0b, 0x11, // ........ - 0x1f, 0x11, 0x1e, 0x11, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt706[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x1c, 0xfb, 0xd3, 0x29, // ./.....) - 0x24, 0x58, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x1a, // $X....Z. - 0x0c, 0xbe, 0x0f, 0x09, 0x50, 0x69, 0x78, 0x65, // ....Pixe - 0x6c, 0x20, 0x36, 0x20, 0x50, 0x72, 0x6f, 0x20, // l 6 Pro - 0x30, 0x36, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 06...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x22, 0x1e, 0x7e, 0xb0, 0x4e, 0x50, 0x5d, 0x8b, // ".~.NP]. - 0x27, 0x47, 0x79, 0x5f, 0x63, 0x0b, 0xe5, 0xce, // 'Gy_c... - 0x5a, 0x6c, 0xb1, 0xa7, 0x6d, 0xf1, 0xbc, 0x9b, // Zl..m... - 0xde, 0x3d, 0x5c, 0xae, 0x21, 0xfa, 0x2e, 0xa8, // .=\.!... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt707[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xda, 0xbd, 0x68, 0x72, // ./....hr - 0x6e, 0xb0, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0xc7, // n.....Z. - 0x5b, 0xab, 0x10, 0x09, 0x72, 0x65, 0x61, 0x6c, // [...real - 0x6d, 0x65, 0x20, 0x47, 0x54, 0x20, 0x4e, 0x45, // me GT NE - 0x4f, 0x20, 0x33, 0x19, 0x03, 0x05, 0x11, 0x0a, // O 3..... - 0x11, 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, // ........ - 0x11, 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, // .....-./ - 0x11, 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, // ...2.... - 0x07, 0x00, 0xdf, 0x0c, 0xa9, 0x80, 0xbb, 0x4f, // .......O - 0x9f, 0x5c, 0x49, 0x06, 0xcb, 0x15, 0xaa, 0x9e, // .\I..... - 0xa4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt786[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x30, 0x25, 0x92, 0xda, // ./..0%.. - 0xb0, 0xcc, 0x01, 0x00, 0x0c, 0x01, 0x2a, 0xf8, // ......*. - 0x3d, 0xb5, 0x0b, 0x09, 0x54, 0x32, 0x32, 0x30, // =...T220 - 0x34, 0x30, 0x2d, 0x44, 0x55, 0x54, 0x02, 0x0a, // 40-DUT.. - 0x00, 0x0d, 0x03, 0x0c, 0x11, 0x0a, 0x11, 0x0e, // ........ - 0x11, 0x0b, 0x11, 0x1f, 0x11, 0x1e, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt787[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xf6, 0xc5, 0x54, 0x1a, // ./....T. - 0x94, 0xa0, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x98, // ......Z. - 0x44, 0xc6, 0x1c, 0x09, 0xe3, 0x82, 0x81, 0xe3, // D....... - 0x82, 0x81, 0xe3, 0x81, 0xbf, 0xe3, 0x81, 0xa1, // ........ - 0xe4, 0xb8, 0x96, 0xe7, 0x95, 0x8c, 0xe4, 0xb8, // ........ - 0x80, 0xe6, 0x8e, 0xa8, 0xe3, 0x81, 0x97, 0x17, // ........ - 0x03, 0x05, 0x11, 0x0a, 0x11, 0x0c, 0x11, 0x0e, // ........ - 0x11, 0x12, 0x11, 0x15, 0x11, 0x16, 0x11, 0x1f, // ........ - 0x11, 0x2f, 0x11, 0x00, 0x12, 0x32, 0x11, 0x01, // ./...2.. - 0x05, 0x81, 0x07, 0x00, 0xdf, 0x0c, 0xa9, 0x80, // ........ - 0xbb, 0x4f, 0x9f, 0x5c, 0x49, 0x06, 0xcb, 0x15, // .O.\I... - 0xaa, 0x9e, 0xa4, 0x00, 0xdf, 0x0c, 0xa9, 0x80, // ........ - 0xbb, 0x4f, 0x9f, 0x5c, 0x49, 0x06, 0xcb, 0x15, // .O.\I... - 0xcc, 0x9e, 0xa4, 0x5a, 0x6c, 0xb1, 0xa7, 0x6d, // ...Zl..m - 0xf1, 0xbc, 0x9b, 0xde, 0x3d, 0x5c, 0xae, 0x21, // ....=\.! - 0xfa, 0x2e, 0xa8, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt800[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x44, 0xc6, 0xee, 0x6b, // ./..D..k - 0x21, 0x00, 0x01, 0x00, 0x0c, 0x01, 0x2a, 0x7f, // !.....*. - 0x1c, 0xb0, 0x0b, 0x09, 0x31, 0x31, 0x30, 0x30, // ....1100 - 0x30, 0x37, 0x2d, 0x44, 0x55, 0x54, 0x02, 0x0a, // 07-DUT.. - 0x0c, 0x0b, 0x03, 0x0a, 0x11, 0x0c, 0x11, 0x0e, // ........ - 0x11, 0x1f, 0x11, 0x1e, 0x11, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt821[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x6a, 0x78, 0xbf, 0x09, // ./..jx.. - 0x95, 0x3c, 0x01, 0x00, 0x0c, 0x01, 0x2a, 0x7c, // .<....*| - 0x4f, 0xb2, 0x10, 0x09, 0x44, 0x45, 0x53, 0x4b, // O...DESK - 0x54, 0x4f, 0x50, 0x2d, 0x39, 0x38, 0x41, 0x31, // TOP-98A1 - 0x41, 0x42, 0x53, 0x02, 0x0a, 0x00, 0x0d, 0x03, // ABS..... - 0x0c, 0x11, 0x0a, 0x11, 0x0e, 0x11, 0x0b, 0x11, // ........ - 0x1f, 0x11, 0x1e, 0x11, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt840[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x1c, 0xfb, 0xd3, 0x29, // ./.....) - 0x24, 0x58, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x1a, // $X....Z. - 0x0c, 0xba, 0x0f, 0x09, 0x50, 0x69, 0x78, 0x65, // ....Pixe - 0x6c, 0x20, 0x36, 0x20, 0x50, 0x72, 0x6f, 0x20, // l 6 Pro - 0x30, 0x36, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 06...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x22, 0x1e, 0x7e, 0xb0, 0x4e, 0x50, 0x5d, 0x8b, // ".~.NP]. - 0x27, 0x47, 0x79, 0x5f, 0x63, 0x0b, 0xe5, 0xce, // 'Gy_c... - 0x5a, 0x6c, 0xb1, 0xa7, 0x6d, 0xf1, 0xbc, 0x9b, // Zl..m... - 0xde, 0x3d, 0x5c, 0xae, 0x21, 0xfa, 0x2e, 0xa8, // .=\.!... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt848[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xd3, 0x4d, 0x3b, 0xe9, // ./...M;. - 0xbc, 0x4c, 0x01, 0x00, 0x3c, 0x24, 0x0c, 0x8a, // .L..<$.. - 0x03, 0xac, 0x1a, 0x09, 0x5b, 0x4c, 0x47, 0x5d, // ....[LG] - 0x20, 0x77, 0x65, 0x62, 0x4f, 0x53, 0x20, 0x54, // webOS T - 0x56, 0x20, 0x4f, 0x4c, 0x45, 0x44, 0x35, 0x35, // V OLED55 - 0x43, 0x31, 0x50, 0x53, 0x42, 0x07, 0x03, 0x0b, // C1PSB... - 0x11, 0x0e, 0x11, 0x00, 0x12, 0x01, 0x05, 0x01, // ........ - 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt865[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xc9, 0xfd, 0x14, 0x45, // ./.....E - 0x0a, 0x00, 0x01, 0x00, 0x04, 0x04, 0x24, 0x16, // ......$. - 0x51, 0xb5, 0x0e, 0x09, 0x41, 0x54, 0x48, 0x2d, // Q...ATH- - 0x43, 0x4b, 0x53, 0x33, 0x33, 0x30, 0x58, 0x42, // CKS330XB - 0x54, 0x15, 0x03, 0x31, 0x11, 0x08, 0x11, 0x03, // T..1.... - 0x12, 0x1e, 0x11, 0x0c, 0x11, 0x0f, 0x11, 0x0e, // ........ - 0x11, 0x0b, 0x11, 0x00, 0x12, 0x00, 0x10, 0x01, // ........ - 0x05, 0x01, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt910[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xb0, 0x27, 0x7f, 0x19, // ./...'.. - 0x28, 0xf8, 0x01, 0x00, 0x0c, 0x01, 0x2a, 0xee, // (.....*. - 0x75, 0xae, 0x0b, 0x09, 0x31, 0x30, 0x34, 0x30, // u...1040 - 0x38, 0x39, 0x2d, 0x44, 0x55, 0x54, 0x02, 0x0a, // 89-DUT.. - 0x00, 0x0b, 0x03, 0x0a, 0x11, 0x0c, 0x11, 0x0e, // ........ - 0x11, 0x1f, 0x11, 0x1e, 0x11, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt911[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xda, 0xbd, 0x68, 0x72, // ./....hr - 0x6e, 0xb0, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0xc7, // n.....Z. - 0x5b, 0xac, 0x10, 0x09, 0x72, 0x65, 0x61, 0x6c, // [...real - 0x6d, 0x65, 0x20, 0x47, 0x54, 0x20, 0x4e, 0x45, // me GT NE - 0x4f, 0x20, 0x33, 0x19, 0x03, 0x05, 0x11, 0x0a, // O 3..... - 0x11, 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, // ........ - 0x11, 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, // .....-./ - 0x11, 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, // ...2.... - 0x07, 0x00, 0xdf, 0x0c, 0xa9, 0x80, 0xbb, 0x4f, // .......O - 0x9f, 0x5c, 0x49, 0x06, 0xcb, 0x15, 0xaa, 0x9e, // .\I..... - 0xa4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt1093[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xc2, 0x3c, 0x42, 0xd9, // ./...<B. - 0x64, 0xbc, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0xf8, // d.....Z. - 0x54, 0xa8, 0x10, 0x09, 0x4f, 0x50, 0x50, 0x4f, // T...OPPO - 0x20, 0x52, 0x65, 0x6e, 0x6f, 0x38, 0x20, 0x54, // Reno8 T - 0x20, 0x35, 0x47, 0x17, 0x03, 0x05, 0x11, 0x0a, // 5G..... - 0x11, 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, // ........ - 0x11, 0x16, 0x11, 0x1f, 0x11, 0x2f, 0x11, 0x00, // ...../.. - 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, 0x00, // .2...... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt1128[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xc9, 0xfd, 0x14, 0x45, // ./.....E - 0x0a, 0x00, 0x01, 0x00, 0x04, 0x04, 0x24, 0x15, // ......$. - 0x51, 0xba, 0x0e, 0x09, 0x41, 0x54, 0x48, 0x2d, // Q...ATH- - 0x43, 0x4b, 0x53, 0x33, 0x33, 0x30, 0x58, 0x42, // CKS330XB - 0x54, 0x15, 0x03, 0x31, 0x11, 0x08, 0x11, 0x03, // T..1.... - 0x12, 0x1e, 0x11, 0x0c, 0x11, 0x0f, 0x11, 0x0e, // ........ - 0x11, 0x0b, 0x11, 0x00, 0x12, 0x00, 0x10, 0x01, // ........ - 0x05, 0x01, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt1148[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x1c, 0xfb, 0xd3, 0x29, // ./.....) - 0x24, 0x58, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x1b, // $X....Z. - 0x0c, 0xb4, 0x0f, 0x09, 0x50, 0x69, 0x78, 0x65, // ....Pixe - 0x6c, 0x20, 0x36, 0x20, 0x50, 0x72, 0x6f, 0x20, // l 6 Pro - 0x30, 0x36, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 06...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x22, 0x1e, 0x7e, 0xb0, 0x4e, 0x50, 0x5d, 0x8b, // ".~.NP]. - 0x27, 0x47, 0x79, 0x5f, 0x63, 0x0b, 0xe5, 0xce, // 'Gy_c... - 0x5a, 0x6c, 0xb1, 0xa7, 0x6d, 0xf1, 0xbc, 0x9b, // Zl..m... - 0xde, 0x3d, 0x5c, 0xae, 0x21, 0xfa, 0x2e, 0xa8, // .=\.!... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt1150[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xda, 0xbd, 0x68, 0x72, // ./....hr - 0x6e, 0xb0, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0xc7, // n.....Z. - 0x5b, 0xb1, 0x10, 0x09, 0x72, 0x65, 0x61, 0x6c, // [...real - 0x6d, 0x65, 0x20, 0x47, 0x54, 0x20, 0x4e, 0x45, // me GT NE - 0x4f, 0x20, 0x33, 0x19, 0x03, 0x05, 0x11, 0x0a, // O 3..... - 0x11, 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, // ........ - 0x11, 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, // .....-./ - 0x11, 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, // ...2.... - 0x07, 0x00, 0xdf, 0x0c, 0xa9, 0x80, 0xbb, 0x4f, // .......O - 0x9f, 0x5c, 0x49, 0x06, 0xcb, 0x15, 0xaa, 0x9e, // .\I..... - 0xa4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt1242[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x6a, 0x78, 0xbf, 0x09, // ./..jx.. - 0x95, 0x3c, 0x01, 0x00, 0x0c, 0x01, 0x2a, 0x7d, // .<....*} - 0x4f, 0xb6, 0x10, 0x09, 0x44, 0x45, 0x53, 0x4b, // O...DESK - 0x54, 0x4f, 0x50, 0x2d, 0x39, 0x38, 0x41, 0x31, // TOP-98A1 - 0x41, 0x42, 0x53, 0x02, 0x0a, 0x00, 0x0d, 0x03, // ABS..... - 0x0c, 0x11, 0x0a, 0x11, 0x0e, 0x11, 0x0b, 0x11, // ........ - 0x1f, 0x11, 0x1e, 0x11, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt1243[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xf6, 0xc5, 0x54, 0x1a, // ./....T. - 0x94, 0xa0, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x97, // ......Z. - 0x44, 0xc4, 0x1c, 0x09, 0xe3, 0x82, 0x81, 0xe3, // D....... - 0x82, 0x81, 0xe3, 0x81, 0xbf, 0xe3, 0x81, 0xa1, // ........ - 0xe4, 0xb8, 0x96, 0xe7, 0x95, 0x8c, 0xe4, 0xb8, // ........ - 0x80, 0xe6, 0x8e, 0xa8, 0xe3, 0x81, 0x97, 0x17, // ........ - 0x03, 0x05, 0x11, 0x0a, 0x11, 0x0c, 0x11, 0x0e, // ........ - 0x11, 0x12, 0x11, 0x15, 0x11, 0x16, 0x11, 0x1f, // ........ - 0x11, 0x2f, 0x11, 0x00, 0x12, 0x32, 0x11, 0x01, // ./...2.. - 0x05, 0x81, 0x07, 0x00, 0xdf, 0x0c, 0xa9, 0x80, // ........ - 0xbb, 0x4f, 0x9f, 0x5c, 0x49, 0x06, 0xcb, 0x15, // .O.\I... - 0xaa, 0x9e, 0xa4, 0x00, 0xdf, 0x0c, 0xa9, 0x80, // ........ - 0xbb, 0x4f, 0x9f, 0x5c, 0x49, 0x06, 0xcb, 0x15, // .O.\I... - 0xcc, 0x9e, 0xa4, 0x5a, 0x6c, 0xb1, 0xa7, 0x6d, // ...Zl..m - 0xf1, 0xbc, 0x9b, 0xde, 0x3d, 0x5c, 0xae, 0x21, // ....=\.! - 0xfa, 0x2e, 0xa8, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt1263[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x30, 0x25, 0x92, 0xda, // ./..0%.. - 0xb0, 0xcc, 0x01, 0x00, 0x0c, 0x01, 0x2a, 0xf8, // ......*. - 0x3d, 0xbc, 0x0b, 0x09, 0x54, 0x32, 0x32, 0x30, // =...T220 - 0x34, 0x30, 0x2d, 0x44, 0x55, 0x54, 0x02, 0x0a, // 40-DUT.. - 0x00, 0x0d, 0x03, 0x0c, 0x11, 0x0a, 0x11, 0x0e, // ........ - 0x11, 0x0b, 0x11, 0x1f, 0x11, 0x1e, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt1302[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xc9, 0xfd, 0x14, 0x45, // ./.....E - 0x0a, 0x00, 0x01, 0x00, 0x04, 0x04, 0x24, 0x16, // ......$. - 0x51, 0xae, 0x0e, 0x09, 0x41, 0x54, 0x48, 0x2d, // Q...ATH- - 0x43, 0x4b, 0x53, 0x33, 0x33, 0x30, 0x58, 0x42, // CKS330XB - 0x54, 0x15, 0x03, 0x31, 0x11, 0x08, 0x11, 0x03, // T..1.... - 0x12, 0x1e, 0x11, 0x0c, 0x11, 0x0f, 0x11, 0x0e, // ........ - 0x11, 0x0b, 0x11, 0x00, 0x12, 0x00, 0x10, 0x01, // ........ - 0x05, 0x01, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt1316[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xb0, 0x27, 0x7f, 0x19, // ./...'.. - 0x28, 0xf8, 0x01, 0x00, 0x0c, 0x01, 0x2a, 0xef, // (.....*. - 0x75, 0xae, 0x0b, 0x09, 0x31, 0x30, 0x34, 0x30, // u...1040 - 0x38, 0x39, 0x2d, 0x44, 0x55, 0x54, 0x02, 0x0a, // 89-DUT.. - 0x00, 0x0b, 0x03, 0x0a, 0x11, 0x0c, 0x11, 0x0e, // ........ - 0x11, 0x1f, 0x11, 0x1e, 0x11, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt1358[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x44, 0xc6, 0xee, 0x6b, // ./..D..k - 0x21, 0x00, 0x01, 0x00, 0x0c, 0x01, 0x2a, 0x7e, // !.....*~ - 0x1c, 0xb1, 0x0b, 0x09, 0x31, 0x31, 0x30, 0x30, // ....1100 - 0x30, 0x37, 0x2d, 0x44, 0x55, 0x54, 0x02, 0x0a, // 07-DUT.. - 0x0c, 0x0b, 0x03, 0x0a, 0x11, 0x0c, 0x11, 0x0e, // ........ - 0x11, 0x1f, 0x11, 0x1e, 0x11, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt1359[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xd3, 0x4d, 0x3b, 0xe9, // ./...M;. - 0xbc, 0x4c, 0x01, 0x00, 0x3c, 0x24, 0x0c, 0x8a, // .L..<$.. - 0x03, 0xb6, 0x1a, 0x09, 0x5b, 0x4c, 0x47, 0x5d, // ....[LG] - 0x20, 0x77, 0x65, 0x62, 0x4f, 0x53, 0x20, 0x54, // webOS T - 0x56, 0x20, 0x4f, 0x4c, 0x45, 0x44, 0x35, 0x35, // V OLED55 - 0x43, 0x31, 0x50, 0x53, 0x42, 0x07, 0x03, 0x0b, // C1PSB... - 0x11, 0x0e, 0x11, 0x00, 0x12, 0x01, 0x05, 0x01, // ........ - 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt1428[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x1c, 0xfb, 0xd3, 0x29, // ./.....) - 0x24, 0x58, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x1b, // $X....Z. - 0x0c, 0xb8, 0x0f, 0x09, 0x50, 0x69, 0x78, 0x65, // ....Pixe - 0x6c, 0x20, 0x36, 0x20, 0x50, 0x72, 0x6f, 0x20, // l 6 Pro - 0x30, 0x36, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 06...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x22, 0x1e, 0x7e, 0xb0, 0x4e, 0x50, 0x5d, 0x8b, // ".~.NP]. - 0x27, 0x47, 0x79, 0x5f, 0x63, 0x0b, 0xe5, 0xce, // 'Gy_c... - 0x5a, 0x6c, 0xb1, 0xa7, 0x6d, 0xf1, 0xbc, 0x9b, // Zl..m... - 0xde, 0x3d, 0x5c, 0xae, 0x21, 0xfa, 0x2e, 0xa8, // .=\.!... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt1564[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xc9, 0xfd, 0x14, 0x45, // ./.....E - 0x0a, 0x00, 0x01, 0x00, 0x04, 0x04, 0x24, 0x15, // ......$. - 0x51, 0xbe, 0x0e, 0x09, 0x41, 0x54, 0x48, 0x2d, // Q...ATH- - 0x43, 0x4b, 0x53, 0x33, 0x33, 0x30, 0x58, 0x42, // CKS330XB - 0x54, 0x15, 0x03, 0x31, 0x11, 0x08, 0x11, 0x03, // T..1.... - 0x12, 0x1e, 0x11, 0x0c, 0x11, 0x0f, 0x11, 0x0e, // ........ - 0x11, 0x0b, 0x11, 0x00, 0x12, 0x00, 0x10, 0x01, // ........ - 0x05, 0x01, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt1587[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xf6, 0xc5, 0x54, 0x1a, // ./....T. - 0x94, 0xa0, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x98, // ......Z. - 0x44, 0xc0, 0x1c, 0x09, 0xe3, 0x82, 0x81, 0xe3, // D....... - 0x82, 0x81, 0xe3, 0x81, 0xbf, 0xe3, 0x81, 0xa1, // ........ - 0xe4, 0xb8, 0x96, 0xe7, 0x95, 0x8c, 0xe4, 0xb8, // ........ - 0x80, 0xe6, 0x8e, 0xa8, 0xe3, 0x81, 0x97, 0x17, // ........ - 0x03, 0x05, 0x11, 0x0a, 0x11, 0x0c, 0x11, 0x0e, // ........ - 0x11, 0x12, 0x11, 0x15, 0x11, 0x16, 0x11, 0x1f, // ........ - 0x11, 0x2f, 0x11, 0x00, 0x12, 0x32, 0x11, 0x01, // ./...2.. - 0x05, 0x81, 0x07, 0x00, 0xdf, 0x0c, 0xa9, 0x80, // ........ - 0xbb, 0x4f, 0x9f, 0x5c, 0x49, 0x06, 0xcb, 0x15, // .O.\I... - 0xaa, 0x9e, 0xa4, 0x00, 0xdf, 0x0c, 0xa9, 0x80, // ........ - 0xbb, 0x4f, 0x9f, 0x5c, 0x49, 0x06, 0xcb, 0x15, // .O.\I... - 0xcc, 0x9e, 0xa4, 0x5a, 0x6c, 0xb1, 0xa7, 0x6d, // ...Zl..m - 0xf1, 0xbc, 0x9b, 0xde, 0x3d, 0x5c, 0xae, 0x21, // ....=\.! - 0xfa, 0x2e, 0xa8, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt1596[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x30, 0x25, 0x92, 0xda, // ./..0%.. - 0xb0, 0xcc, 0x01, 0x00, 0x0c, 0x01, 0x2a, 0xf8, // ......*. - 0x3d, 0xad, 0x0b, 0x09, 0x54, 0x32, 0x32, 0x30, // =...T220 - 0x34, 0x30, 0x2d, 0x44, 0x55, 0x54, 0x02, 0x0a, // 40-DUT.. - 0x00, 0x0d, 0x03, 0x0c, 0x11, 0x0a, 0x11, 0x0e, // ........ - 0x11, 0x0b, 0x11, 0x1f, 0x11, 0x1e, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt1597[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xd3, 0x4d, 0x3b, 0xe9, // ./...M;. - 0xbc, 0x4c, 0x01, 0x00, 0x3c, 0x24, 0x0c, 0x89, // .L..<$.. - 0x03, 0xa8, 0x1a, 0x09, 0x5b, 0x4c, 0x47, 0x5d, // ....[LG] - 0x20, 0x77, 0x65, 0x62, 0x4f, 0x53, 0x20, 0x54, // webOS T - 0x56, 0x20, 0x4f, 0x4c, 0x45, 0x44, 0x35, 0x35, // V OLED55 - 0x43, 0x31, 0x50, 0x53, 0x42, 0x07, 0x03, 0x0b, // C1PSB... - 0x11, 0x0e, 0x11, 0x00, 0x12, 0x01, 0x05, 0x01, // ........ - 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt1614[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x44, 0xc6, 0xee, 0x6b, // ./..D..k - 0x21, 0x00, 0x01, 0x00, 0x0c, 0x01, 0x2a, 0x7f, // !.....*. - 0x1c, 0xac, 0x0b, 0x09, 0x31, 0x31, 0x30, 0x30, // ....1100 - 0x30, 0x37, 0x2d, 0x44, 0x55, 0x54, 0x02, 0x0a, // 07-DUT.. - 0x0c, 0x0b, 0x03, 0x0a, 0x11, 0x0c, 0x11, 0x0e, // ........ - 0x11, 0x1f, 0x11, 0x1e, 0x11, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt1615[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x6a, 0x78, 0xbf, 0x09, // ./..jx.. - 0x95, 0x3c, 0x01, 0x00, 0x0c, 0x01, 0x2a, 0x7d, // .<....*} - 0x4f, 0xad, 0x10, 0x09, 0x44, 0x45, 0x53, 0x4b, // O...DESK - 0x54, 0x4f, 0x50, 0x2d, 0x39, 0x38, 0x41, 0x31, // TOP-98A1 - 0x41, 0x42, 0x53, 0x02, 0x0a, 0x00, 0x0d, 0x03, // ABS..... - 0x0c, 0x11, 0x0a, 0x11, 0x0e, 0x11, 0x0b, 0x11, // ........ - 0x1f, 0x11, 0x1e, 0x11, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt1662[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x1c, 0xfb, 0xd3, 0x29, // ./.....) - 0x24, 0x58, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x1b, // $X....Z. - 0x0c, 0xb6, 0x0f, 0x09, 0x50, 0x69, 0x78, 0x65, // ....Pixe - 0x6c, 0x20, 0x36, 0x20, 0x50, 0x72, 0x6f, 0x20, // l 6 Pro - 0x30, 0x36, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 06...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x22, 0x1e, 0x7e, 0xb0, 0x4e, 0x50, 0x5d, 0x8b, // ".~.NP]. - 0x27, 0x47, 0x79, 0x5f, 0x63, 0x0b, 0xe5, 0xce, // 'Gy_c... - 0x5a, 0x6c, 0xb1, 0xa7, 0x6d, 0xf1, 0xbc, 0x9b, // Zl..m... - 0xde, 0x3d, 0x5c, 0xae, 0x21, 0xfa, 0x2e, 0xa8, // .=\.!... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt1678[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xb0, 0x27, 0x7f, 0x19, // ./...'.. - 0x28, 0xf8, 0x01, 0x00, 0x0c, 0x01, 0x2a, 0xee, // (.....*. - 0x75, 0xa5, 0x0b, 0x09, 0x31, 0x30, 0x34, 0x30, // u...1040 - 0x38, 0x39, 0x2d, 0x44, 0x55, 0x54, 0x02, 0x0a, // 89-DUT.. - 0x00, 0x0b, 0x03, 0x0a, 0x11, 0x0c, 0x11, 0x0e, // ........ - 0x11, 0x1f, 0x11, 0x1e, 0x11, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt1764[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xd3, 0x4d, 0x3b, 0xe9, // ./...M;. - 0xbc, 0x4c, 0x01, 0x00, 0x3c, 0x24, 0x0c, 0x89, // .L..<$.. - 0x03, 0xaf, 0x1a, 0x09, 0x5b, 0x4c, 0x47, 0x5d, // ....[LG] - 0x20, 0x77, 0x65, 0x62, 0x4f, 0x53, 0x20, 0x54, // webOS T - 0x56, 0x20, 0x4f, 0x4c, 0x45, 0x44, 0x35, 0x35, // V OLED55 - 0x43, 0x31, 0x50, 0x53, 0x42, 0x07, 0x03, 0x0b, // C1PSB... - 0x11, 0x0e, 0x11, 0x00, 0x12, 0x01, 0x05, 0x01, // ........ - 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt1775[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x6a, 0x78, 0xbf, 0x09, // ./..jx.. - 0x95, 0x3c, 0x01, 0x00, 0x0c, 0x01, 0x2a, 0x7c, // .<....*| - 0x4f, 0xaf, 0x10, 0x09, 0x44, 0x45, 0x53, 0x4b, // O...DESK - 0x54, 0x4f, 0x50, 0x2d, 0x39, 0x38, 0x41, 0x31, // TOP-98A1 - 0x41, 0x42, 0x53, 0x02, 0x0a, 0x00, 0x0d, 0x03, // ABS..... - 0x0c, 0x11, 0x0a, 0x11, 0x0e, 0x11, 0x0b, 0x11, // ........ - 0x1f, 0x11, 0x1e, 0x11, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt1796[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x44, 0xc6, 0xee, 0x6b, // ./..D..k - 0x21, 0x00, 0x01, 0x00, 0x0c, 0x01, 0x2a, 0x7e, // !.....*~ - 0x1c, 0xab, 0x0b, 0x09, 0x31, 0x31, 0x30, 0x30, // ....1100 - 0x30, 0x37, 0x2d, 0x44, 0x55, 0x54, 0x02, 0x0a, // 07-DUT.. - 0x0c, 0x0b, 0x03, 0x0a, 0x11, 0x0c, 0x11, 0x0e, // ........ - 0x11, 0x1f, 0x11, 0x1e, 0x11, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt1797[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xf6, 0xc5, 0x54, 0x1a, // ./....T. - 0x94, 0xa0, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x97, // ......Z. - 0x44, 0xc2, 0x1c, 0x09, 0xe3, 0x82, 0x81, 0xe3, // D....... - 0x82, 0x81, 0xe3, 0x81, 0xbf, 0xe3, 0x81, 0xa1, // ........ - 0xe4, 0xb8, 0x96, 0xe7, 0x95, 0x8c, 0xe4, 0xb8, // ........ - 0x80, 0xe6, 0x8e, 0xa8, 0xe3, 0x81, 0x97, 0x17, // ........ - 0x03, 0x05, 0x11, 0x0a, 0x11, 0x0c, 0x11, 0x0e, // ........ - 0x11, 0x12, 0x11, 0x15, 0x11, 0x16, 0x11, 0x1f, // ........ - 0x11, 0x2f, 0x11, 0x00, 0x12, 0x32, 0x11, 0x01, // ./...2.. - 0x05, 0x81, 0x07, 0x00, 0xdf, 0x0c, 0xa9, 0x80, // ........ - 0xbb, 0x4f, 0x9f, 0x5c, 0x49, 0x06, 0xcb, 0x15, // .O.\I... - 0xaa, 0x9e, 0xa4, 0x00, 0xdf, 0x0c, 0xa9, 0x80, // ........ - 0xbb, 0x4f, 0x9f, 0x5c, 0x49, 0x06, 0xcb, 0x15, // .O.\I... - 0xcc, 0x9e, 0xa4, 0x5a, 0x6c, 0xb1, 0xa7, 0x6d, // ...Zl..m - 0xf1, 0xbc, 0x9b, 0xde, 0x3d, 0x5c, 0xae, 0x21, // ....=\.! - 0xfa, 0x2e, 0xa8, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt1821[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x30, 0x25, 0x92, 0xda, // ./..0%.. - 0xb0, 0xcc, 0x01, 0x00, 0x0c, 0x01, 0x2a, 0xf8, // ......*. - 0x3d, 0xbb, 0x0b, 0x09, 0x54, 0x32, 0x32, 0x30, // =...T220 - 0x34, 0x30, 0x2d, 0x44, 0x55, 0x54, 0x02, 0x0a, // 40-DUT.. - 0x00, 0x0d, 0x03, 0x0c, 0x11, 0x0a, 0x11, 0x0e, // ........ - 0x11, 0x0b, 0x11, 0x1f, 0x11, 0x1e, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt1840[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xc9, 0xfd, 0x14, 0x45, // ./.....E - 0x0a, 0x00, 0x01, 0x00, 0x04, 0x04, 0x24, 0x14, // ......$. - 0x51, 0xe8, 0x0e, 0x09, 0x41, 0x54, 0x48, 0x2d, // Q...ATH- - 0x43, 0x4b, 0x53, 0x33, 0x33, 0x30, 0x58, 0x42, // CKS330XB - 0x54, 0x15, 0x03, 0x31, 0x11, 0x08, 0x11, 0x03, // T..1.... - 0x12, 0x1e, 0x11, 0x0c, 0x11, 0x0f, 0x11, 0x0e, // ........ - 0x11, 0x0b, 0x11, 0x00, 0x12, 0x00, 0x10, 0x01, // ........ - 0x05, 0x01, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt1855[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x1c, 0xfb, 0xd3, 0x29, // ./.....) - 0x24, 0x58, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x1a, // $X....Z. - 0x0c, 0xb6, 0x0f, 0x09, 0x50, 0x69, 0x78, 0x65, // ....Pixe - 0x6c, 0x20, 0x36, 0x20, 0x50, 0x72, 0x6f, 0x20, // l 6 Pro - 0x30, 0x36, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 06...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x22, 0x1e, 0x7e, 0xb0, 0x4e, 0x50, 0x5d, 0x8b, // ".~.NP]. - 0x27, 0x47, 0x79, 0x5f, 0x63, 0x0b, 0xe5, 0xce, // 'Gy_c... - 0x5a, 0x6c, 0xb1, 0xa7, 0x6d, 0xf1, 0xbc, 0x9b, // Zl..m... - 0xde, 0x3d, 0x5c, 0xae, 0x21, 0xfa, 0x2e, 0xa8, // .=\.!... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt2092[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x30, 0x25, 0x92, 0xda, // ./..0%.. - 0xb0, 0xcc, 0x01, 0x00, 0x0c, 0x01, 0x2a, 0xf7, // ......*. - 0x3d, 0xbc, 0x0b, 0x09, 0x54, 0x32, 0x32, 0x30, // =...T220 - 0x34, 0x30, 0x2d, 0x44, 0x55, 0x54, 0x02, 0x0a, // 40-DUT.. - 0x00, 0x0d, 0x03, 0x0c, 0x11, 0x0a, 0x11, 0x0e, // ........ - 0x11, 0x0b, 0x11, 0x1f, 0x11, 0x1e, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt2098[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x15, 0xc0, 0x92, 0xc2, // ./...... - 0x69, 0xb8, 0x01, 0x00, 0x14, 0x04, 0x24, 0x06, // i.....$. - 0x74, 0xbd, 0x0b, 0x10, 0x01, 0x00, 0x57, 0x00, // t.....W. - 0x23, 0x00, 0x00, 0x00, 0x08, 0xff, 0x02, 0x0a, // #....... - 0x04, 0x11, 0x02, 0x0d, 0x11, 0x0b, 0x11, 0x0e, // ........ - 0x11, 0x0f, 0x11, 0x1e, 0x11, 0x08, 0x11, 0x31, // .......1 - 0x11, 0x01, 0x11, 0x0b, 0x09, 0x4a, 0x42, 0x4c, // .....JBL - 0x20, 0x46, 0x6c, 0x69, 0x70, 0x20, 0x33, 0x00, // Flip 3. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt2128[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xc9, 0xfd, 0x14, 0x45, // ./.....E - 0x0a, 0x00, 0x01, 0x00, 0x04, 0x04, 0x24, 0x14, // ......$. - 0x51, 0xb5, 0x0e, 0x09, 0x41, 0x54, 0x48, 0x2d, // Q...ATH- - 0x43, 0x4b, 0x53, 0x33, 0x33, 0x30, 0x58, 0x42, // CKS330XB - 0x54, 0x15, 0x03, 0x31, 0x11, 0x08, 0x11, 0x03, // T..1.... - 0x12, 0x1e, 0x11, 0x0c, 0x11, 0x0f, 0x11, 0x0e, // ........ - 0x11, 0x0b, 0x11, 0x00, 0x12, 0x00, 0x10, 0x01, // ........ - 0x05, 0x01, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt2150[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x6a, 0x78, 0xbf, 0x09, // ./..jx.. - 0x95, 0x3c, 0x01, 0x00, 0x0c, 0x01, 0x2a, 0x7c, // .<....*| - 0x4f, 0xb9, 0x10, 0x09, 0x44, 0x45, 0x53, 0x4b, // O...DESK - 0x54, 0x4f, 0x50, 0x2d, 0x39, 0x38, 0x41, 0x31, // TOP-98A1 - 0x41, 0x42, 0x53, 0x02, 0x0a, 0x00, 0x0d, 0x03, // ABS..... - 0x0c, 0x11, 0x0a, 0x11, 0x0e, 0x11, 0x0b, 0x11, // ........ - 0x1f, 0x11, 0x1e, 0x11, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt2151[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xd3, 0x4d, 0x3b, 0xe9, // ./...M;. - 0xbc, 0x4c, 0x01, 0x00, 0x3c, 0x24, 0x0c, 0x89, // .L..<$.. - 0x03, 0xb6, 0x1a, 0x09, 0x5b, 0x4c, 0x47, 0x5d, // ....[LG] - 0x20, 0x77, 0x65, 0x62, 0x4f, 0x53, 0x20, 0x54, // webOS T - 0x56, 0x20, 0x4f, 0x4c, 0x45, 0x44, 0x35, 0x35, // V OLED55 - 0x43, 0x31, 0x50, 0x53, 0x42, 0x07, 0x03, 0x0b, // C1PSB... - 0x11, 0x0e, 0x11, 0x00, 0x12, 0x01, 0x05, 0x01, // ........ - 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt2204[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xf6, 0xc5, 0x54, 0x1a, // ./....T. - 0x94, 0xa0, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x97, // ......Z. - 0x44, 0xc4, 0x1c, 0x09, 0xe3, 0x82, 0x81, 0xe3, // D....... - 0x82, 0x81, 0xe3, 0x81, 0xbf, 0xe3, 0x81, 0xa1, // ........ - 0xe4, 0xb8, 0x96, 0xe7, 0x95, 0x8c, 0xe4, 0xb8, // ........ - 0x80, 0xe6, 0x8e, 0xa8, 0xe3, 0x81, 0x97, 0x17, // ........ - 0x03, 0x05, 0x11, 0x0a, 0x11, 0x0c, 0x11, 0x0e, // ........ - 0x11, 0x12, 0x11, 0x15, 0x11, 0x16, 0x11, 0x1f, // ........ - 0x11, 0x2f, 0x11, 0x00, 0x12, 0x32, 0x11, 0x01, // ./...2.. - 0x05, 0x81, 0x07, 0x00, 0xdf, 0x0c, 0xa9, 0x80, // ........ - 0xbb, 0x4f, 0x9f, 0x5c, 0x49, 0x06, 0xcb, 0x15, // .O.\I... - 0xaa, 0x9e, 0xa4, 0x00, 0xdf, 0x0c, 0xa9, 0x80, // ........ - 0xbb, 0x4f, 0x9f, 0x5c, 0x49, 0x06, 0xcb, 0x15, // .O.\I... - 0xcc, 0x9e, 0xa4, 0x5a, 0x6c, 0xb1, 0xa7, 0x6d, // ...Zl..m - 0xf1, 0xbc, 0x9b, 0xde, 0x3d, 0x5c, 0xae, 0x21, // ....=\.! - 0xfa, 0x2e, 0xa8, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt2304[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x44, 0xc6, 0xee, 0x6b, // ./..D..k - 0x21, 0x00, 0x01, 0x00, 0x0c, 0x01, 0x2a, 0x7f, // !.....*. - 0x1c, 0xb1, 0x0b, 0x09, 0x31, 0x31, 0x30, 0x30, // ....1100 - 0x30, 0x37, 0x2d, 0x44, 0x55, 0x54, 0x02, 0x0a, // 07-DUT.. - 0x0c, 0x0b, 0x03, 0x0a, 0x11, 0x0c, 0x11, 0x0e, // ........ - 0x11, 0x1f, 0x11, 0x1e, 0x11, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt2432[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x1c, 0xfb, 0xd3, 0x29, // ./.....) - 0x24, 0x58, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x1b, // $X....Z. - 0x0c, 0xb5, 0x0f, 0x09, 0x50, 0x69, 0x78, 0x65, // ....Pixe - 0x6c, 0x20, 0x36, 0x20, 0x50, 0x72, 0x6f, 0x20, // l 6 Pro - 0x30, 0x36, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 06...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x22, 0x1e, 0x7e, 0xb0, 0x4e, 0x50, 0x5d, 0x8b, // ".~.NP]. - 0x27, 0x47, 0x79, 0x5f, 0x63, 0x0b, 0xe5, 0xce, // 'Gy_c... - 0x5a, 0x6c, 0xb1, 0xa7, 0x6d, 0xf1, 0xbc, 0x9b, // Zl..m... - 0xde, 0x3d, 0x5c, 0xae, 0x21, 0xfa, 0x2e, 0xa8, // .=\.!... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt2450[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xc9, 0xfd, 0x14, 0x45, // ./.....E - 0x0a, 0x00, 0x01, 0x00, 0x04, 0x04, 0x24, 0x14, // ......$. - 0x51, 0xbc, 0x0e, 0x09, 0x41, 0x54, 0x48, 0x2d, // Q...ATH- - 0x43, 0x4b, 0x53, 0x33, 0x33, 0x30, 0x58, 0x42, // CKS330XB - 0x54, 0x15, 0x03, 0x31, 0x11, 0x08, 0x11, 0x03, // T..1.... - 0x12, 0x1e, 0x11, 0x0c, 0x11, 0x0f, 0x11, 0x0e, // ........ - 0x11, 0x0b, 0x11, 0x00, 0x12, 0x00, 0x10, 0x01, // ........ - 0x05, 0x01, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt2457[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x1c, 0xfb, 0xd3, 0x29, // ./.....) - 0x24, 0x58, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x1b, // $X....Z. - 0x0c, 0xb5, 0x0f, 0x09, 0x50, 0x69, 0x78, 0x65, // ....Pixe - 0x6c, 0x20, 0x36, 0x20, 0x50, 0x72, 0x6f, 0x20, // l 6 Pro - 0x30, 0x36, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 06...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x22, 0x1e, 0x7e, 0xb0, 0x4e, 0x50, 0x5d, 0x8b, // ".~.NP]. - 0x27, 0x47, 0x79, 0x5f, 0x63, 0x0b, 0xe5, 0xce, // 'Gy_c... - 0x5a, 0x6c, 0xb1, 0xa7, 0x6d, 0xf1, 0xbc, 0x9b, // Zl..m... - 0xde, 0x3d, 0x5c, 0xae, 0x21, 0xfa, 0x2e, 0xa8, // .=\.!... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt2458[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xf6, 0xc5, 0x54, 0x1a, // ./....T. - 0x94, 0xa0, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x97, // ......Z. - 0x44, 0xbc, 0x1c, 0x09, 0xe3, 0x82, 0x81, 0xe3, // D....... - 0x82, 0x81, 0xe3, 0x81, 0xbf, 0xe3, 0x81, 0xa1, // ........ - 0xe4, 0xb8, 0x96, 0xe7, 0x95, 0x8c, 0xe4, 0xb8, // ........ - 0x80, 0xe6, 0x8e, 0xa8, 0xe3, 0x81, 0x97, 0x17, // ........ - 0x03, 0x05, 0x11, 0x0a, 0x11, 0x0c, 0x11, 0x0e, // ........ - 0x11, 0x12, 0x11, 0x15, 0x11, 0x16, 0x11, 0x1f, // ........ - 0x11, 0x2f, 0x11, 0x00, 0x12, 0x32, 0x11, 0x01, // ./...2.. - 0x05, 0x81, 0x07, 0x00, 0xdf, 0x0c, 0xa9, 0x80, // ........ - 0xbb, 0x4f, 0x9f, 0x5c, 0x49, 0x06, 0xcb, 0x15, // .O.\I... - 0xaa, 0x9e, 0xa4, 0x00, 0xdf, 0x0c, 0xa9, 0x80, // ........ - 0xbb, 0x4f, 0x9f, 0x5c, 0x49, 0x06, 0xcb, 0x15, // .O.\I... - 0xcc, 0x9e, 0xa4, 0x5a, 0x6c, 0xb1, 0xa7, 0x6d, // ...Zl..m - 0xf1, 0xbc, 0x9b, 0xde, 0x3d, 0x5c, 0xae, 0x21, // ....=\.! - 0xfa, 0x2e, 0xa8, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt2468[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x6a, 0x78, 0xbf, 0x09, // ./..jx.. - 0x95, 0x3c, 0x01, 0x00, 0x0c, 0x01, 0x2a, 0x7c, // .<....*| - 0x4f, 0xb8, 0x10, 0x09, 0x44, 0x45, 0x53, 0x4b, // O...DESK - 0x54, 0x4f, 0x50, 0x2d, 0x39, 0x38, 0x41, 0x31, // TOP-98A1 - 0x41, 0x42, 0x53, 0x02, 0x0a, 0x00, 0x0d, 0x03, // ABS..... - 0x0c, 0x11, 0x0a, 0x11, 0x0e, 0x11, 0x0b, 0x11, // ........ - 0x1f, 0x11, 0x1e, 0x11, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt2469[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xc2, 0x3c, 0x42, 0xd9, // ./...<B. - 0x64, 0xbc, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0xf9, // d.....Z. - 0x54, 0xa6, 0x10, 0x09, 0x4f, 0x50, 0x50, 0x4f, // T...OPPO - 0x20, 0x52, 0x65, 0x6e, 0x6f, 0x38, 0x20, 0x54, // Reno8 T - 0x20, 0x35, 0x47, 0x17, 0x03, 0x05, 0x11, 0x0a, // 5G..... - 0x11, 0x0c, 0x11, 0x0e, 0x11, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt2506[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xd3, 0x4d, 0x3b, 0xe9, // ./...M;. - 0xbc, 0x4c, 0x01, 0x00, 0x3c, 0x24, 0x0c, 0x89, // .L..<$.. - 0x03, 0xb0, 0x1a, 0x09, 0x5b, 0x4c, 0x47, 0x5d, // ....[LG] - 0x20, 0x77, 0x65, 0x62, 0x4f, 0x53, 0x20, 0x54, // webOS T - 0x56, 0x20, 0x4f, 0x4c, 0x45, 0x44, 0x35, 0x35, // V OLED55 - 0x43, 0x31, 0x50, 0x53, 0x42, 0x07, 0x03, 0x0b, // C1PSB... - 0x11, 0x0e, 0x11, 0x00, 0x12, 0x01, 0x05, 0x01, // ........ - 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt2516[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xda, 0xbd, 0x68, 0x72, // ./....hr - 0x6e, 0xb0, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0xc4, // n.....Z. - 0x5b, 0xab, 0x10, 0x09, 0x72, 0x65, 0x61, 0x6c, // [...real - 0x6d, 0x65, 0x20, 0x47, 0x54, 0x20, 0x4e, 0x45, // me GT NE - 0x4f, 0x20, 0x33, 0x19, 0x03, 0x05, 0x11, 0x0a, // O 3..... - 0x11, 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, // ........ - 0x11, 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, // .....-./ - 0x11, 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, // ...2.... - 0x07, 0x00, 0xdf, 0x0c, 0xa9, 0x80, 0xbb, 0x4f, // .......O - 0x9f, 0x5c, 0x49, 0x06, 0xcb, 0x15, 0xaa, 0x9e, // .\I..... - 0xa4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt2599[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x15, 0xc0, 0x92, 0xc2, // ./...... - 0x69, 0xb8, 0x01, 0x00, 0x14, 0x04, 0x24, 0x06, // i.....$. - 0x74, 0xbe, 0x0b, 0x10, 0x01, 0x00, 0x57, 0x00, // t.....W. - 0x23, 0x00, 0x00, 0x00, 0x08, 0xff, 0x02, 0x0a, // #....... - 0x04, 0x11, 0x02, 0x0d, 0x11, 0x0b, 0x11, 0x0e, // ........ - 0x11, 0x0f, 0x11, 0x1e, 0x11, 0x08, 0x11, 0x31, // .......1 - 0x11, 0x01, 0x11, 0x0b, 0x09, 0x4a, 0x42, 0x4c, // .....JBL - 0x20, 0x46, 0x6c, 0x69, 0x70, 0x20, 0x33, 0x00, // Flip 3. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt2759[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x30, 0x25, 0x92, 0xda, // ./..0%.. - 0xb0, 0xcc, 0x01, 0x00, 0x0c, 0x01, 0x2a, 0xf7, // ......*. - 0x3d, 0xbc, 0x0b, 0x09, 0x54, 0x32, 0x32, 0x30, // =...T220 - 0x34, 0x30, 0x2d, 0x44, 0x55, 0x54, 0x02, 0x0a, // 40-DUT.. - 0x00, 0x0d, 0x03, 0x0c, 0x11, 0x0a, 0x11, 0x0e, // ........ - 0x11, 0x0b, 0x11, 0x1f, 0x11, 0x1e, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt2761[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x44, 0xc6, 0xee, 0x6b, // ./..D..k - 0x21, 0x00, 0x01, 0x00, 0x0c, 0x01, 0x2a, 0x7e, // !.....*~ - 0x1c, 0xae, 0x0b, 0x09, 0x31, 0x31, 0x30, 0x30, // ....1100 - 0x30, 0x37, 0x2d, 0x44, 0x55, 0x54, 0x02, 0x0a, // 07-DUT.. - 0x0c, 0x0b, 0x03, 0x0a, 0x11, 0x0c, 0x11, 0x0e, // ........ - 0x11, 0x1f, 0x11, 0x1e, 0x11, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt2778[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x1c, 0xfb, 0xd3, 0x29, // ./.....) - 0x24, 0x58, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x1a, // $X....Z. - 0x0c, 0xb5, 0x0f, 0x09, 0x50, 0x69, 0x78, 0x65, // ....Pixe - 0x6c, 0x20, 0x36, 0x20, 0x50, 0x72, 0x6f, 0x20, // l 6 Pro - 0x30, 0x36, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 06...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x22, 0x1e, 0x7e, 0xb0, 0x4e, 0x50, 0x5d, 0x8b, // ".~.NP]. - 0x27, 0x47, 0x79, 0x5f, 0x63, 0x0b, 0xe5, 0xce, // 'Gy_c... - 0x5a, 0x6c, 0xb1, 0xa7, 0x6d, 0xf1, 0xbc, 0x9b, // Zl..m... - 0xde, 0x3d, 0x5c, 0xae, 0x21, 0xfa, 0x2e, 0xa8, // .=\.!... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt2779[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xd3, 0x4d, 0x3b, 0xe9, // ./...M;. - 0xbc, 0x4c, 0x01, 0x00, 0x3c, 0x24, 0x0c, 0x89, // .L..<$.. - 0x03, 0xb9, 0x1a, 0x09, 0x5b, 0x4c, 0x47, 0x5d, // ....[LG] - 0x20, 0x77, 0x65, 0x62, 0x4f, 0x53, 0x20, 0x54, // webOS T - 0x56, 0x20, 0x4f, 0x4c, 0x45, 0x44, 0x35, 0x35, // V OLED55 - 0x43, 0x31, 0x50, 0x53, 0x42, 0x07, 0x03, 0x0b, // C1PSB... - 0x11, 0x0e, 0x11, 0x00, 0x12, 0x01, 0x05, 0x01, // ........ - 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt2780[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x30, 0x25, 0x92, 0xda, // ./..0%.. - 0xb0, 0xcc, 0x01, 0x00, 0x0c, 0x01, 0x2a, 0xf7, // ......*. - 0x3d, 0xbe, 0x0b, 0x09, 0x54, 0x32, 0x32, 0x30, // =...T220 - 0x34, 0x30, 0x2d, 0x44, 0x55, 0x54, 0x02, 0x0a, // 40-DUT.. - 0x00, 0x0d, 0x03, 0x0c, 0x11, 0x0a, 0x11, 0x0e, // ........ - 0x11, 0x0b, 0x11, 0x1f, 0x11, 0x1e, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt2788[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xf6, 0xc5, 0x54, 0x1a, // ./....T. - 0x94, 0xa0, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x98, // ......Z. - 0x44, 0xc0, 0x1c, 0x09, 0xe3, 0x82, 0x81, 0xe3, // D....... - 0x82, 0x81, 0xe3, 0x81, 0xbf, 0xe3, 0x81, 0xa1, // ........ - 0xe4, 0xb8, 0x96, 0xe7, 0x95, 0x8c, 0xe4, 0xb8, // ........ - 0x80, 0xe6, 0x8e, 0xa8, 0xe3, 0x81, 0x97, 0x17, // ........ - 0x03, 0x05, 0x11, 0x0a, 0x11, 0x0c, 0x11, 0x0e, // ........ - 0x11, 0x12, 0x11, 0x15, 0x11, 0x16, 0x11, 0x1f, // ........ - 0x11, 0x2f, 0x11, 0x00, 0x12, 0x32, 0x11, 0x01, // ./...2.. - 0x05, 0x81, 0x07, 0x00, 0xdf, 0x0c, 0xa9, 0x80, // ........ - 0xbb, 0x4f, 0x9f, 0x5c, 0x49, 0x06, 0xcb, 0x15, // .O.\I... - 0xaa, 0x9e, 0xa4, 0x00, 0xdf, 0x0c, 0xa9, 0x80, // ........ - 0xbb, 0x4f, 0x9f, 0x5c, 0x49, 0x06, 0xcb, 0x15, // .O.\I... - 0xcc, 0x9e, 0xa4, 0x5a, 0x6c, 0xb1, 0xa7, 0x6d, // ...Zl..m - 0xf1, 0xbc, 0x9b, 0xde, 0x3d, 0x5c, 0xae, 0x21, // ....=\.! - 0xfa, 0x2e, 0xa8, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt2818[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xc9, 0xfd, 0x14, 0x45, // ./.....E - 0x0a, 0x00, 0x01, 0x00, 0x04, 0x04, 0x24, 0x13, // ......$. - 0x51, 0xaf, 0x0e, 0x09, 0x41, 0x54, 0x48, 0x2d, // Q...ATH- - 0x43, 0x4b, 0x53, 0x33, 0x33, 0x30, 0x58, 0x42, // CKS330XB - 0x54, 0x15, 0x03, 0x31, 0x11, 0x08, 0x11, 0x03, // T..1.... - 0x12, 0x1e, 0x11, 0x0c, 0x11, 0x0f, 0x11, 0x0e, // ........ - 0x11, 0x0b, 0x11, 0x00, 0x12, 0x00, 0x10, 0x01, // ........ - 0x05, 0x01, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt2890[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x44, 0xc6, 0xee, 0x6b, // ./..D..k - 0x21, 0x00, 0x01, 0x00, 0x0c, 0x01, 0x2a, 0x7e, // !.....*~ - 0x1c, 0xad, 0x0b, 0x09, 0x31, 0x31, 0x30, 0x30, // ....1100 - 0x30, 0x37, 0x2d, 0x44, 0x55, 0x54, 0x02, 0x0a, // 07-DUT.. - 0x0c, 0x0b, 0x03, 0x0a, 0x11, 0x0c, 0x11, 0x0e, // ........ - 0x11, 0x1f, 0x11, 0x1e, 0x11, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt2931[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x6a, 0x78, 0xbf, 0x09, // ./..jx.. - 0x95, 0x3c, 0x01, 0x00, 0x0c, 0x01, 0x2a, 0x7c, // .<....*| - 0x4f, 0xb2, 0x10, 0x09, 0x44, 0x45, 0x53, 0x4b, // O...DESK - 0x54, 0x4f, 0x50, 0x2d, 0x39, 0x38, 0x41, 0x31, // TOP-98A1 - 0x41, 0x42, 0x53, 0x02, 0x0a, 0x00, 0x0d, 0x03, // ABS..... - 0x0c, 0x11, 0x0a, 0x11, 0x0e, 0x11, 0x0b, 0x11, // ........ - 0x1f, 0x11, 0x1e, 0x11, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt3390[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xf6, 0xc5, 0x54, 0x1a, // ./....T. - 0x94, 0xa0, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x97, // ......Z. - 0x44, 0xb4, 0x1c, 0x09, 0xe3, 0x82, 0x81, 0xe3, // D....... - 0x82, 0x81, 0xe3, 0x81, 0xbf, 0xe3, 0x81, 0xa1, // ........ - 0xe4, 0xb8, 0x96, 0xe7, 0x95, 0x8c, 0xe4, 0xb8, // ........ - 0x80, 0xe6, 0x8e, 0xa8, 0xe3, 0x81, 0x97, 0x17, // ........ - 0x03, 0x05, 0x11, 0x0a, 0x11, 0x0c, 0x11, 0x0e, // ........ - 0x11, 0x12, 0x11, 0x15, 0x11, 0x16, 0x11, 0x1f, // ........ - 0x11, 0x2f, 0x11, 0x00, 0x12, 0x32, 0x11, 0x01, // ./...2.. - 0x05, 0x81, 0x07, 0x00, 0xdf, 0x0c, 0xa9, 0x80, // ........ - 0xbb, 0x4f, 0x9f, 0x5c, 0x49, 0x06, 0xcb, 0x15, // .O.\I... - 0xaa, 0x9e, 0xa4, 0x00, 0xdf, 0x0c, 0xa9, 0x80, // ........ - 0xbb, 0x4f, 0x9f, 0x5c, 0x49, 0x06, 0xcb, 0x15, // .O.\I... - 0xcc, 0x9e, 0xa4, 0x5a, 0x6c, 0xb1, 0xa7, 0x6d, // ...Zl..m - 0xf1, 0xbc, 0x9b, 0xde, 0x3d, 0x5c, 0xae, 0x21, // ....=\.! - 0xfa, 0x2e, 0xa8, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt3391[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xc9, 0xfd, 0x14, 0x45, // ./.....E - 0x0a, 0x00, 0x01, 0x00, 0x04, 0x04, 0x24, 0x0e, // ......$. - 0x51, 0xb0, 0x0e, 0x09, 0x41, 0x54, 0x48, 0x2d, // Q...ATH- - 0x43, 0x4b, 0x53, 0x33, 0x33, 0x30, 0x58, 0x42, // CKS330XB - 0x54, 0x15, 0x03, 0x31, 0x11, 0x08, 0x11, 0x03, // T..1.... - 0x12, 0x1e, 0x11, 0x0c, 0x11, 0x0f, 0x11, 0x0e, // ........ - 0x11, 0x0b, 0x11, 0x00, 0x12, 0x00, 0x10, 0x01, // ........ - 0x05, 0x01, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt3392[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x0d, 0x19, 0xf0, 0x1b, // ./...... - 0x3e, 0x5c, 0x01, 0x00, 0x0c, 0x02, 0x7a, 0x61, // >\....za - 0x06, 0xaf, 0x12, 0x09, 0xe5, 0x98, 0x8e, 0xe5, // ........ - 0x98, 0x8e, 0x20, 0xe7, 0x9a, 0x84, 0x20, 0x69, // .. ... i - 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x11, 0x03, 0x00, // Phone... - 0x12, 0x1f, 0x11, 0x2f, 0x11, 0x0a, 0x11, 0x0c, // .../.... - 0x11, 0x16, 0x11, 0x32, 0x11, 0x01, 0x18, 0x01, // ...2.... - 0x05, 0x31, 0x07, 0xfe, 0xca, 0xca, 0xde, 0xaf, // .1...... - 0xde, 0xca, 0xde, 0xde, 0xfa, 0xca, 0xde, 0x00, // ........ - 0x00, 0x00, 0x00, 0x77, 0x0a, 0x6a, 0x10, 0xa2, // ...w.j.. - 0x22, 0xf2, 0x86, 0x5f, 0x41, 0x19, 0x1d, 0x02, // ".._A... - 0x03, 0x03, 0x02, 0x1a, 0x29, 0xea, 0xab, 0x01, // ....)... - 0x73, 0xbc, 0x88, 0x1c, 0x45, 0x4d, 0xe1, 0x66, // s...EM.f - 0x24, 0x8d, 0x2d, 0x27, 0xff, 0x00, 0x4c, 0x02, // $.-'..L. - 0x24, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // $....... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt3393[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xd3, 0x4d, 0x3b, 0xe9, // ./...M;. - 0xbc, 0x4c, 0x01, 0x00, 0x3c, 0x24, 0x0c, 0x85, // .L..<$.. - 0x03, 0xaa, 0x1a, 0x09, 0x5b, 0x4c, 0x47, 0x5d, // ....[LG] - 0x20, 0x77, 0x65, 0x62, 0x4f, 0x53, 0x20, 0x54, // webOS T - 0x56, 0x20, 0x4f, 0x4c, 0x45, 0x44, 0x35, 0x35, // V OLED55 - 0x43, 0x31, 0x50, 0x53, 0x42, 0x07, 0x03, 0x0b, // C1PSB... - 0x11, 0x0e, 0x11, 0x00, 0x12, 0x01, 0x05, 0x01, // ........ - 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt3436[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x6a, 0x78, 0xbf, 0x09, // ./..jx.. - 0x95, 0x3c, 0x01, 0x00, 0x0c, 0x01, 0x2a, 0x79, // .<....*y - 0x4f, 0xba, 0x10, 0x09, 0x44, 0x45, 0x53, 0x4b, // O...DESK - 0x54, 0x4f, 0x50, 0x2d, 0x39, 0x38, 0x41, 0x31, // TOP-98A1 - 0x41, 0x42, 0x53, 0x02, 0x0a, 0x00, 0x0d, 0x03, // ABS..... - 0x0c, 0x11, 0x0a, 0x11, 0x0e, 0x11, 0x0b, 0x11, // ........ - 0x1f, 0x11, 0x1e, 0x11, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt3437[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x30, 0x25, 0x92, 0xda, // ./..0%.. - 0xb0, 0xcc, 0x01, 0x00, 0x0c, 0x01, 0x2a, 0xf6, // ......*. - 0x3d, 0xb9, 0x0b, 0x09, 0x54, 0x32, 0x32, 0x30, // =...T220 - 0x34, 0x30, 0x2d, 0x44, 0x55, 0x54, 0x02, 0x0a, // 40-DUT.. - 0x00, 0x0d, 0x03, 0x0c, 0x11, 0x0a, 0x11, 0x0e, // ........ - 0x11, 0x0b, 0x11, 0x1f, 0x11, 0x1e, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt3439[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xda, 0xbd, 0x68, 0x72, // ./....hr - 0x6e, 0xb0, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0xc4, // n.....Z. - 0x5b, 0xb1, 0x10, 0x09, 0x72, 0x65, 0x61, 0x6c, // [...real - 0x6d, 0x65, 0x20, 0x47, 0x54, 0x20, 0x4e, 0x45, // me GT NE - 0x4f, 0x20, 0x33, 0x19, 0x03, 0x05, 0x11, 0x0a, // O 3..... - 0x11, 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, // ........ - 0x11, 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, // .....-./ - 0x11, 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, // ...2.... - 0x07, 0x00, 0xdf, 0x0c, 0xa9, 0x80, 0xbb, 0x4f, // .......O - 0x9f, 0x5c, 0x49, 0x06, 0xcb, 0x15, 0xaa, 0x9e, // .\I..... - 0xa4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt4807[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x44, 0xc6, 0xee, 0x6b, // ./..D..k - 0x21, 0x00, 0x01, 0x00, 0x0c, 0x01, 0x2a, 0x7c, // !.....*| - 0x1c, 0xab, 0x0b, 0x09, 0x31, 0x31, 0x30, 0x30, // ....1100 - 0x30, 0x37, 0x2d, 0x44, 0x55, 0x54, 0x02, 0x0a, // 07-DUT.. - 0x0c, 0x0b, 0x03, 0x0a, 0x11, 0x0c, 0x11, 0x0e, // ........ - 0x11, 0x1f, 0x11, 0x1e, 0x11, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt4817[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xd3, 0x4d, 0x3b, 0xe9, // ./...M;. - 0xbc, 0x4c, 0x01, 0x00, 0x3c, 0x24, 0x0c, 0x81, // .L..<$.. - 0x03, 0xb6, 0x1a, 0x09, 0x5b, 0x4c, 0x47, 0x5d, // ....[LG] - 0x20, 0x77, 0x65, 0x62, 0x4f, 0x53, 0x20, 0x54, // webOS T - 0x56, 0x20, 0x4f, 0x4c, 0x45, 0x44, 0x35, 0x35, // V OLED55 - 0x43, 0x31, 0x50, 0x53, 0x42, 0x07, 0x03, 0x0b, // C1PSB... - 0x11, 0x0e, 0x11, 0x00, 0x12, 0x01, 0x05, 0x01, // ........ - 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt4844[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x6a, 0x78, 0xbf, 0x09, // ./..jx.. - 0x95, 0x3c, 0x01, 0x00, 0x0c, 0x01, 0x2a, 0x79, // .<....*y - 0x4f, 0xbc, 0x10, 0x09, 0x44, 0x45, 0x53, 0x4b, // O...DESK - 0x54, 0x4f, 0x50, 0x2d, 0x39, 0x38, 0x41, 0x31, // TOP-98A1 - 0x41, 0x42, 0x53, 0x02, 0x0a, 0x00, 0x0d, 0x03, // ABS..... - 0x0c, 0x11, 0x0a, 0x11, 0x0e, 0x11, 0x0b, 0x11, // ........ - 0x1f, 0x11, 0x1e, 0x11, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt4845[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x30, 0x25, 0x92, 0xda, // ./..0%.. - 0xb0, 0xcc, 0x01, 0x00, 0x0c, 0x01, 0x2a, 0xf6, // ......*. - 0x3d, 0xb6, 0x0b, 0x09, 0x54, 0x32, 0x32, 0x30, // =...T220 - 0x34, 0x30, 0x2d, 0x44, 0x55, 0x54, 0x02, 0x0a, // 40-DUT.. - 0x00, 0x0d, 0x03, 0x0c, 0x11, 0x0a, 0x11, 0x0e, // ........ - 0x11, 0x0b, 0x11, 0x1f, 0x11, 0x1e, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt4925[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xc9, 0xfd, 0x14, 0x45, // ./.....E - 0x0a, 0x00, 0x01, 0x00, 0x04, 0x04, 0x24, 0x09, // ......$. - 0x51, 0xac, 0x0e, 0x09, 0x41, 0x54, 0x48, 0x2d, // Q...ATH- - 0x43, 0x4b, 0x53, 0x33, 0x33, 0x30, 0x58, 0x42, // CKS330XB - 0x54, 0x15, 0x03, 0x31, 0x11, 0x08, 0x11, 0x03, // T..1.... - 0x12, 0x1e, 0x11, 0x0c, 0x11, 0x0f, 0x11, 0x0e, // ........ - 0x11, 0x0b, 0x11, 0x00, 0x12, 0x00, 0x10, 0x01, // ........ - 0x05, 0x01, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt4962[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x1c, 0xfb, 0xd3, 0x29, // ./.....) - 0x24, 0x58, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x1c, // $X....Z. - 0x0c, 0xc0, 0x0f, 0x09, 0x50, 0x69, 0x78, 0x65, // ....Pixe - 0x6c, 0x20, 0x36, 0x20, 0x50, 0x72, 0x6f, 0x20, // l 6 Pro - 0x30, 0x36, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, // 06...... - 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, // ........ - 0x16, 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, // ....-./. - 0x00, 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, // ..2..... - 0x22, 0x1e, 0x7e, 0xb0, 0x4e, 0x50, 0x5d, 0x8b, // ".~.NP]. - 0x27, 0x47, 0x79, 0x5f, 0x63, 0x0b, 0xe5, 0xce, // 'Gy_c... - 0x5a, 0x6c, 0xb1, 0xa7, 0x6d, 0xf1, 0xbc, 0x9b, // Zl..m... - 0xde, 0x3d, 0x5c, 0xae, 0x21, 0xfa, 0x2e, 0xa8, // .=\.!... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt4979[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xc2, 0x3c, 0x42, 0xd9, // ./...<B. - 0x64, 0xbc, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0xfd, // d.....Z. - 0x54, 0xa7, 0x10, 0x09, 0x4f, 0x50, 0x50, 0x4f, // T...OPPO - 0x20, 0x52, 0x65, 0x6e, 0x6f, 0x38, 0x20, 0x54, // Reno8 T - 0x20, 0x35, 0x47, 0x17, 0x03, 0x05, 0x11, 0x0a, // 5G..... - 0x11, 0x0c, 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, // ........ - 0x11, 0x16, 0x11, 0x1f, 0x11, 0x2f, 0x11, 0x00, // ...../.. - 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, 0x00, // .2...... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt5162[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xf6, 0xc5, 0x54, 0x1a, // ./....T. - 0x94, 0xa0, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x96, // ......Z. - 0x44, 0xbe, 0x1c, 0x09, 0xe3, 0x82, 0x81, 0xe3, // D....... - 0x82, 0x81, 0xe3, 0x81, 0xbf, 0xe3, 0x81, 0xa1, // ........ - 0xe4, 0xb8, 0x96, 0xe7, 0x95, 0x8c, 0xe4, 0xb8, // ........ - 0x80, 0xe6, 0x8e, 0xa8, 0xe3, 0x81, 0x97, 0x17, // ........ - 0x03, 0x05, 0x11, 0x0a, 0x11, 0x0c, 0x11, 0x0e, // ........ - 0x11, 0x12, 0x11, 0x15, 0x11, 0x16, 0x11, 0x1f, // ........ - 0x11, 0x2f, 0x11, 0x00, 0x12, 0x32, 0x11, 0x01, // ./...2.. - 0x05, 0x81, 0x07, 0x00, 0xdf, 0x0c, 0xa9, 0x80, // ........ - 0xbb, 0x4f, 0x9f, 0x5c, 0x49, 0x06, 0xcb, 0x15, // .O.\I... - 0xaa, 0x9e, 0xa4, 0x00, 0xdf, 0x0c, 0xa9, 0x80, // ........ - 0xbb, 0x4f, 0x9f, 0x5c, 0x49, 0x06, 0xcb, 0x15, // .O.\I... - 0xcc, 0x9e, 0xa4, 0x5a, 0x6c, 0xb1, 0xa7, 0x6d, // ...Zl..m - 0xf1, 0xbc, 0x9b, 0xde, 0x3d, 0x5c, 0xae, 0x21, // ....=\.! - 0xfa, 0x2e, 0xa8, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt5163[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xc9, 0xfd, 0x14, 0x45, // ./.....E - 0x0a, 0x00, 0x01, 0x00, 0x04, 0x04, 0x24, 0x03, // ......$. - 0x51, 0xb7, 0x0e, 0x09, 0x41, 0x54, 0x48, 0x2d, // Q...ATH- - 0x43, 0x4b, 0x53, 0x33, 0x33, 0x30, 0x58, 0x42, // CKS330XB - 0x54, 0x15, 0x03, 0x31, 0x11, 0x08, 0x11, 0x03, // T..1.... - 0x12, 0x1e, 0x11, 0x0c, 0x11, 0x0f, 0x11, 0x0e, // ........ - 0x11, 0x0b, 0x11, 0x00, 0x12, 0x00, 0x10, 0x01, // ........ - 0x05, 0x01, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt5178[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x6a, 0x78, 0xbf, 0x09, // ./..jx.. - 0x95, 0x3c, 0x01, 0x00, 0x0c, 0x01, 0x2a, 0x78, // .<....*x - 0x4f, 0xb3, 0x10, 0x09, 0x44, 0x45, 0x53, 0x4b, // O...DESK - 0x54, 0x4f, 0x50, 0x2d, 0x39, 0x38, 0x41, 0x31, // TOP-98A1 - 0x41, 0x42, 0x53, 0x02, 0x0a, 0x00, 0x0d, 0x03, // ABS..... - 0x0c, 0x11, 0x0a, 0x11, 0x0e, 0x11, 0x0b, 0x11, // ........ - 0x1f, 0x11, 0x1e, 0x11, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt5192[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x44, 0xc6, 0xee, 0x6b, // ./..D..k - 0x21, 0x00, 0x01, 0x00, 0x0c, 0x01, 0x2a, 0x7d, // !.....*} - 0x1c, 0xa7, 0x0b, 0x09, 0x31, 0x31, 0x30, 0x30, // ....1100 - 0x30, 0x37, 0x2d, 0x44, 0x55, 0x54, 0x02, 0x0a, // 07-DUT.. - 0x0c, 0x0b, 0x03, 0x0a, 0x11, 0x0c, 0x11, 0x0e, // ........ - 0x11, 0x1f, 0x11, 0x1e, 0x11, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt5193[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x30, 0xf6, 0xd3, 0x29, // ./..0..) - 0x24, 0x58, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0xa0, // $X....Z. - 0x27, 0xa9, 0x06, 0x09, 0x4a, 0x6f, 0x6b, 0x65, // '...Joke - 0x72, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, 0x0c, // r....... - 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, 0x16, // ........ - 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, 0x00, // ...-./.. - 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, 0x5a, // .2.....Z - 0x6c, 0xb1, 0xa7, 0x6d, 0xf1, 0xbc, 0x9b, 0xde, // l..m.... - 0x3d, 0x5c, 0xae, 0x21, 0xfa, 0x2e, 0xa8, 0x00, // =\.!.... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt5238[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x30, 0x25, 0x92, 0xda, // ./..0%.. - 0xb0, 0xcc, 0x01, 0x00, 0x0c, 0x01, 0x2a, 0xf4, // ......*. - 0x3d, 0xb1, 0x0b, 0x09, 0x54, 0x32, 0x32, 0x30, // =...T220 - 0x34, 0x30, 0x2d, 0x44, 0x55, 0x54, 0x02, 0x0a, // 40-DUT.. - 0x00, 0x0d, 0x03, 0x0c, 0x11, 0x0a, 0x11, 0x0e, // ........ - 0x11, 0x0b, 0x11, 0x1f, 0x11, 0x1e, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt5264[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xd3, 0x4d, 0x3b, 0xe9, // ./...M;. - 0xbc, 0x4c, 0x01, 0x00, 0x3c, 0x24, 0x0c, 0x7f, // .L..<$.. - 0x03, 0xac, 0x1a, 0x09, 0x5b, 0x4c, 0x47, 0x5d, // ....[LG] - 0x20, 0x77, 0x65, 0x62, 0x4f, 0x53, 0x20, 0x54, // webOS T - 0x56, 0x20, 0x4f, 0x4c, 0x45, 0x44, 0x35, 0x35, // V OLED55 - 0x43, 0x31, 0x50, 0x53, 0x42, 0x07, 0x03, 0x0b, // C1PSB... - 0x11, 0x0e, 0x11, 0x00, 0x12, 0x01, 0x05, 0x01, // ........ - 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt5448[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x39, 0xf0, 0x33, 0xd3, // ./..9.3. - 0x5f, 0x98, 0x01, 0x00, 0x0c, 0x01, 0x2a, 0x48, // _.....*H - 0x5a, 0xcd, 0x10, 0x09, 0x44, 0x45, 0x53, 0x4b, // Z...DESK - 0x54, 0x4f, 0x50, 0x2d, 0x56, 0x38, 0x30, 0x41, // TOP-V80A - 0x51, 0x4a, 0x34, 0x02, 0x0a, 0x04, 0x0d, 0x03, // QJ4..... - 0x0c, 0x11, 0x0a, 0x11, 0x0e, 0x11, 0x0b, 0x11, // ........ - 0x1f, 0x11, 0x1e, 0x11, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt5482[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xf6, 0xc5, 0x54, 0x1a, // ./....T. - 0x94, 0xa0, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0x96, // ......Z. - 0x44, 0xc4, 0x1c, 0x09, 0xe3, 0x82, 0x81, 0xe3, // D....... - 0x82, 0x81, 0xe3, 0x81, 0xbf, 0xe3, 0x81, 0xa1, // ........ - 0xe4, 0xb8, 0x96, 0xe7, 0x95, 0x8c, 0xe4, 0xb8, // ........ - 0x80, 0xe6, 0x8e, 0xa8, 0xe3, 0x81, 0x97, 0x17, // ........ - 0x03, 0x05, 0x11, 0x0a, 0x11, 0x0c, 0x11, 0x0e, // ........ - 0x11, 0x12, 0x11, 0x15, 0x11, 0x16, 0x11, 0x1f, // ........ - 0x11, 0x2f, 0x11, 0x00, 0x12, 0x32, 0x11, 0x01, // ./...2.. - 0x05, 0x81, 0x07, 0x00, 0xdf, 0x0c, 0xa9, 0x80, // ........ - 0xbb, 0x4f, 0x9f, 0x5c, 0x49, 0x06, 0xcb, 0x15, // .O.\I... - 0xaa, 0x9e, 0xa4, 0x00, 0xdf, 0x0c, 0xa9, 0x80, // ........ - 0xbb, 0x4f, 0x9f, 0x5c, 0x49, 0x06, 0xcb, 0x15, // .O.\I... - 0xcc, 0x9e, 0xa4, 0x5a, 0x6c, 0xb1, 0xa7, 0x6d, // ...Zl..m - 0xf1, 0xbc, 0x9b, 0xde, 0x3d, 0x5c, 0xae, 0x21, // ....=\.! - 0xfa, 0x2e, 0xa8, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt5501[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xd3, 0x4d, 0x3b, 0xe9, // ./...M;. - 0xbc, 0x4c, 0x01, 0x00, 0x3c, 0x24, 0x0c, 0x7e, // .L..<$.~ - 0x03, 0xa8, 0x1a, 0x09, 0x5b, 0x4c, 0x47, 0x5d, // ....[LG] - 0x20, 0x77, 0x65, 0x62, 0x4f, 0x53, 0x20, 0x54, // webOS T - 0x56, 0x20, 0x4f, 0x4c, 0x45, 0x44, 0x35, 0x35, // V OLED55 - 0x43, 0x31, 0x50, 0x53, 0x42, 0x07, 0x03, 0x0b, // C1PSB... - 0x11, 0x0e, 0x11, 0x00, 0x12, 0x01, 0x05, 0x01, // ........ - 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt5509[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x30, 0x25, 0x92, 0xda, // ./..0%.. - 0xb0, 0xcc, 0x01, 0x00, 0x0c, 0x01, 0x2a, 0xf5, // ......*. - 0x3d, 0xae, 0x0b, 0x09, 0x54, 0x32, 0x32, 0x30, // =...T220 - 0x34, 0x30, 0x2d, 0x44, 0x55, 0x54, 0x02, 0x0a, // 40-DUT.. - 0x00, 0x0d, 0x03, 0x0c, 0x11, 0x0a, 0x11, 0x0e, // ........ - 0x11, 0x0b, 0x11, 0x1f, 0x11, 0x1e, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt5511[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x39, 0xf0, 0x33, 0xd3, // ./..9.3. - 0x5f, 0x98, 0x01, 0x00, 0x0c, 0x01, 0x2a, 0x48, // _.....*H - 0x5a, 0xd0, 0x10, 0x09, 0x44, 0x45, 0x53, 0x4b, // Z...DESK - 0x54, 0x4f, 0x50, 0x2d, 0x56, 0x38, 0x30, 0x41, // TOP-V80A - 0x51, 0x4a, 0x34, 0x02, 0x0a, 0x04, 0x0d, 0x03, // QJ4..... - 0x0c, 0x11, 0x0a, 0x11, 0x0e, 0x11, 0x0b, 0x11, // ........ - 0x1f, 0x11, 0x1e, 0x11, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt5544[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xc9, 0xfd, 0x14, 0x45, // ./.....E - 0x0a, 0x00, 0x01, 0x00, 0x04, 0x04, 0x24, 0x03, // ......$. - 0x51, 0xad, 0x0e, 0x09, 0x41, 0x54, 0x48, 0x2d, // Q...ATH- - 0x43, 0x4b, 0x53, 0x33, 0x33, 0x30, 0x58, 0x42, // CKS330XB - 0x54, 0x15, 0x03, 0x31, 0x11, 0x08, 0x11, 0x03, // T..1.... - 0x12, 0x1e, 0x11, 0x0c, 0x11, 0x0f, 0x11, 0x0e, // ........ - 0x11, 0x0b, 0x11, 0x00, 0x12, 0x00, 0x10, 0x01, // ........ - 0x05, 0x01, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt5633[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x6a, 0x78, 0xbf, 0x09, // ./..jx.. - 0x95, 0x3c, 0x01, 0x00, 0x0c, 0x01, 0x2a, 0x78, // .<....*x - 0x4f, 0xae, 0x10, 0x09, 0x44, 0x45, 0x53, 0x4b, // O...DESK - 0x54, 0x4f, 0x50, 0x2d, 0x39, 0x38, 0x41, 0x31, // TOP-98A1 - 0x41, 0x42, 0x53, 0x02, 0x0a, 0x00, 0x0d, 0x03, // ABS..... - 0x0c, 0x11, 0x0a, 0x11, 0x0e, 0x11, 0x0b, 0x11, // ........ - 0x1f, 0x11, 0x1e, 0x11, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt5634[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x30, 0xf6, 0xd3, 0x29, // ./..0..) - 0x24, 0x58, 0x01, 0x00, 0x0c, 0x02, 0x5a, 0xa1, // $X....Z. - 0x27, 0xab, 0x06, 0x09, 0x4a, 0x6f, 0x6b, 0x65, // '...Joke - 0x72, 0x19, 0x03, 0x05, 0x11, 0x0a, 0x11, 0x0c, // r....... - 0x11, 0x0e, 0x11, 0x12, 0x11, 0x15, 0x11, 0x16, // ........ - 0x11, 0x1f, 0x11, 0x2d, 0x11, 0x2f, 0x11, 0x00, // ...-./.. - 0x12, 0x32, 0x11, 0x01, 0x05, 0x81, 0x07, 0x5a, // .2.....Z - 0x6c, 0xb1, 0xa7, 0x6d, 0xf1, 0xbc, 0x9b, 0xde, // l..m.... - 0x3d, 0x5c, 0xae, 0x21, 0xfa, 0x2e, 0xa8, 0x00, // =\.!.... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt22626[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x41, 0xb7, 0xf0, 0x92, // ./..A... - 0xe1, 0x1c, 0x01, 0x00, 0x08, 0x04, 0x76, 0x11, // ......v. - 0x7c, 0xcb, 0x1d, 0x03, 0x2e, 0x11, 0x33, 0x11, // |.....3. - 0x0b, 0x11, 0x0e, 0x11, 0x0f, 0x11, 0xae, 0x7f, // ........ - 0x0c, 0x11, 0xad, 0x7f, 0x01, 0x11, 0x00, 0x12, // ........ - 0x1e, 0x11, 0x03, 0x12, 0x00, 0x18, 0x01, 0x18, // ........ - 0x01, 0x05, 0x31, 0x07, 0xec, 0x88, 0x43, 0x48, // ..1...CH - 0xcd, 0x41, 0x40, 0xa2, 0x97, 0x27, 0x57, 0x5d, // .A@..'W] - 0x50, 0xbf, 0x1f, 0xd3, 0xff, 0xca, 0xca, 0xde, // P....... - 0xaf, 0xde, 0xca, 0xde, 0xde, 0xfa, 0xca, 0xde, // ........ - 0x00, 0x00, 0x00, 0x00, 0x66, 0x9a, 0x0c, 0x20, // ....f.. - 0x00, 0x08, 0xf4, 0xbd, 0xe6, 0x11, 0xcb, 0x52, // .......R - 0x00, 0x7a, 0xe1, 0x4d, 0x02, 0x0a, 0x04, 0x0a, // .z.M.... - 0x09, 0x42, 0x4d, 0x57, 0x20, 0x37, 0x30, 0x30, // .BMW 700 - 0x32, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 27...... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt22660[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x41, 0xb7, 0xf0, 0x92, // ./..A... - 0xe1, 0x1c, 0x01, 0x00, 0x08, 0x04, 0x76, 0x11, // ......v. - 0x7c, 0xc8, 0x84, 0x70, 0x00, 0x00, 0x0c, 0x20, // |..p... - 0x0f, 0x00, 0xfe, 0x04, 0x02, 0x02, 0x10, 0x03, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc7, 0x14, // ........ - 0x9a, 0xc6, 0x51, 0x3f, 0x0d, 0x1e, 0x6e, 0xf9, // ..Q?..n. - 0x57, 0x5e, 0x52, 0x15, 0xdf, 0xc9, 0x67, 0x95, // W^R...g. - 0x5d, 0x5f, 0xea, 0x0c, 0xb5, 0xe1, 0x58, 0xf0, // ]_....X. - 0xf8, 0xcd, 0xdb, 0xbc, 0x36, 0x0c, 0xcc, 0xee, // ....6... - 0x24, 0x1b, 0xa4, 0xbb, 0x6b, 0x24, 0x72, 0xa9, // $...k$r. - 0x32, 0x3b, 0x0e, 0xe8, 0xa4, 0x00, 0x7a, 0x0a, // 2;....z. - 0x00, 0x9c, 0x0d, 0xcf, 0x7e, 0xef, 0x78, 0xd5, // ....~.x. - 0xcd, 0xa5, 0x15, 0x1d, 0x99, 0x93, 0x6c, 0xbf, // ......l. - 0x25, 0x25, 0x60, 0x47, 0x92, 0x6a, 0xf8, 0x55, // %%`G.j.U - 0xee, 0x7e, 0xef, 0xa9, 0x9f, 0x66, 0x40, 0x0f, // .~...f@. - 0xf1, 0x18, 0x53, 0x4e, 0x44, 0x20, 0x41, 0x55, // ..SND AU - 0x44, 0x49, 0x4f, 0x00, 0x96, 0x2a, 0x84, 0x0f, // DIO..*.. - 0x5e, 0x72, 0x08, 0x64, 0x10, 0x01, 0x18, 0x02, // ^r.d.... - 0x0a, 0x04, 0x08, 0x61, 0x18, 0x03, 0x18, 0x01, // ...a.... - 0x20, 0x01, 0x2f, 0x60, 0x8b, 0x84, 0x27, 0xef, // ./`..'. - 0xf3, 0x03, 0x02, 0x00, 0x2c, 0x08, 0x06, 0x10, // ....,... - 0x01, 0x22, 0x05, 0x30, 0x00, 0x00, 0x00, 0x00, // .".0.... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt22727[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x41, 0xb7, 0xf0, 0x92, // ./..A... - 0xe1, 0x1c, 0x01, 0x00, 0x08, 0x04, 0x76, 0x10, // ......v. - 0x7c, 0xcc, 0x1d, 0x03, 0x2e, 0x11, 0x33, 0x11, // |.....3. - 0x0b, 0x11, 0x0e, 0x11, 0x0f, 0x11, 0xae, 0x7f, // ........ - 0x0c, 0x11, 0xad, 0x7f, 0x01, 0x11, 0x00, 0x12, // ........ - 0x1e, 0x11, 0x03, 0x12, 0x00, 0x18, 0x01, 0x18, // ........ - 0x01, 0x05, 0x31, 0x07, 0xec, 0x88, 0x43, 0x48, // ..1...CH - 0xcd, 0x41, 0x40, 0xa2, 0x97, 0x27, 0x57, 0x5d, // .A@..'W] - 0x50, 0xbf, 0x1f, 0xd3, 0xff, 0xca, 0xca, 0xde, // P....... - 0xaf, 0xde, 0xca, 0xde, 0xde, 0xfa, 0xca, 0xde, // ........ - 0x00, 0x00, 0x00, 0x00, 0x66, 0x9a, 0x0c, 0x20, // ....f.. - 0x00, 0x08, 0xf4, 0xbd, 0xe6, 0x11, 0xcb, 0x52, // .......R - 0x00, 0x7a, 0xe1, 0x4d, 0x02, 0x0a, 0x04, 0x0a, // .z.M.... - 0x09, 0x42, 0x4d, 0x57, 0x20, 0x37, 0x30, 0x30, // .BMW 700 - 0x32, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 27...... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt22959[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x41, 0xb7, 0xf0, 0x92, // ./..A... - 0xe1, 0x1c, 0x01, 0x00, 0x08, 0x04, 0x76, 0x11, // ......v. - 0x7c, 0xbc, 0x1d, 0x03, 0x2e, 0x11, 0x33, 0x11, // |.....3. - 0x0b, 0x11, 0x0e, 0x11, 0x0f, 0x11, 0xae, 0x7f, // ........ - 0x0c, 0x11, 0xad, 0x7f, 0x01, 0x11, 0x00, 0x12, // ........ - 0x1e, 0x11, 0x03, 0x12, 0x00, 0x18, 0x01, 0x18, // ........ - 0x01, 0x05, 0x31, 0x07, 0xec, 0x88, 0x43, 0x48, // ..1...CH - 0xcd, 0x41, 0x40, 0xa2, 0x97, 0x27, 0x57, 0x5d, // .A@..'W] - 0x50, 0xbf, 0x1f, 0xd3, 0xff, 0xca, 0xca, 0xde, // P....... - 0xaf, 0xde, 0xca, 0xde, 0xde, 0xfa, 0xca, 0xde, // ........ - 0x00, 0x00, 0x00, 0x00, 0x66, 0x9a, 0x0c, 0x20, // ....f.. - 0x00, 0x08, 0xf4, 0xbd, 0xe6, 0x11, 0xcb, 0x52, // .......R - 0x00, 0x7a, 0xe1, 0x4d, 0x02, 0x0a, 0x04, 0x0a, // .z.M.... - 0x09, 0x42, 0x4d, 0x57, 0x20, 0x37, 0x30, 0x30, // .BMW 700 - 0x32, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 27...... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt36316[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x41, 0xb7, 0xf0, 0x92, // ./..A... - 0xe1, 0x1c, 0x01, 0x00, 0x08, 0x04, 0x76, 0x7f, // ......v. - 0x6f, 0xcc, 0x1d, 0x03, 0x2e, 0x11, 0x33, 0x11, // o.....3. - 0x0b, 0x11, 0x0e, 0x11, 0x0f, 0x11, 0xae, 0x7f, // ........ - 0x0c, 0x11, 0xad, 0x7f, 0x01, 0x11, 0x00, 0x12, // ........ - 0x1e, 0x11, 0x03, 0x12, 0x00, 0x18, 0x01, 0x18, // ........ - 0x01, 0x05, 0x31, 0x07, 0xec, 0x88, 0x43, 0x48, // ..1...CH - 0xcd, 0x41, 0x40, 0xa2, 0x97, 0x27, 0x57, 0x5d, // .A@..'W] - 0x50, 0xbf, 0x1f, 0xd3, 0xff, 0xca, 0xca, 0xde, // P....... - 0xaf, 0xde, 0xca, 0xde, 0xde, 0xfa, 0xca, 0xde, // ........ - 0x00, 0x00, 0x00, 0x00, 0x66, 0x9a, 0x0c, 0x20, // ....f.. - 0x00, 0x08, 0xf4, 0xbd, 0xe6, 0x11, 0xcb, 0x52, // .......R - 0x00, 0x7a, 0xe1, 0x4d, 0x02, 0x0a, 0x04, 0x0a, // .z.M.... - 0x09, 0x42, 0x4d, 0x57, 0x20, 0x37, 0x30, 0x30, // .BMW 700 - 0x32, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 27...... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt36383[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x41, 0xb7, 0xf0, 0x92, // ./..A... - 0xe1, 0x1c, 0x01, 0x00, 0x08, 0x04, 0x76, 0x7e, // ......v~ - 0x6f, 0xce, 0x1d, 0x03, 0x2e, 0x11, 0x33, 0x11, // o.....3. - 0x0b, 0x11, 0x0e, 0x11, 0x0f, 0x11, 0xae, 0x7f, // ........ - 0x0c, 0x11, 0xad, 0x7f, 0x01, 0x11, 0x00, 0x12, // ........ - 0x1e, 0x11, 0x03, 0x12, 0x00, 0x18, 0x01, 0x18, // ........ - 0x01, 0x05, 0x31, 0x07, 0xec, 0x88, 0x43, 0x48, // ..1...CH - 0xcd, 0x41, 0x40, 0xa2, 0x97, 0x27, 0x57, 0x5d, // .A@..'W] - 0x50, 0xbf, 0x1f, 0xd3, 0xff, 0xca, 0xca, 0xde, // P....... - 0xaf, 0xde, 0xca, 0xde, 0xde, 0xfa, 0xca, 0xde, // ........ - 0x00, 0x00, 0x00, 0x00, 0x66, 0x9a, 0x0c, 0x20, // ....f.. - 0x00, 0x08, 0xf4, 0xbd, 0xe6, 0x11, 0xcb, 0x52, // .......R - 0x00, 0x7a, 0xe1, 0x4d, 0x02, 0x0a, 0x04, 0x0a, // .z.M.... - 0x09, 0x42, 0x4d, 0x57, 0x20, 0x37, 0x30, 0x30, // .BMW 700 - 0x32, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 27...... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt41746[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x41, 0xb7, 0xf0, 0x92, // ./..A... - 0xe1, 0x1c, 0x01, 0x00, 0x08, 0x04, 0x76, 0x79, // ......vy - 0x6f, 0xc8, 0x1d, 0x03, 0x2e, 0x11, 0x33, 0x11, // o.....3. - 0x0b, 0x11, 0x0e, 0x11, 0x0f, 0x11, 0xae, 0x7f, // ........ - 0x0c, 0x11, 0xad, 0x7f, 0x01, 0x11, 0x00, 0x12, // ........ - 0x1e, 0x11, 0x03, 0x12, 0x00, 0x18, 0x01, 0x18, // ........ - 0x01, 0x05, 0x31, 0x07, 0xec, 0x88, 0x43, 0x48, // ..1...CH - 0xcd, 0x41, 0x40, 0xa2, 0x97, 0x27, 0x57, 0x5d, // .A@..'W] - 0x50, 0xbf, 0x1f, 0xd3, 0xff, 0xca, 0xca, 0xde, // P....... - 0xaf, 0xde, 0xca, 0xde, 0xde, 0xfa, 0xca, 0xde, // ........ - 0x00, 0x00, 0x00, 0x00, 0x66, 0x9a, 0x0c, 0x20, // ....f.. - 0x00, 0x08, 0xf4, 0xbd, 0xe6, 0x11, 0xcb, 0x52, // .......R - 0x00, 0x7a, 0xe1, 0x4d, 0x02, 0x0a, 0x04, 0x0a, // .z.M.... - 0x09, 0x42, 0x4d, 0x57, 0x20, 0x37, 0x30, 0x30, // .BMW 700 - 0x32, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 27...... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt3253[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x98, 0xa7, 0xcd, 0xd2, // ./...... - 0x96, 0x7c, 0x01, 0x00, 0x18, 0x04, 0x24, 0x30, // .|....$0 - 0x64, 0xce, 0x09, 0x10, 0x01, 0x00, 0x0a, 0x00, // d....... - 0xff, 0xff, 0xff, 0xff, 0x02, 0x0a, 0x04, 0x0f, // ........ - 0x02, 0x0d, 0x11, 0x0b, 0x11, 0x0e, 0x11, 0x0f, // ........ - 0x11, 0x1e, 0x11, 0x08, 0x11, 0x31, 0x11, 0x06, // .....1.. - 0x09, 0x41, 0x63, 0x72, 0x75, 0x78, 0x00, 0x00, // .Acrux.. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt3259[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x77, 0x08, 0x25, 0x99, // ./..w.%. - 0xec, 0x40, 0x01, 0x00, 0x04, 0x01, 0x48, 0xfd, // .@....H. - 0x66, 0xb0, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // f...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt3805[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x98, 0xa7, 0xcd, 0xd2, // ./...... - 0x96, 0x7c, 0x01, 0x00, 0x18, 0x04, 0x24, 0x2e, // .|....$. - 0x64, 0x7f, 0x09, 0x10, 0x01, 0x00, 0x0a, 0x00, // d....... - 0xff, 0xff, 0xff, 0xff, 0x02, 0x0a, 0x04, 0x0f, // ........ - 0x02, 0x0d, 0x11, 0x0b, 0x11, 0x0e, 0x11, 0x0f, // ........ - 0x11, 0x1e, 0x11, 0x08, 0x11, 0x31, 0x11, 0x06, // .....1.. - 0x09, 0x41, 0x63, 0x72, 0x75, 0x78, 0x00, 0x00, // .Acrux.. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt3837[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x77, 0x08, 0x25, 0x99, // ./..w.%. - 0xec, 0x40, 0x01, 0x00, 0x04, 0x01, 0x48, 0xfc, // .@....H. - 0x66, 0x7f, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // f...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt3841[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x38, 0xac, 0xec, 0xd5, // ./..8... - 0xab, 0xd0, 0x01, 0x00, 0x04, 0x01, 0x48, 0xfd, // ......H. - 0x56, 0x7f, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // V...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x6c, 0x00, 0x0f, // .....l.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt4170[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x77, 0x08, 0x25, 0x99, // ./..w.%. - 0xec, 0x40, 0x01, 0x00, 0x04, 0x01, 0x48, 0xfc, // .@....H. - 0x66, 0x7f, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // f...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt4171[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x98, 0xa7, 0xcd, 0xd2, // ./...... - 0x96, 0x7c, 0x01, 0x00, 0x18, 0x04, 0x24, 0x2d, // .|....$- - 0x64, 0x7f, 0x09, 0x10, 0x01, 0x00, 0x0a, 0x00, // d....... - 0xff, 0xff, 0xff, 0xff, 0x02, 0x0a, 0x04, 0x0f, // ........ - 0x02, 0x0d, 0x11, 0x0b, 0x11, 0x0e, 0x11, 0x0f, // ........ - 0x11, 0x1e, 0x11, 0x08, 0x11, 0x31, 0x11, 0x06, // .....1.. - 0x09, 0x41, 0x63, 0x72, 0x75, 0x78, 0x00, 0x00, // .Acrux.. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt4183[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x21, 0x51, 0xeb, 0xd5, // ./..!Q.. - 0xab, 0xd0, 0x01, 0x00, 0x04, 0x01, 0x48, 0x3c, // ......H< - 0x53, 0xa0, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // S...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt4209[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x51, 0x71, 0x23, 0x99, // ./..Qq#. - 0xec, 0x40, 0x01, 0x00, 0x04, 0x01, 0x48, 0xf8, // .@....H. - 0x29, 0xab, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // )...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x6c, 0x00, 0x0f, // .....l.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt4226[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xbf, 0x8d, 0x25, 0x99, // ./....%. - 0xec, 0x40, 0x01, 0x00, 0x04, 0x01, 0x48, 0xb6, // .@....H. - 0x19, 0xb5, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // ....Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt4227[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x5e, 0x64, 0xc3, 0x50, // ./..^d.P - 0x59, 0xa0, 0x01, 0x00, 0x04, 0x01, 0x48, 0xe9, // Y.....H. - 0x68, 0xa8, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // h...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0c, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt4247[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xac, 0xfe, 0xee, 0x96, // ./...... - 0x71, 0xdc, 0x01, 0x00, 0x04, 0x01, 0x48, 0x00, // q.....H. - 0x2d, 0xa2, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // -...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x6c, 0x00, 0x0f, // .....l.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt4257[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x38, 0xac, 0xec, 0xd5, // ./..8... - 0xab, 0xd0, 0x01, 0x00, 0x04, 0x01, 0x48, 0xfe, // ......H. - 0x56, 0xad, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // V...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x6c, 0x00, 0x0f, // .....l.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt4266[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x9c, 0xa1, 0x20, 0x23, // ./.... # - 0xce, 0xf4, 0x01, 0x00, 0x04, 0x01, 0x48, 0xd1, // ......H. - 0x36, 0xa7, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // 6...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0c, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt4450[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x21, 0x51, 0xeb, 0xd5, // ./..!Q.. - 0xab, 0xd0, 0x01, 0x00, 0x04, 0x01, 0x48, 0x3c, // ......H< - 0x53, 0xa3, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // S...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt4459[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x97, 0xa8, 0x0a, 0x71, // ./.....q - 0xeb, 0x50, 0x01, 0x00, 0x04, 0x01, 0x48, 0x5d, // .P....H] - 0x0c, 0xa2, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // ....Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt4468[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x1d, 0x0a, 0xf5, 0x2a, // ./.....* - 0x9a, 0xb8, 0x01, 0x00, 0x04, 0x01, 0x48, 0xef, // ......H. - 0x1f, 0xaa, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // ....Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt4469[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x51, 0x71, 0x23, 0x99, // ./..Qq#. - 0xec, 0x40, 0x01, 0x00, 0x04, 0x01, 0x48, 0xf8, // .@....H. - 0x29, 0xb8, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // )...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x6c, 0x00, 0x0f, // .....l.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt4473[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x38, 0xac, 0xec, 0xd5, // ./..8... - 0xab, 0xd0, 0x01, 0x00, 0x04, 0x01, 0x48, 0xfe, // ......H. - 0x56, 0xac, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // V...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x6c, 0x00, 0x0f, // .....l.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt4485[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xbf, 0x8d, 0x25, 0x99, // ./....%. - 0xec, 0x40, 0x01, 0x00, 0x04, 0x01, 0x48, 0xb6, // .@....H. - 0x19, 0xaa, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // ....Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt4486[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x98, 0xa7, 0xcd, 0xd2, // ./...... - 0x96, 0x7c, 0x01, 0x00, 0x18, 0x04, 0x24, 0x2c, // .|....$, - 0x64, 0xcf, 0x09, 0x10, 0x01, 0x00, 0x0a, 0x00, // d....... - 0xff, 0xff, 0xff, 0xff, 0x02, 0x0a, 0x04, 0x0f, // ........ - 0x02, 0x0d, 0x11, 0x0b, 0x11, 0x0e, 0x11, 0x0f, // ........ - 0x11, 0x1e, 0x11, 0x08, 0x11, 0x31, 0x11, 0x06, // .....1.. - 0x09, 0x41, 0x63, 0x72, 0x75, 0x78, 0x00, 0x00, // .Acrux.. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt4490[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x5e, 0x64, 0xc3, 0x50, // ./..^d.P - 0x59, 0xa0, 0x01, 0x00, 0x04, 0x01, 0x48, 0xe9, // Y.....H. - 0x68, 0xaa, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // h...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0c, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt4491[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xf6, 0x8b, 0xf4, 0x2a, // ./.....* - 0x9a, 0xb8, 0x01, 0x00, 0x04, 0x01, 0x48, 0x7c, // ......H| - 0x40, 0xa1, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // @...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt4504[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xdd, 0xa3, 0x23, 0x99, // ./....#. - 0xec, 0x40, 0x01, 0x00, 0x04, 0x01, 0x48, 0xfe, // .@....H. - 0x05, 0xa1, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // ....Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt4518[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x77, 0x08, 0x25, 0x99, // ./..w.%. - 0xec, 0x40, 0x01, 0x00, 0x04, 0x01, 0x48, 0xfc, // .@....H. - 0x66, 0xaa, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // f...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt4528[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xa1, 0x7b, 0x78, 0x83, // ./...{x. - 0xf8, 0xd8, 0x01, 0x00, 0x04, 0x01, 0x48, 0x20, // ......H - 0x51, 0xa6, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // Q...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt5034[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x98, 0xa7, 0xcd, 0xd2, // ./...... - 0x96, 0x7c, 0x01, 0x00, 0x18, 0x04, 0x24, 0x67, // .|....$g - 0x6f, 0xd4, 0x09, 0x10, 0x01, 0x00, 0x0a, 0x00, // o....... - 0xff, 0xff, 0xff, 0xff, 0x02, 0x0a, 0x04, 0x0f, // ........ - 0x02, 0x0d, 0x11, 0x0b, 0x11, 0x0e, 0x11, 0x0f, // ........ - 0x11, 0x1e, 0x11, 0x08, 0x11, 0x31, 0x11, 0x06, // .....1.. - 0x09, 0x41, 0x63, 0x72, 0x75, 0x78, 0x00, 0x00, // .Acrux.. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt5036[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x51, 0x71, 0x23, 0x99, // ./..Qq#. - 0xec, 0x40, 0x01, 0x00, 0x04, 0x01, 0x48, 0xf7, // .@....H. - 0x29, 0xaf, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // )...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x6c, 0x00, 0x0f, // .....l.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt5082[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xbf, 0x8d, 0x25, 0x99, // ./....%. - 0xec, 0x40, 0x01, 0x00, 0x04, 0x01, 0x48, 0xb6, // .@....H. - 0x19, 0xb9, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // ....Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt5118[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x77, 0x08, 0x25, 0x99, // ./..w.%. - 0xec, 0x40, 0x01, 0x00, 0x04, 0x01, 0x48, 0xfc, // .@....H. - 0x66, 0x7f, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // f...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt5119[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x83, 0xab, 0xd9, 0xb6, // ./...... - 0x80, 0x5c, 0x01, 0x00, 0x04, 0x01, 0x48, 0x68, // .\....Hh - 0x29, 0x7f, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // )...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x6c, 0x00, 0x0f, // .....l.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt5261[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x98, 0xa7, 0xcd, 0xd2, // ./...... - 0x96, 0x7c, 0x01, 0x00, 0x18, 0x04, 0x24, 0x67, // .|....$g - 0x6f, 0x7f, 0x09, 0x10, 0x01, 0x00, 0x0a, 0x00, // o....... - 0xff, 0xff, 0xff, 0xff, 0x02, 0x0a, 0x04, 0x0f, // ........ - 0x02, 0x0d, 0x11, 0x0b, 0x11, 0x0e, 0x11, 0x0f, // ........ - 0x11, 0x1e, 0x11, 0x08, 0x11, 0x31, 0x11, 0x06, // .....1.. - 0x09, 0x41, 0x63, 0x72, 0x75, 0x78, 0x00, 0x00, // .Acrux.. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt5306[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xdd, 0xa3, 0x23, 0x99, // ./....#. - 0xec, 0x40, 0x01, 0x00, 0x04, 0x01, 0x48, 0xfe, // .@....H. - 0x05, 0x7f, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // ....Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt5318[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x1d, 0x0a, 0xf5, 0x2a, // ./.....* - 0x9a, 0xb8, 0x01, 0x00, 0x04, 0x01, 0x48, 0xef, // ......H. - 0x1f, 0x7f, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // ....Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt5328[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xbf, 0x8d, 0x25, 0x99, // ./....%. - 0xec, 0x40, 0x01, 0x00, 0x04, 0x01, 0x48, 0xb6, // .@....H. - 0x19, 0xa9, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // ....Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt5878[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xbf, 0x8d, 0x25, 0x99, // ./....%. - 0xec, 0x40, 0x01, 0x00, 0x04, 0x01, 0x48, 0xb5, // .@....H. - 0x19, 0x7f, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // ....Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt5920[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x5e, 0x64, 0xc3, 0x50, // ./..^d.P - 0x59, 0xa0, 0x01, 0x00, 0x04, 0x01, 0x48, 0xe4, // Y.....H. - 0x68, 0x7f, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // h...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0c, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt6423[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x1d, 0x0a, 0xf5, 0x2a, // ./.....* - 0x9a, 0xb8, 0x01, 0x00, 0x04, 0x01, 0x48, 0xee, // ......H. - 0x1f, 0xa1, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // ....Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt6434[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x98, 0xa7, 0xcd, 0xd2, // ./...... - 0x96, 0x7c, 0x01, 0x00, 0x18, 0x04, 0x24, 0x12, // .|....$. - 0x5e, 0xd0, 0x09, 0x10, 0x01, 0x00, 0x0a, 0x00, // ^....... - 0xff, 0xff, 0xff, 0xff, 0x02, 0x0a, 0x04, 0x0f, // ........ - 0x02, 0x0d, 0x11, 0x0b, 0x11, 0x0e, 0x11, 0x0f, // ........ - 0x11, 0x1e, 0x11, 0x08, 0x11, 0x31, 0x11, 0x06, // .....1.. - 0x09, 0x41, 0x63, 0x72, 0x75, 0x78, 0x00, 0x00, // .Acrux.. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt6503[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x77, 0x08, 0x25, 0x99, // ./..w.%. - 0xec, 0x40, 0x01, 0x00, 0x04, 0x01, 0x48, 0xfa, // .@....H. - 0x66, 0xae, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // f...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt6504[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x51, 0x71, 0x23, 0x99, // ./..Qq#. - 0xec, 0x40, 0x01, 0x00, 0x04, 0x01, 0x48, 0xf6, // .@....H. - 0x29, 0xac, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // )...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x6c, 0x00, 0x0f, // .....l.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt6511[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x83, 0xab, 0xd9, 0xb6, // ./...... - 0x80, 0x5c, 0x01, 0x00, 0x04, 0x01, 0x48, 0x66, // .\....Hf - 0x29, 0xa0, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // )...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x6c, 0x00, 0x0f, // .....l.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt6512[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x38, 0xac, 0xec, 0xd5, // ./..8... - 0xab, 0xd0, 0x01, 0x00, 0x04, 0x01, 0x48, 0xfc, // ......H. - 0x56, 0xa2, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // V...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt6513[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xa1, 0x7b, 0x78, 0x83, // ./...{x. - 0xf8, 0xd8, 0x01, 0x00, 0x04, 0x01, 0x48, 0x1e, // ......H. - 0x51, 0xad, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // Q...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt6518[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x38, 0xac, 0xec, 0xd5, // ./..8... - 0xab, 0xd0, 0x01, 0x00, 0x04, 0x01, 0x48, 0xfc, // ......H. - 0x56, 0xa1, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // V...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x6c, 0x00, 0x0f, // .....l.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt6525[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x5e, 0x64, 0xc3, 0x50, // ./..^d.P - 0x59, 0xa0, 0x01, 0x00, 0x04, 0x01, 0x48, 0xe2, // Y.....H. - 0x68, 0xb1, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // h...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0c, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt6540[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x4f, 0xd1, 0xf1, 0x2a, // ./..O..* - 0x9a, 0xb8, 0x01, 0x00, 0x04, 0x01, 0x48, 0x86, // ......H. - 0x76, 0xa6, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // v...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x6c, 0x00, 0x0f, // .....l.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt6567[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xbf, 0x8d, 0x25, 0x99, // ./....%. - 0xec, 0x40, 0x01, 0x00, 0x04, 0x01, 0x48, 0xb5, // .@....H. - 0x19, 0xaf, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // ....Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt6854[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x98, 0xa7, 0xcd, 0xd2, // ./...... - 0x96, 0x7c, 0x01, 0x00, 0x18, 0x04, 0x24, 0x12, // .|....$. - 0x5e, 0xd3, 0x09, 0x10, 0x01, 0x00, 0x0a, 0x00, // ^....... - 0xff, 0xff, 0xff, 0xff, 0x02, 0x0a, 0x04, 0x0f, // ........ - 0x02, 0x0d, 0x11, 0x0b, 0x11, 0x0e, 0x11, 0x0f, // ........ - 0x11, 0x1e, 0x11, 0x08, 0x11, 0x31, 0x11, 0x06, // .....1.. - 0x09, 0x41, 0x63, 0x72, 0x75, 0x78, 0x00, 0x00, // .Acrux.. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt6867[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xdd, 0xa3, 0x23, 0x99, // ./....#. - 0xec, 0x40, 0x01, 0x00, 0x04, 0x01, 0x48, 0xfe, // .@....H. - 0x05, 0x7f, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // ....Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt6870[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x1d, 0x0a, 0xf5, 0x2a, // ./.....* - 0x9a, 0xb8, 0x01, 0x00, 0x04, 0x01, 0x48, 0xee, // ......H. - 0x1f, 0x7f, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // ....Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt6871[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xbf, 0x8d, 0x25, 0x99, // ./....%. - 0xec, 0x40, 0x01, 0x00, 0x04, 0x01, 0x48, 0xb5, // .@....H. - 0x19, 0x7f, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // ....Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt6875[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xf6, 0x8b, 0xf4, 0x2a, // ./.....* - 0x9a, 0xb8, 0x01, 0x00, 0x04, 0x01, 0x48, 0x7c, // ......H| - 0x40, 0x7f, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // @...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt6876[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x5e, 0x64, 0xc3, 0x50, // ./..^d.P - 0x59, 0xa0, 0x01, 0x00, 0x04, 0x01, 0x48, 0xe1, // Y.....H. - 0x68, 0x7f, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // h...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0c, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt6886[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x4f, 0xd1, 0xf1, 0x2a, // ./..O..* - 0x9a, 0xb8, 0x01, 0x00, 0x04, 0x01, 0x48, 0x86, // ......H. - 0x76, 0xa9, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // v...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x6c, 0x00, 0x0f, // .....l.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt6895[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x77, 0x08, 0x25, 0x99, // ./..w.%. - 0xec, 0x40, 0x01, 0x00, 0x04, 0x01, 0x48, 0xfb, // .@....H. - 0x66, 0xb2, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // f...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt6900[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x51, 0x71, 0x23, 0x99, // ./..Qq#. - 0xec, 0x40, 0x01, 0x00, 0x04, 0x01, 0x48, 0xf6, // .@....H. - 0x29, 0xb7, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // )...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x6c, 0x00, 0x0f, // .....l.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt6901[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x38, 0xac, 0xec, 0xd5, // ./..8... - 0xab, 0xd0, 0x01, 0x00, 0x04, 0x01, 0x48, 0xfc, // ......H. - 0x56, 0xa9, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // V...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x6c, 0x00, 0x0f, // .....l.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt6907[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xa1, 0x7b, 0x78, 0x83, // ./...{x. - 0xf8, 0xd8, 0x01, 0x00, 0x04, 0x01, 0x48, 0x1f, // ......H. - 0x51, 0xb3, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // Q...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt6908[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x83, 0xab, 0xd9, 0xb6, // ./...... - 0x80, 0x5c, 0x01, 0x00, 0x04, 0x01, 0x48, 0x65, // .\....He - 0x29, 0xa3, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // )...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x6c, 0x00, 0x0f, // .....l.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt6935[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x21, 0x51, 0xeb, 0xd5, // ./..!Q.. - 0xab, 0xd0, 0x01, 0x00, 0x04, 0x01, 0x48, 0x3b, // ......H; - 0x53, 0x7f, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // S...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt7024[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x98, 0xa7, 0xcd, 0xd2, // ./...... - 0x96, 0x7c, 0x01, 0x00, 0x18, 0x04, 0x24, 0x12, // .|....$. - 0x5e, 0xd3, 0x09, 0x10, 0x01, 0x00, 0x0a, 0x00, // ^....... - 0xff, 0xff, 0xff, 0xff, 0x02, 0x0a, 0x04, 0x0f, // ........ - 0x02, 0x0d, 0x11, 0x0b, 0x11, 0x0e, 0x11, 0x0f, // ........ - 0x11, 0x1e, 0x11, 0x08, 0x11, 0x31, 0x11, 0x06, // .....1.. - 0x09, 0x41, 0x63, 0x72, 0x75, 0x78, 0x00, 0x00, // .Acrux.. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt7030[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x77, 0x08, 0x25, 0x99, // ./..w.%. - 0xec, 0x40, 0x01, 0x00, 0x04, 0x01, 0x48, 0xfa, // .@....H. - 0x66, 0x7f, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // f...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt7035[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x5e, 0x64, 0xc3, 0x50, // ./..^d.P - 0x59, 0xa0, 0x01, 0x00, 0x04, 0x01, 0x48, 0xe0, // Y.....H. - 0x68, 0x7f, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // h...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0c, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt7038[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x9c, 0xa1, 0x20, 0x23, // ./.... # - 0xce, 0xf4, 0x01, 0x00, 0x04, 0x01, 0x48, 0xc9, // ......H. - 0x36, 0x7f, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // 6...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0c, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x67, 0x00, 0x0f, // .....g.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt7049[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x51, 0x71, 0x23, 0x99, // ./..Qq#. - 0xec, 0x40, 0x01, 0x00, 0x04, 0x01, 0x48, 0xf7, // .@....H. - 0x29, 0x7f, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // )...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x6c, 0x00, 0x0f, // .....l.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pkt7050[258] = { - 0x04, 0x2f, 0xff, 0x01, 0x83, 0xab, 0xd9, 0xb6, // ./...... - 0x80, 0x5c, 0x01, 0x00, 0x04, 0x01, 0x48, 0x65, // .\....He - 0x29, 0x7f, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // )...Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x6c, 0x00, 0x0f, // .....l.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -// Frame (258 bytes) -static const unsigned char pktAsha[258] = { - 0x04, 0x2f, 0xff, 0x01, 0xdc, 0xd0, 0xf1, 0x2a, // ./.....* - 0x9a, 0xb8, 0x01, 0x00, 0x04, 0x01, 0x48, 0x0c, // ......H. - 0x0e, 0x7f, 0x17, 0x09, 0x43, 0x68, 0x72, 0x6f, // ....Chro - 0x6d, 0x65, 0x62, 0x6f, 0x78, 0x20, 0x66, 0x6f, // mebox fo - 0x72, 0x20, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, // r Meetin - 0x67, 0x73, 0x02, 0x0a, 0x0a, 0x09, 0x10, 0x01, // gs...... - 0x00, 0xe0, 0x00, 0x05, 0xc4, 0x6c, 0x00, 0x0f, // .....l.. - 0x03, 0x00, 0x18, 0x01, 0x18, 0x0a, 0x18, 0x0e, // ........ - 0x11, 0x0c, 0x11, 0x1f, 0x11, 0x0a, 0x11, 0x0c, // ........ - 0x16, 0xf0, 0xfd, 0x01, 0x02, 0x03, 0x04, 0x05, // ........ - 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - 0x00, 0x00 // .. -}; - -std::unordered_map<std::string, const unsigned char*> selected_packets = { - {"pkt19200", pkt19200}, {"pkt2062", pkt2062}, {"pkt26171", pkt26171}, - {"pkt34639", pkt34639}, {"pktAsha", pktAsha}, -}; - -std::vector<const unsigned char*> data_packets = { - pkt34638, pkt34639, pkt2048, pkt2062, pkt2063, pkt2064, pkt2067, pkt2072, pkt2075, - pkt2076, pkt19189, pkt19190, pkt19191, pkt19192, pkt19193, pkt19194, pkt19198, pkt19200, - pkt19201, pkt19835, pkt19844, pkt19845, pkt19846, pkt19857, pkt19863, pkt19871, pkt19885, - pkt19886, pkt19898, pkt19899, pkt19904, pkt19908, pkt33190, pkt33191, pkt33217, pkt34019, - pkt34020, pkt19975, pkt19988, pkt20036, pkt575, pkt764, pkt29692, pkt29730, pkt29777, - pkt29785, pkt29830, pkt29836, pkt29922, pkt29927, pkt29928, pkt29931, pkt23904, pkt24033, - pkt24158, pkt24446, pkt24658, pkt25745, pkt25751, pkt26171, pkt26175, pkt26328, pkt26463, - pkt34640, pkt34666, pkt34778, pkt34779, pkt34843, pkt34847, pkt34848, pkt34875, pkt19294, - pkt4073, pkt4075, pkt4883, pkt7384, pkt7385, pkt10784, pkt10786, pkt10787, pkt10789, - pkt10799, pkt10800, pkt10801, pkt10804, pkt10806, pkt10807, pkt10808, pkt10809, pkt10816, - pkt10818, pkt10821, pkt10823, pkt10826, pkt10838, pkt10839, pkt10840, pkt10841, pkt10842, - pkt10843, pkt10845, pkt10857, pkt10858, pkt10859, pkt10860, pkt10871, pkt10872, pkt10874, - pkt10876, pkt10877, pkt10887, pkt10888, pkt10890, pkt10891, pkt10893, pkt10895, pkt10904, - pkt10906, pkt10910, pkt10911, pkt10915, pkt10916, pkt10922, pkt10927, pkt10928, pkt10930, - pkt10931, pkt10932, pkt10934, pkt10940, pkt10952, pkt10953, pkt10959, pkt10962, pkt10965, - pkt10967, pkt10973, pkt10976, pkt10982, pkt10984, pkt10986, pkt10987, pkt10997, pkt10999, - pkt11008, pkt11009, pkt11020, pkt11021, pkt11023, pkt11025, pkt11039, pkt11047, pkt11048, - pkt11049, pkt11067, pkt11080, pkt11081, pkt11083, pkt11092, pkt11093, pkt11108, pkt11141, - pkt11152, pkt11154, pkt11155, pkt11156, pkt11158, pkt11159, pkt473, pkt474, pkt488, - pkt489, pkt512, pkt513, pkt530, pkt545, pkt871, pkt27834, pkt27876, pkt649, - pkt677, pkt689, pkt709, pkt763, pkt771, pkt795, pkt951, pkt952, pkt953, - pkt954, pkt451, pkt482, pkt496, pkt511, pkt523, pkt534, pkt706, pkt707, - pkt786, pkt787, pkt800, pkt821, pkt840, pkt848, pkt865, pkt910, pkt911, - pkt1093, pkt1128, pkt1148, pkt1150, pkt1242, pkt1243, pkt1263, pkt1302, pkt1316, - pkt1358, pkt1359, pkt1428, pkt1564, pkt1587, pkt1596, pkt1597, pkt1614, pkt1615, - pkt1662, pkt1678, pkt1764, pkt1775, pkt1796, pkt1797, pkt1821, pkt1840, pkt1855, - pkt2092, pkt2098, pkt2128, pkt2150, pkt2151, pkt2204, pkt2304, pkt2432, pkt2450, - pkt2457, pkt2458, pkt2468, pkt2469, pkt2506, pkt2516, pkt2599, pkt2759, pkt2761, - pkt2778, pkt2779, pkt2780, pkt2788, pkt2818, pkt2890, pkt2931, pkt3390, pkt3391, - pkt3392, pkt3393, pkt3436, pkt3437, pkt3439, pkt4807, pkt4817, pkt4844, pkt4845, - pkt4925, pkt4962, pkt4979, pkt5162, pkt5163, pkt5178, pkt5192, pkt5193, pkt5238, - pkt5264, pkt5448, pkt5482, pkt5501, pkt5509, pkt5511, pkt5544, pkt5633, pkt5634, - pkt22626, pkt22660, pkt22727, pkt22959, pkt36316, pkt36383, pkt41746, pkt3253, pkt3259, - pkt3805, pkt3837, pkt3841, pkt4170, pkt4171, pkt4183, pkt4209, pkt4226, pkt4227, - pkt4247, pkt4257, pkt4266, pkt4450, pkt4459, pkt4468, pkt4469, pkt4473, pkt4485, - pkt4486, pkt4490, pkt4491, pkt4504, pkt4518, pkt4528, pkt5034, pkt5036, pkt5082, - pkt5118, pkt5119, pkt5261, pkt5306, pkt5318, pkt5328, pkt5878, pkt5920, pkt6423, - pkt6434, pkt6503, pkt6504, pkt6511, pkt6512, pkt6513, pkt6518, pkt6525, pkt6540, - pkt6567, pkt6854, pkt6867, pkt6870, pkt6871, pkt6875, pkt6876, pkt6886, pkt6895, - pkt6900, pkt6901, pkt6907, pkt6908, pkt6935, pkt7024, pkt7030, pkt7035, pkt7038, - pkt7049, pkt7050, pktAsha, -}; diff --git a/system/gd/discovery/device/eir_test_data_packets.h b/system/gd/discovery/device/eir_test_data_packets.h deleted file mode 100644 index 1efa62f28c..0000000000 --- a/system/gd/discovery/device/eir_test_data_packets.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2024 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include <string> -#include <unordered_map> -#include <vector> - -struct header { - uint8_t event; - uint8_t event_code; - uint8_t length; - uint8_t num_rsp; - uint8_t raw_address[6]; - uint8_t scan_mode; - uint8_t reserved11; - uint8_t cod[3]; - uint16_t clock_offset; - uint8_t rssi; - uint8_t eir_data[]; -} __attribute__((packed)); - -constexpr size_t kEirOffset = sizeof(header); -constexpr size_t kEirSize = 240U; - -extern std::unordered_map<std::string, const unsigned char*> selected_packets; -extern std::vector<const unsigned char*> data_packets; diff --git a/system/gd/dumpsys/internal/filter_internal_test.cc b/system/gd/dumpsys/internal/filter_internal_test.cc index 5fcce93141..cc92bd1045 100644 --- a/system/gd/dumpsys/internal/filter_internal_test.cc +++ b/system/gd/dumpsys/internal/filter_internal_test.cc @@ -42,7 +42,7 @@ protected: void ParseReflectionSchema(unsigned char* bfbs, unsigned int bfbs_len) { ASSERT_TRUE(reflection_schema_.empty()); - reflection_schema_ = std::move(std::vector<const uint8_t>(bfbs, bfbs + bfbs_len)); + reflection_schema_ = std::vector<const uint8_t>(bfbs, bfbs + bfbs_len); flatbuffers::Verifier verifier(reflection_schema_.data(), reflection_schema_.size()); ASSERT_TRUE(reflection::VerifySchemaBuffer(verifier)); schema_ = reflection::GetSchema(reflection_schema_.data()); @@ -50,7 +50,7 @@ protected: } const reflection::Schema* schema_{nullptr}; - flatbuffers::FlatBufferBuilder fb_builder_ = std::move(flatbuffers::FlatBufferBuilder(1024)); + flatbuffers::FlatBufferBuilder fb_builder_ = flatbuffers::FlatBufferBuilder(1024); private: std::vector<const uint8_t> reflection_schema_; diff --git a/system/gd/hal/hci_backend_hidl.cc b/system/gd/hal/hci_backend_hidl.cc index b1f61e5f62..0fb2729307 100644 --- a/system/gd/hal/hci_backend_hidl.cc +++ b/system/gd/hal/hci_backend_hidl.cc @@ -87,28 +87,34 @@ class HidlHci : public HciBackend { public: HidlHci(Handler* module_handler) { log::info("Trying to find a HIDL interface"); + const int32_t timeout_ms = get_adjusted_timeout(500); auto get_service_alarm = new os::Alarm(module_handler); - get_service_alarm->Schedule(BindOnce([] { - const std::string kBoardProperty = "ro.product.board"; - const std::string kCuttlefishBoard = "cutf"; - auto board_name = os::GetSystemProperty(kBoardProperty); - bool emulator = board_name.has_value() && - board_name.value() == kCuttlefishBoard; - if (emulator) { - log::error("board_name: {}", board_name.value()); - log::error( - "Unable to get a Bluetooth service after 500ms, start " - "the HAL before starting " - "Bluetooth"); - return; - } - log::fatal( - "Unable to get a Bluetooth service after 500ms, start " - "the HAL before starting " - "Bluetooth"); - }), - std::chrono::milliseconds(500)); + get_service_alarm->Schedule( + BindOnce( + [](uint32_t timeout_ms) { + const std::string kBoardProperty = "ro.product.board"; + const std::string kCuttlefishBoard = "cutf"; + auto board_name = os::GetSystemProperty(kBoardProperty); + bool emulator = + board_name.has_value() && board_name.value() == kCuttlefishBoard; + if (emulator) { + log::error("board_name: {}", board_name.value()); + log::error( + "Unable to get a Bluetooth service after {}ms, start " + "the HAL before starting " + "Bluetooth", + timeout_ms); + return; + } + log::fatal( + "Unable to get a Bluetooth service after {}ms, start " + "the HAL before starting " + "Bluetooth", + timeout_ms); + }, + timeout_ms), + std::chrono::milliseconds(timeout_ms)); hci_1_1_ = IBluetoothHci_1_1::getService(); if (hci_1_1_) { @@ -167,6 +173,20 @@ public: } private: + static int32_t get_adjusted_timeout(int32_t timeout) { + // Slower devices set this property. While waiting longer for bluetooth + // is a poor user experience, it's not unexpected on these devices. + // At the same time, we don't get arbitrarily long to start up bluetooth. + // There are other, more concretely set timeouts which can get triggered, + // and having a timeout here helps narrow down the problematic area. + // As a pragmatic compromise, we cap this multiplier at 2. + const uint32_t multiplier = os::GetSystemPropertyUint32("ro.hw_timeout_multiplier", 1); + if (multiplier > 1) { + return timeout * 2; + } + return timeout; + } + android::sp<DeathRecipient> death_recipient_; android::sp<HidlHciCallbacks> hci_callbacks_; android::sp<IBluetoothHci_1_0> hci_; diff --git a/system/gd/hal/hci_hal_fake.cc b/system/gd/hal/hci_hal_fake.cc index 2a29017c90..7d396dd571 100644 --- a/system/gd/hal/hci_hal_fake.cc +++ b/system/gd/hal/hci_hal_fake.cc @@ -39,7 +39,7 @@ std::optional<hci::CommandView> TestHciHal::GetSentCommand(std::chrono::millisec // Timed out return {}; } - auto command = hci::CommandView::Create(GetPacketView(std::move(outgoing_commands_.take()))); + auto command = hci::CommandView::Create(GetPacketView(outgoing_commands_.take())); log::assert_that(command.IsValid(), "assert failed: command.IsValid()"); return command; } @@ -49,7 +49,7 @@ std::optional<hci::AclView> TestHciHal::GetSentAcl(std::chrono::milliseconds tim // Timed out return {}; } - auto acl = hci::AclView::Create(GetPacketView(std::move(outgoing_acl_.take()))); + auto acl = hci::AclView::Create(GetPacketView(outgoing_acl_.take())); log::assert_that(acl.IsValid(), "assert failed: acl.IsValid()"); return acl; } @@ -59,7 +59,7 @@ std::optional<hci::ScoView> TestHciHal::GetSentSco(std::chrono::milliseconds tim // Timed out return {}; } - auto sco = hci::ScoView::Create(GetPacketView(std::move(outgoing_sco_.take()))); + auto sco = hci::ScoView::Create(GetPacketView(outgoing_sco_.take())); log::assert_that(sco.IsValid(), "assert failed: sco.IsValid()"); return sco; } @@ -71,7 +71,7 @@ std::optional<hci::IsoView> TestHciHal::GetSentIso(std::chrono::milliseconds tim } log::assert_that(outgoing_iso_.wait_to_take(timeout), "assert failed: outgoing_iso_.wait_to_take(timeout)"); - auto iso = hci::IsoView::Create(GetPacketView(std::move(outgoing_iso_.take()))); + auto iso = hci::IsoView::Create(GetPacketView(outgoing_iso_.take())); log::assert_that(iso.IsValid(), "assert failed: iso.IsValid()"); return iso; } diff --git a/system/gd/hal/hci_hal_host.cc b/system/gd/hal/hci_hal_host.cc index 5d999e8724..74af90772a 100644 --- a/system/gd/hal/hci_hal_host.cc +++ b/system/gd/hal/hci_hal_host.cc @@ -24,10 +24,12 @@ #include <sys/types.h> #include <unistd.h> -#include <chrono> +#include <chrono> // NOLINT #include <csignal> -#include <mutex> +#include <mutex> // NOLINT #include <queue> +#include <utility> +#include <vector> #include "common/init_flags.h" #include "hal/hci_hal.h" @@ -71,8 +73,8 @@ constexpr uint16_t HCI_DEV_NONE = 0xffff; struct sockaddr_hci { sa_family_t hci_family; - unsigned short hci_dev; - unsigned short hci_channel; + uint16_t hci_dev; + uint16_t hci_channel; }; struct mgmt_pkt { @@ -145,13 +147,16 @@ int waitHciDev(int hci_interface) { if (n < 0) { bluetooth::log::error("Error reading control channel: {}", strerror(errno)); break; + } else if (n == 0) { // unlikely to happen, just a safeguard. + bluetooth::log::error("Error reading control channel: EOF"); + break; } if (ev.opcode == MGMT_EV_COMMAND_COMP) { struct mgmt_event_read_index* cc; int i; - cc = (struct mgmt_event_read_index*)ev.data; + cc = reinterpret_cast<struct mgmt_event_read_index*>(ev.data); if (cc->cc_opcode != MGMT_OP_INDEX_LIST) { continue; @@ -168,9 +173,12 @@ int waitHciDev(int hci_interface) { } } - // Chipset might be lost. Wait for index added event. - bluetooth::log::error("HCI interface({}) not found in the MGMT lndex list", - hci_interface); + if (ret != 0) { + // Chipset might be lost. Wait for index added event. + bluetooth::log::error( + "MGMT index list returns {} HCI interfaces, but HCI interface({}) is not found", + cc->num_intf, hci_interface); + } } else { // Unlikely event (probably developer error or driver shut down). bluetooth::log::error("Failed to read index list: status({})", cc->status); @@ -382,7 +390,7 @@ private: bool controller_broken_ = false; void write_to_fd(HciPacket packet) { - // TODO: replace this with new queue when it's ready + // TODO(chromeos-bt-team@): replace this with new queue when it's ready hci_outgoing_queue_.emplace(packet); if (hci_outgoing_queue_.size() == 1) { hci_incoming_thread_.GetReactor()->ModifyRegistration(reactable_, @@ -396,7 +404,8 @@ private: return; } auto packet_to_send = hci_outgoing_queue_.front(); - auto bytes_written = write(sock_fd_, (void*)packet_to_send.data(), packet_to_send.size()); + auto bytes_written = + write(sock_fd_, reinterpret_cast<void*>(packet_to_send.data()), packet_to_send.size()); hci_outgoing_queue_.pop(); if (bytes_written == -1) { log::error("Can't write to socket: {}", strerror(errno)); diff --git a/system/gd/hal/mgmt.cc b/system/gd/hal/mgmt.cc index c2ea46eced..a4354d7fce 100644 --- a/system/gd/hal/mgmt.cc +++ b/system/gd/hal/mgmt.cc @@ -42,8 +42,8 @@ namespace hal { struct sockaddr_hci { sa_family_t hci_family; - unsigned short hci_dev; - unsigned short hci_channel; + uint16_t hci_dev; + uint16_t hci_channel; }; constexpr static uint8_t BTPROTO_HCI = 1; @@ -113,7 +113,7 @@ uint16_t Mgmt::get_vs_opcode(uint16_t vendor_specification) { log::error("Failed to call MGMT opcode 0x{:04x}, errno {}", ev.opcode, -errno); close(fd); return ret_opcode; - }; + } break; } else if (ret < 0) { log::error("msft poll ret {} errno {}", ret, -errno); @@ -141,6 +141,10 @@ uint16_t Mgmt::get_vs_opcode(uint16_t vendor_specification) { log::error("Failed to read mgmt socket: {}", -errno); close(fd); return ret_opcode; + } else if (ret == 0) { // unlikely to happen, just a safeguard. + log::error("Failed to read mgmt socket: EOF"); + close(fd); + return ret_opcode; } if (cc_ev.opcode == MGMT_EV_COMMAND_COMPLETE) { diff --git a/system/gd/hal/snoop_logger_socket_thread.cc b/system/gd/hal/snoop_logger_socket_thread.cc index da7f21f01b..b2829626cf 100644 --- a/system/gd/hal/snoop_logger_socket_thread.cc +++ b/system/gd/hal/snoop_logger_socket_thread.cc @@ -51,7 +51,7 @@ std::future<bool> SnoopLoggerSocketThread::Start() { listen_thread_ = std::make_unique<std::thread>(&SnoopLoggerSocketThread::Run, this, std::move(thread_started)); stop_thread_ = false; - return std::move(future); + return future; } void SnoopLoggerSocketThread::Stop() { diff --git a/system/gd/hci/acl_manager/acl_scheduler.cc b/system/gd/hci/acl_manager/acl_scheduler.cc index 6de1a1e4fd..9b12f4b4e7 100644 --- a/system/gd/hci/acl_manager/acl_scheduler.cc +++ b/system/gd/hci/acl_manager/acl_scheduler.cc @@ -17,6 +17,7 @@ #include "hci/acl_manager/acl_scheduler.h" #include <bluetooth/log.h> +#include <com_android_bluetooth_flags.h> #include <deque> #include <optional> @@ -162,17 +163,27 @@ struct AclScheduler::impl { void Stop() { stopped_ = true; } private: - bool is_ready_to_send_next_operation() const { - return incoming_connecting_address_set_.empty() && !outgoing_entry_.has_value() && - !pending_outgoing_operations_.empty(); - } - - void try_dequeue_next_operation() { + bool ready_to_send_next_operation() const { if (stopped_) { - return; + return false; } + if (pending_outgoing_operations_.empty()) { + return false; + } + if (com::android::bluetooth::flags::progress_acl_scheduler_upon_incoming_connection()) { + if (const RemoteNameRequestQueueEntry* peek = + std::get_if<RemoteNameRequestQueueEntry>(&pending_outgoing_operations_.front())) { + if (incoming_connecting_address_set_.contains(peek->address)) { + log::info("Pending incoming connection and outgoing RNR to same peer:{}", peek->address); + return true; + } + } + } + return incoming_connecting_address_set_.empty() && !outgoing_entry_.has_value(); + } - if (is_ready_to_send_next_operation()) { + void try_dequeue_next_operation() { + if (ready_to_send_next_operation()) { log::info("Pending connections is not empty; so sending next connection"); auto entry = std::move(pending_outgoing_operations_.front()); pending_outgoing_operations_.pop_front(); diff --git a/system/gd/hci/acl_manager/acl_scheduler_test.cc b/system/gd/hci/acl_manager/acl_scheduler_test.cc index f2ca86b652..f09a14c836 100644 --- a/system/gd/hci/acl_manager/acl_scheduler_test.cc +++ b/system/gd/hci/acl_manager/acl_scheduler_test.cc @@ -16,15 +16,20 @@ #include "hci/acl_manager/acl_scheduler.h" +#include <com_android_bluetooth_flags.h> +#include <flag_macros.h> #include <gmock/gmock.h> #include <gtest/gtest.h> #include <chrono> #include <future> +#include <utility> #include "hci/address.h" #include "os/thread.h" +#define TEST_BT com::android::bluetooth::flags + namespace bluetooth { namespace hci { namespace acl_manager { @@ -262,7 +267,7 @@ TEST_F(AclSchedulerTest, DoNothingWhileIncomingConnectionsExist) { // an incoming connection arrives acl_scheduler_->RegisterPendingIncomingConnection(address1); - // try to start an outgoing connection + // try to start an outgoing connection to another device acl_scheduler_->EnqueueOutgoingAclConnection(address2, promiseCallback(std::move(promise))); // the outgoing_connection callback should not have executed yet @@ -286,6 +291,40 @@ TEST_F(AclSchedulerTest, DoNothingWhileIncomingConnectionsExist) { EXPECT_THAT(future, IsSet()); } +TEST_F_WITH_FLAGS(AclSchedulerTest, IncomingConnectionPendingWithOutgoingRemoteNameRequest, + REQUIRES_FLAGS_ENABLED( + ACONFIG_FLAG(TEST_BT, progress_acl_scheduler_upon_incoming_connection))) { + auto promise = std::promise<void>{}; + auto future = promise.get_future(); + + // an incoming connection arrives + acl_scheduler_->RegisterPendingIncomingConnection(address1); + + // start an outgoing RNR + acl_scheduler_->EnqueueRemoteNameRequest(address1, promiseCallback(std::move(promise)), + emptyCallback()); + + // we expect the outgoing RNR to queue while incoming pending connection from same device + EXPECT_THAT(future, IsSet()); +} + +TEST_F_WITH_FLAGS(AclSchedulerTest, ConnectionToSameDeviceIncomingConnectionPending, + REQUIRES_FLAGS_ENABLED( + ACONFIG_FLAG(TEST_BT, progress_acl_scheduler_upon_incoming_connection))) { + auto promise = std::promise<void>{}; + auto future = promise.get_future(); + + // an incoming connection arrives + acl_scheduler_->RegisterPendingIncomingConnection(address1); + + // try to start an outgoing connection to same device + acl_scheduler_->EnqueueOutgoingAclConnection(address1, promiseCallback(std::move(promise))); + + // we expect the outgoing connection to wait and then dropped once connection + // established + EXPECT_EQ(future.wait_for(timeout), std::future_status::timeout); +} + TEST_F(AclSchedulerTest, CancelOutgoingConnection) { auto promise = std::promise<void>{}; auto future = promise.get_future(); diff --git a/system/gd/hci/acl_manager/le_acl_connection_test.cc b/system/gd/hci/acl_manager/le_acl_connection_test.cc index 1b80e08ec0..e8b9d0637a 100644 --- a/system/gd/hci/acl_manager/le_acl_connection_test.cc +++ b/system/gd/hci/acl_manager/le_acl_connection_test.cc @@ -96,7 +96,7 @@ public: const std::lock_guard<std::mutex> lock(command_queue_mutex_); auto packet = std::move(command_queue_.front()); command_queue_.pop(); - return std::move(packet); + return packet; } std::shared_ptr<std::vector<uint8_t>> DequeueCommandBytes() { @@ -110,7 +110,7 @@ public: common::ContextualOnceCallback<void(hci::CommandStatusView)> DequeueStatusCallback() { auto on_status = std::move(command_status_callbacks.front()); command_status_callbacks.pop_front(); - return std::move(on_status); + return on_status; } bool IsPacketQueueEmpty() const { diff --git a/system/gd/hci/acl_manager/le_impl.h b/system/gd/hci/acl_manager/le_impl.h index c88a1d62be..8020dfc47e 100644 --- a/system/gd/hci/acl_manager/le_impl.h +++ b/system/gd/hci/acl_manager/le_impl.h @@ -18,6 +18,7 @@ #include <base/strings/stringprintf.h> #include <bluetooth/log.h> +#include <com_android_bluetooth_flags.h> #include <cstdint> #include <memory> @@ -953,6 +954,17 @@ public: add_device_to_accept_list(address_with_type); } + if (com::android::bluetooth::flags:: + improve_create_connection_for_already_connecting_device()) { + bool in_accept_list_due_to_direct_connect = + direct_connections_.find(address_with_type) != direct_connections_.end(); + + if (already_in_accept_list && (in_accept_list_due_to_direct_connect || !is_direct)) { + log::info("Device {} already in accept list. Stop here.", address_with_type); + return; + } + } + if (is_direct) { direct_connect_add(address_with_type); } diff --git a/system/gd/hci/acl_manager/le_impl_test.cc b/system/gd/hci/acl_manager/le_impl_test.cc index 67c6c8c8ea..120a58c5ba 100644 --- a/system/gd/hci/acl_manager/le_impl_test.cc +++ b/system/gd/hci/acl_manager/le_impl_test.cc @@ -17,6 +17,7 @@ #include "hci/acl_manager/le_impl.h" #include <bluetooth/log.h> +#include <com_android_bluetooth_flags.h> #include <gmock/gmock.h> #include <gtest/gtest.h> #include <log/log.h> @@ -278,7 +279,168 @@ protected: hci_layer_->IncomingEvent(LeSetRandomAddressCompleteBuilder::Create(0x01, ErrorCode::SUCCESS)); } + void test_direct_connection_after_background_connection() { + set_random_device_address_policy(); + + hci::AddressWithType address({0x21, 0x22, 0x23, 0x24, 0x25, 0x26}, + AddressType::PUBLIC_DEVICE_ADDRESS); + + // arrange: Create background connection. Remember that acl_manager adds device background list + le_impl_->add_device_to_background_connection_list(address); + le_impl_->create_le_connection(address, true, /* is_direct */ false); + hci_layer_->GetCommand(OpCode::LE_ADD_DEVICE_TO_FILTER_ACCEPT_LIST); + hci_layer_->IncomingEvent( + LeAddDeviceToFilterAcceptListCompleteBuilder::Create(0x01, ErrorCode::SUCCESS)); + auto raw_bg_create_connection = hci_layer_->GetCommand(OpCode::LE_CREATE_CONNECTION); + hci_layer_->IncomingEvent(LeCreateConnectionStatusBuilder::Create(ErrorCode::SUCCESS, 0x01)); + sync_handler(); + + // act: Create direct connection + le_impl_->create_le_connection(address, true, /* is_direct */ true); + auto cancel_connection = hci_layer_->GetCommand(OpCode::LE_CREATE_CONNECTION_CANCEL); + if (cancel_connection.IsValid()) { + hci_layer_->IncomingEvent( + LeCreateConnectionCancelCompleteBuilder::Create(0x01, ErrorCode::SUCCESS)); + hci_layer_->IncomingLeMetaEvent(LeConnectionCompleteBuilder::Create( + ErrorCode::UNKNOWN_CONNECTION, kHciHandle, Role::CENTRAL, + AddressType::PUBLIC_DEVICE_ADDRESS, Address::kEmpty, 0x0000, 0x0000, 0x0000, + ClockAccuracy::PPM_30)); + } + auto raw_direct_create_connection = hci_layer_->GetCommand(OpCode::LE_CREATE_CONNECTION); + + // assert + auto bg_create_connection = + LeCreateConnectionView::Create(LeConnectionManagementCommandView::Create( + AclCommandView::Create(raw_bg_create_connection))); + EXPECT_TRUE(bg_create_connection.IsValid()); + auto direct_create_connection = + LeCreateConnectionView::Create(LeConnectionManagementCommandView::Create( + AclCommandView::Create(raw_direct_create_connection))); + EXPECT_TRUE(direct_create_connection.IsValid()); + log::info("Scan Interval {}", direct_create_connection.GetLeScanInterval()); + ASSERT_NE(direct_create_connection.GetLeScanInterval(), + bg_create_connection.GetLeScanInterval()); + + hci_layer_->IncomingEvent(LeCreateConnectionStatusBuilder::Create(ErrorCode::SUCCESS, 0x01)); + sync_handler(); + + // Check state is ARMED + ASSERT_EQ(ConnectabilityState::ARMED, le_impl_->connectability_state_); + + // Simulate timeout on direct connect. Verify background connect is still in place + EXPECT_CALL(mock_le_connection_callbacks_, + OnLeConnectFail(_, ErrorCode::CONNECTION_ACCEPT_TIMEOUT)) + .Times(1); + le_impl_->on_create_connection_timeout(address); + sync_handler(); + cancel_connection = hci_layer_->GetCommand(OpCode::LE_CREATE_CONNECTION_CANCEL); + hci_layer_->IncomingEvent( + LeCreateConnectionCancelCompleteBuilder::Create(0x01, ErrorCode::SUCCESS)); + hci_layer_->IncomingLeMetaEvent(LeConnectionCompleteBuilder::Create( + ErrorCode::UNKNOWN_CONNECTION, kHciHandle, Role::CENTRAL, + AddressType::PUBLIC_DEVICE_ADDRESS, Address::kEmpty, 0x0000, 0x0000, 0x0000, + ClockAccuracy::PPM_30)); + EXPECT_TRUE(cancel_connection.IsValid()); + raw_bg_create_connection = hci_layer_->GetCommand(OpCode::LE_CREATE_CONNECTION); + bg_create_connection = LeCreateConnectionView::Create(LeConnectionManagementCommandView::Create( + AclCommandView::Create(raw_bg_create_connection))); + EXPECT_TRUE(bg_create_connection.IsValid()); + sync_handler(); + ASSERT_TRUE(le_impl_->create_connection_timeout_alarms_.empty()); + + hci_layer_->IncomingEvent(LeCreateConnectionStatusBuilder::Create(ErrorCode::SUCCESS, 0x01)); + sync_handler(); + + // Check state is ARMED + ASSERT_EQ(ConnectabilityState::ARMED, le_impl_->connectability_state_); + } + + void test_direct_connect_after_direct_connect() { + set_random_device_address_policy(); + + hci::AddressWithType address({0x21, 0x22, 0x23, 0x24, 0x25, 0x26}, + AddressType::PUBLIC_DEVICE_ADDRESS); + + // Create first direct connection + le_impl_->create_le_connection(address, true, /* is_direct */ true); + hci_layer_->GetCommand(OpCode::LE_ADD_DEVICE_TO_FILTER_ACCEPT_LIST); + hci_layer_->IncomingEvent( + LeAddDeviceToFilterAcceptListCompleteBuilder::Create(0x01, ErrorCode::SUCCESS)); + auto raw_direct_1_create_connection = hci_layer_->GetCommand(OpCode::LE_CREATE_CONNECTION); + hci_layer_->IncomingEvent(LeCreateConnectionStatusBuilder::Create(ErrorCode::SUCCESS, 0x01)); + sync_handler(); + + // Check state is ARMED + ASSERT_EQ(ConnectabilityState::ARMED, le_impl_->connectability_state_); + + // assert + auto direct_1_create_connection = + LeCreateConnectionView::Create(LeConnectionManagementCommandView::Create( + AclCommandView::Create(raw_direct_1_create_connection))); + EXPECT_TRUE(direct_1_create_connection.IsValid()); + + log::info("Second direct connect to the same device"); + + // Create second direct connection + le_impl_->create_le_connection(address, true, /* is_direct */ true); + sync_handler(); + + CommandView cancel_connection = CommandView::Create( + PacketView<packet::kLittleEndian>(std::make_shared<std::vector<uint8_t>>())); + ; + + if (!com::android::bluetooth::flags:: + improve_create_connection_for_already_connecting_device()) { + cancel_connection = hci_layer_->GetCommand(OpCode::LE_CREATE_CONNECTION_CANCEL); + if (cancel_connection.IsValid()) { + hci_layer_->IncomingEvent( + LeCreateConnectionCancelCompleteBuilder::Create(0x01, ErrorCode::SUCCESS)); + hci_layer_->IncomingLeMetaEvent(LeConnectionCompleteBuilder::Create( + ErrorCode::UNKNOWN_CONNECTION, kHciHandle, Role::CENTRAL, + AddressType::PUBLIC_DEVICE_ADDRESS, Address::kEmpty, 0x0000, 0x0000, 0x0000, + ClockAccuracy::PPM_30)); + } + + auto raw_direct_2_create_connection = hci_layer_->GetCommand(OpCode::LE_CREATE_CONNECTION); + + auto direct_2_create_connection = + LeCreateConnectionView::Create(LeConnectionManagementCommandView::Create( + AclCommandView::Create(raw_direct_2_create_connection))); + EXPECT_TRUE(direct_2_create_connection.IsValid()); + hci_layer_->IncomingEvent(LeCreateConnectionStatusBuilder::Create(ErrorCode::SUCCESS, 0x01)); + sync_handler(); + } else { + hci_layer_->AssertNoQueuedCommand(); + } + + log::info("Simulate timeout"); + + EXPECT_CALL(mock_le_connection_callbacks_, + OnLeConnectFail(_, ErrorCode::CONNECTION_ACCEPT_TIMEOUT)) + .Times(1); + le_impl_->on_create_connection_timeout(address); + sync_handler(); + cancel_connection = hci_layer_->GetCommand(OpCode::LE_CREATE_CONNECTION_CANCEL); + EXPECT_TRUE(cancel_connection.IsValid()); + hci_layer_->IncomingEvent( + LeCreateConnectionCancelCompleteBuilder::Create(0x01, ErrorCode::SUCCESS)); + hci_layer_->IncomingLeMetaEvent(LeConnectionCompleteBuilder::Create( + ErrorCode::UNKNOWN_CONNECTION, kHciHandle, Role::CENTRAL, + AddressType::PUBLIC_DEVICE_ADDRESS, Address::kEmpty, 0x0000, 0x0000, 0x0000, + ClockAccuracy::PPM_30)); + sync_handler(); + ASSERT_TRUE(le_impl_->create_connection_timeout_alarms_.empty()); + + hci_layer_->GetCommand(OpCode::LE_REMOVE_DEVICE_FROM_FILTER_ACCEPT_LIST); + hci_layer_->IncomingEvent( + LeRemoveDeviceFromFilterAcceptListCompleteBuilder::Create(0x01, ErrorCode::SUCCESS)); + hci_layer_->AssertNoQueuedCommand(); + ASSERT_EQ(ConnectabilityState::DISARMED, le_impl_->connectability_state_); + } + void TearDown() override { + com::android::bluetooth::flags::provider_->reset_flags(); + // We cannot teardown our structure without unregistering // from our own structure we created. if (le_impl_->address_manager_registered) { @@ -1419,151 +1581,29 @@ TEST_F(LeImplTest, DisconnectionAcceptlistCallback) { } TEST_F(LeImplTest, direct_connection_after_background_connection) { - set_random_device_address_policy(); - - hci::AddressWithType address({0x21, 0x22, 0x23, 0x24, 0x25, 0x26}, - AddressType::PUBLIC_DEVICE_ADDRESS); - - // arrange: Create background connection. Remember that acl_manager adds device background list - le_impl_->add_device_to_background_connection_list(address); - le_impl_->create_le_connection(address, true, /* is_direct */ false); - hci_layer_->GetCommand(OpCode::LE_ADD_DEVICE_TO_FILTER_ACCEPT_LIST); - hci_layer_->IncomingEvent( - LeAddDeviceToFilterAcceptListCompleteBuilder::Create(0x01, ErrorCode::SUCCESS)); - auto raw_bg_create_connection = hci_layer_->GetCommand(OpCode::LE_CREATE_CONNECTION); - hci_layer_->IncomingEvent(LeCreateConnectionStatusBuilder::Create(ErrorCode::SUCCESS, 0x01)); - sync_handler(); - - // act: Create direct connection - le_impl_->create_le_connection(address, true, /* is_direct */ true); - auto cancel_connection = hci_layer_->GetCommand(OpCode::LE_CREATE_CONNECTION_CANCEL); - if (cancel_connection.IsValid()) { - hci_layer_->IncomingEvent( - LeCreateConnectionCancelCompleteBuilder::Create(0x01, ErrorCode::SUCCESS)); - hci_layer_->IncomingLeMetaEvent(LeConnectionCompleteBuilder::Create( - ErrorCode::UNKNOWN_CONNECTION, kHciHandle, Role::CENTRAL, - AddressType::PUBLIC_DEVICE_ADDRESS, Address::kEmpty, 0x0000, 0x0000, 0x0000, - ClockAccuracy::PPM_30)); - } - auto raw_direct_create_connection = hci_layer_->GetCommand(OpCode::LE_CREATE_CONNECTION); - - // assert - auto bg_create_connection = - LeCreateConnectionView::Create(LeConnectionManagementCommandView::Create( - AclCommandView::Create(raw_bg_create_connection))); - EXPECT_TRUE(bg_create_connection.IsValid()); - auto direct_create_connection = - LeCreateConnectionView::Create(LeConnectionManagementCommandView::Create( - AclCommandView::Create(raw_direct_create_connection))); - EXPECT_TRUE(direct_create_connection.IsValid()); - log::info("Scan Interval {}", direct_create_connection.GetLeScanInterval()); - ASSERT_NE(direct_create_connection.GetLeScanInterval(), bg_create_connection.GetLeScanInterval()); - - hci_layer_->IncomingEvent(LeCreateConnectionStatusBuilder::Create(ErrorCode::SUCCESS, 0x01)); - sync_handler(); - - // Check state is ARMED - ASSERT_EQ(ConnectabilityState::ARMED, le_impl_->connectability_state_); - - // Simulate timeout on direct connect. Verify background connect is still in place - EXPECT_CALL(mock_le_connection_callbacks_, - OnLeConnectFail(_, ErrorCode::CONNECTION_ACCEPT_TIMEOUT)) - .Times(1); - le_impl_->on_create_connection_timeout(address); - sync_handler(); - cancel_connection = hci_layer_->GetCommand(OpCode::LE_CREATE_CONNECTION_CANCEL); - hci_layer_->IncomingEvent( - LeCreateConnectionCancelCompleteBuilder::Create(0x01, ErrorCode::SUCCESS)); - hci_layer_->IncomingLeMetaEvent(LeConnectionCompleteBuilder::Create( - ErrorCode::UNKNOWN_CONNECTION, kHciHandle, Role::CENTRAL, - AddressType::PUBLIC_DEVICE_ADDRESS, Address::kEmpty, 0x0000, 0x0000, 0x0000, - ClockAccuracy::PPM_30)); - EXPECT_TRUE(cancel_connection.IsValid()); - raw_bg_create_connection = hci_layer_->GetCommand(OpCode::LE_CREATE_CONNECTION); - bg_create_connection = LeCreateConnectionView::Create(LeConnectionManagementCommandView::Create( - AclCommandView::Create(raw_bg_create_connection))); - EXPECT_TRUE(bg_create_connection.IsValid()); - sync_handler(); - ASSERT_TRUE(le_impl_->create_connection_timeout_alarms_.empty()); - - hci_layer_->IncomingEvent(LeCreateConnectionStatusBuilder::Create(ErrorCode::SUCCESS, 0x01)); - sync_handler(); + // TODO b/356593752 - remove when test removing flag + com::android::bluetooth::flags::provider_ + ->improve_create_connection_for_already_connecting_device(false); + test_direct_connection_after_background_connection(); +} - // Check state is ARMED - ASSERT_EQ(ConnectabilityState::ARMED, le_impl_->connectability_state_); +TEST_F(LeImplTest, direct_connection_after_background_connection_with_improvement) { + com::android::bluetooth::flags::provider_ + ->improve_create_connection_for_already_connecting_device(true); + test_direct_connection_after_background_connection(); } TEST_F(LeImplTest, direct_connection_after_direct_connection) { - set_random_device_address_policy(); - - hci::AddressWithType address({0x21, 0x22, 0x23, 0x24, 0x25, 0x26}, - AddressType::PUBLIC_DEVICE_ADDRESS); - - // Create first direct connection - le_impl_->create_le_connection(address, true, /* is_direct */ true); - hci_layer_->GetCommand(OpCode::LE_ADD_DEVICE_TO_FILTER_ACCEPT_LIST); - hci_layer_->IncomingEvent( - LeAddDeviceToFilterAcceptListCompleteBuilder::Create(0x01, ErrorCode::SUCCESS)); - auto raw_direct_1_create_connection = hci_layer_->GetCommand(OpCode::LE_CREATE_CONNECTION); - hci_layer_->IncomingEvent(LeCreateConnectionStatusBuilder::Create(ErrorCode::SUCCESS, 0x01)); - sync_handler(); - - // Check state is ARMED - ASSERT_EQ(ConnectabilityState::ARMED, le_impl_->connectability_state_); - - log::info("Second direct connect to the same device"); - - // Create second direct connection - le_impl_->create_le_connection(address, true, /* is_direct */ true); - sync_handler(); - - auto cancel_connection = hci_layer_->GetCommand(OpCode::LE_CREATE_CONNECTION_CANCEL); - if (cancel_connection.IsValid()) { - hci_layer_->IncomingEvent( - LeCreateConnectionCancelCompleteBuilder::Create(0x01, ErrorCode::SUCCESS)); - hci_layer_->IncomingLeMetaEvent(LeConnectionCompleteBuilder::Create( - ErrorCode::UNKNOWN_CONNECTION, kHciHandle, Role::CENTRAL, - AddressType::PUBLIC_DEVICE_ADDRESS, Address::kEmpty, 0x0000, 0x0000, 0x0000, - ClockAccuracy::PPM_30)); - } - - auto raw_direct_2_create_connection = hci_layer_->GetCommand(OpCode::LE_CREATE_CONNECTION); - - // assert - auto direct_1_create_connection = - LeCreateConnectionView::Create(LeConnectionManagementCommandView::Create( - AclCommandView::Create(raw_direct_1_create_connection))); - EXPECT_TRUE(direct_1_create_connection.IsValid()); - auto direct_2_create_connection = - LeCreateConnectionView::Create(LeConnectionManagementCommandView::Create( - AclCommandView::Create(raw_direct_2_create_connection))); - EXPECT_TRUE(direct_2_create_connection.IsValid()); - hci_layer_->IncomingEvent(LeCreateConnectionStatusBuilder::Create(ErrorCode::SUCCESS, 0x01)); - sync_handler(); - - log::info("Simulate timeout"); - - EXPECT_CALL(mock_le_connection_callbacks_, - OnLeConnectFail(_, ErrorCode::CONNECTION_ACCEPT_TIMEOUT)) - .Times(1); - le_impl_->on_create_connection_timeout(address); - sync_handler(); - cancel_connection = hci_layer_->GetCommand(OpCode::LE_CREATE_CONNECTION_CANCEL); - EXPECT_TRUE(cancel_connection.IsValid()); - hci_layer_->IncomingEvent( - LeCreateConnectionCancelCompleteBuilder::Create(0x01, ErrorCode::SUCCESS)); - hci_layer_->IncomingLeMetaEvent(LeConnectionCompleteBuilder::Create( - ErrorCode::UNKNOWN_CONNECTION, kHciHandle, Role::CENTRAL, - AddressType::PUBLIC_DEVICE_ADDRESS, Address::kEmpty, 0x0000, 0x0000, 0x0000, - ClockAccuracy::PPM_30)); - sync_handler(); - ASSERT_TRUE(le_impl_->create_connection_timeout_alarms_.empty()); + // TODO b/356593752 - remove when test removing flag + com::android::bluetooth::flags::provider_ + ->improve_create_connection_for_already_connecting_device(false); + test_direct_connect_after_direct_connect(); +} - hci_layer_->GetCommand(OpCode::LE_REMOVE_DEVICE_FROM_FILTER_ACCEPT_LIST); - hci_layer_->IncomingEvent( - LeRemoveDeviceFromFilterAcceptListCompleteBuilder::Create(0x01, ErrorCode::SUCCESS)); - hci_layer_->AssertNoQueuedCommand(); - ASSERT_EQ(ConnectabilityState::DISARMED, le_impl_->connectability_state_); +TEST_F(LeImplTest, direct_connection_after_direct_connection_with_improvement) { + com::android::bluetooth::flags::provider_ + ->improve_create_connection_for_already_connecting_device(true); + test_direct_connect_after_direct_connect(); } } // namespace acl_manager diff --git a/system/gd/hci/acl_manager/round_robin_scheduler.cc b/system/gd/hci/acl_manager/round_robin_scheduler.cc index 77707f8b22..d7fda71edb 100644 --- a/system/gd/hci/acl_manager/round_robin_scheduler.cc +++ b/system/gd/hci/acl_manager/round_robin_scheduler.cc @@ -18,6 +18,9 @@ #include <bluetooth/log.h> +#include <memory> +#include <utility> + #include "hci/acl_manager/acl_fragmenter.h" namespace bluetooth { namespace hci { @@ -49,7 +52,10 @@ void RoundRobinScheduler::Register(ConnectionType connection_type, uint16_t hand acl_queue_handler acl_queue_handler = {connection_type, std::move(queue), false, 0}; acl_queue_handlers_.insert( std::pair<uint16_t, RoundRobinScheduler::acl_queue_handler>(handle, acl_queue_handler)); + log::info("registering acl_queue handle={}, acl_credits={}, le_credits={}", handle, + acl_packet_credits_, le_acl_packet_credits_); if (fragments_to_send_.size() == 0) { + log::info("start round robin"); start_round_robin(); } } @@ -58,6 +64,8 @@ void RoundRobinScheduler::Unregister(uint16_t handle) { log::assert_that(acl_queue_handlers_.count(handle) == 1, "assert failed: acl_queue_handlers_.count(handle) == 1"); auto acl_queue_handler = acl_queue_handlers_.find(handle)->second; + log::info("unregistering acl_queue handle={}, sent_packets={}", handle, + acl_queue_handler.number_of_sent_packets_); // Reclaim outstanding packets if (acl_queue_handler.connection_type_ == ConnectionType::CLASSIC) { acl_packet_credits_ += acl_queue_handler.number_of_sent_packets_; @@ -89,6 +97,7 @@ uint16_t RoundRobinScheduler::GetLeCredits() { return le_acl_packet_credits_; } void RoundRobinScheduler::start_round_robin() { if (acl_packet_credits_ == 0 && le_acl_packet_credits_ == 0) { + log::warn("Both buffers are full"); return; } if (!fragments_to_send_.empty()) { diff --git a/system/gd/hci/distance_measurement_manager.cc b/system/gd/hci/distance_measurement_manager.cc index 1e65ed2c2e..5977821de2 100644 --- a/system/gd/hci/distance_measurement_manager.cc +++ b/system/gd/hci/distance_measurement_manager.cc @@ -496,7 +496,7 @@ struct DistanceMeasurementManager::impl : bluetooth::hal::RangingHalCallback { connection_handle, kConfigId, kMaxProcedureLen, kMinProcedureInterval, kMaxProcedureInterval, kMaxProcedureCount, kMinSubeventLen, kMaxSubeventLen, kToneAntennaConfigSelection, CsPhy::LE_1M_PHY, kTxPwrDelta, - preferred_peer_antenna), + preferred_peer_antenna, CsSnrControl::NOT_APPLIED, CsSnrControl::NOT_APPLIED), handler_->BindOnceOn(this, &impl::on_cs_set_procedure_parameters)); } diff --git a/system/gd/hci/hci_metrics_logging.cc b/system/gd/hci/hci_metrics_logging.cc index dfc8d6f4ad..d40d7eb071 100644 --- a/system/gd/hci/hci_metrics_logging.cc +++ b/system/gd/hci/hci_metrics_logging.cc @@ -20,6 +20,7 @@ #include "common/audit_log.h" #include "common/strings.h" +#include "metrics/bluetooth_event.h" #include "os/metrics.h" #include "storage/device.h" @@ -911,6 +912,7 @@ void log_classic_pairing_command_status(std::unique_ptr<CommandView>& command_vi log::assert_that(user_confirmation_request_reply.IsValid(), "assert failed: user_confirmation_request_reply.IsValid()"); address = user_confirmation_request_reply.GetBdAddr(); + bluetooth::metrics::LogUserConfirmationRequestResponse(address, true); break; } case OpCode::USER_CONFIRMATION_REQUEST_NEGATIVE_REPLY: { @@ -919,6 +921,7 @@ void log_classic_pairing_command_status(std::unique_ptr<CommandView>& command_vi log::assert_that(user_confirmation_request_negative_reply.IsValid(), "assert failed: user_confirmation_request_negative_reply.IsValid()"); address = user_confirmation_request_negative_reply.GetBdAddr(); + bluetooth::metrics::LogUserConfirmationRequestResponse(address, false); break; } case OpCode::USER_PASSKEY_REQUEST_REPLY: { @@ -927,6 +930,7 @@ void log_classic_pairing_command_status(std::unique_ptr<CommandView>& command_vi log::assert_that(user_passkey_request_reply.IsValid(), "assert failed: user_passkey_request_reply.IsValid()"); address = user_passkey_request_reply.GetBdAddr(); + bluetooth::metrics::LogUserConfirmationRequestResponse(address, true); break; } case OpCode::USER_PASSKEY_REQUEST_NEGATIVE_REPLY: { @@ -935,6 +939,7 @@ void log_classic_pairing_command_status(std::unique_ptr<CommandView>& command_vi log::assert_that(user_passkey_request_negative_reply.IsValid(), "assert failed: user_passkey_request_negative_reply.IsValid()"); address = user_passkey_request_negative_reply.GetBdAddr(); + bluetooth::metrics::LogUserConfirmationRequestResponse(address, false); break; } case OpCode::REMOTE_OOB_DATA_REQUEST_REPLY: { diff --git a/system/gd/hci/le_advertising_manager_test.cc b/system/gd/hci/le_advertising_manager_test.cc index 417a8cc8bb..348182148d 100644 --- a/system/gd/hci/le_advertising_manager_test.cc +++ b/system/gd/hci/le_advertising_manager_test.cc @@ -21,6 +21,7 @@ #include <flag_macros.h> #include <gmock/gmock.h> #include <gtest/gtest.h> +#include <log/log.h> #include <algorithm> #include <chrono> @@ -165,6 +166,7 @@ protected: class LeAdvertisingManagerTest : public ::testing::Test { protected: void SetUp() override { + __android_log_set_minimum_priority(ANDROID_LOG_VERBOSE); test_hci_layer_ = new HciLayerFake; // Ownership is transferred to registry test_controller_ = new TestController; test_acl_manager_ = new TestAclManager; @@ -182,6 +184,8 @@ protected: } void TearDown() override { + TEST_BT::provider_->reset_flags(); + sync_client_handler(); fake_registry_.SynchronizeModuleHandler(&LeAdvertisingManager::Factory, std::chrono::milliseconds(20)); @@ -1833,9 +1837,9 @@ TEST_F(LeExtendedAdvertisingManagerTest, use_public_address_type_if_public_addre EXPECT_EQ(set_parameters_command.GetOwnAddressType(), OwnAddressType::PUBLIC_DEVICE_ADDRESS); } -TEST_F_WITH_FLAGS(LeExtendedAdvertisingManagerTest, - use_nrpa_if_public_address_policy_non_connectable, - REQUIRES_FLAGS_ENABLED(ACONFIG_FLAG(TEST_BT, nrpa_non_connectable_adv))) { +TEST_F(LeExtendedAdvertisingManagerTest, use_nrpa_if_public_address_policy_non_connectable) { + TEST_BT::provider_->nrpa_non_connectable_adv(true); + // arrange: use PUBLIC address policy test_acl_manager_->SetAddressPolicy(LeAddressManager::AddressPolicy::USE_PUBLIC_ADDRESS); @@ -1867,9 +1871,9 @@ TEST_F_WITH_FLAGS(LeExtendedAdvertisingManagerTest, EXPECT_EQ(address.data()[5] >> 6, 0b00); } -TEST_F_WITH_FLAGS(LeExtendedAdvertisingManagerTest, - use_public_if_requested_with_public_address_policy_non_connectable, - REQUIRES_FLAGS_ENABLED(ACONFIG_FLAG(TEST_BT, nrpa_non_connectable_adv))) { +TEST_F(LeExtendedAdvertisingManagerTest, + use_public_if_requested_with_public_address_policy_non_connectable) { + TEST_BT::provider_->nrpa_non_connectable_adv(true); // arrange: use PUBLIC address policy test_acl_manager_->SetAddressPolicy(LeAddressManager::AddressPolicy::USE_PUBLIC_ADDRESS); diff --git a/system/gd/metrics/Android.bp b/system/gd/metrics/Android.bp index 15c4750d6a..a20fa3a460 100644 --- a/system/gd/metrics/Android.bp +++ b/system/gd/metrics/Android.bp @@ -10,6 +10,7 @@ package { filegroup { name: "BluetoothMetricsSources", srcs: [ + "bluetooth_event.cc", "counter_metrics.cc", "metrics_state.cc", "utils.cc", diff --git a/system/gd/metrics/BUILD.gn b/system/gd/metrics/BUILD.gn index b0be59cc89..b64a9a9c16 100644 --- a/system/gd/metrics/BUILD.gn +++ b/system/gd/metrics/BUILD.gn @@ -40,7 +40,8 @@ source_set("BluetoothMetricsSources") { sources = [ "counter_metrics.cc", "utils.cc", - "metrics_state.cc" + "metrics_state.cc", + "bluetooth_event.cc" ] configs += [ diff --git a/system/gd/metrics/bluetooth_event.cc b/system/gd/metrics/bluetooth_event.cc new file mode 100644 index 0000000000..24259a8117 --- /dev/null +++ b/system/gd/metrics/bluetooth_event.cc @@ -0,0 +1,143 @@ +/* + * Copyright 2024 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include "bluetooth_event.h" + +#include <frameworks/proto_logging/stats/enums/bluetooth/enums.pb.h> + +#include "main/shim/helpers.h" +#include "os/metrics.h" + +namespace bluetooth { +namespace metrics { + +using android::bluetooth::EventType; +using android::bluetooth::State; +using hci::ErrorCode; + +State MapErrorCodeToState(ErrorCode reason) { + // TODO - map the error codes to the state enum variants. + switch (reason) { + case ErrorCode::SUCCESS: + return State::SUCCESS; + // Timeout related errors + case ErrorCode::PAGE_TIMEOUT: + return State::PAGE_TIMEOUT; + case ErrorCode::CONNECTION_TIMEOUT: + return State::CONNECTION_TIMEOUT; + case ErrorCode::CONNECTION_ACCEPT_TIMEOUT: + return State::CONNECTION_ACCEPT_TIMEOUT; + case ErrorCode::TRANSACTION_RESPONSE_TIMEOUT: + return State::TRANSACTION_RESPONSE_TIMEOUT; + case ErrorCode::AUTHENTICATION_FAILURE: + return State::AUTH_FAILURE; + case ErrorCode::REMOTE_DEVICE_TERMINATED_CONNECTION_LOW_RESOURCES: + case ErrorCode::REMOTE_DEVICE_TERMINATED_CONNECTION_POWER_OFF: + return State::REMOTE_USER_TERMINATED_CONNECTION; + case ErrorCode::CONNECTION_ALREADY_EXISTS: + return State::ALREADY_CONNECTED; + case ErrorCode::REPEATED_ATTEMPTS: + return State::REPEATED_ATTEMPTS; + case ErrorCode::PIN_OR_KEY_MISSING: + return State::KEY_MISSING; + case ErrorCode::PAIRING_NOT_ALLOWED: + return State::PAIRING_NOT_ALLOWED; + case ErrorCode::CONNECTION_REJECTED_LIMITED_RESOURCES: + return State::RESOURCES_EXCEEDED; + default: + return State::STATE_UNKNOWN; + } +} + +State MapHCIStatusToState(tHCI_STATUS status) { + // TODO - map the error codes to the state enum variants. + switch (status) { + case tHCI_STATUS::HCI_SUCCESS: + return State::SUCCESS; + // Timeout related errors + case tHCI_STATUS::HCI_ERR_PAGE_TIMEOUT: + return State::PAGE_TIMEOUT; + case tHCI_STATUS::HCI_ERR_CONNECTION_TOUT: + return State::CONNECTION_TIMEOUT; + case tHCI_STATUS::HCI_ERR_HOST_TIMEOUT: + return State::CONNECTION_ACCEPT_TIMEOUT; + case tHCI_STATUS::HCI_ERR_LMP_RESPONSE_TIMEOUT: + return State::TRANSACTION_RESPONSE_TIMEOUT; + case tHCI_STATUS::HCI_ERR_AUTH_FAILURE: + return State::AUTH_FAILURE; + case tHCI_STATUS::HCI_ERR_CONNECTION_EXISTS: + return State::ALREADY_CONNECTED; + case tHCI_STATUS::HCI_ERR_REPEATED_ATTEMPTS: + return State::REPEATED_ATTEMPTS; + case tHCI_STATUS::HCI_ERR_KEY_MISSING: + return State::KEY_MISSING; + case tHCI_STATUS::HCI_ERR_PAIRING_NOT_ALLOWED: + return State::PAIRING_NOT_ALLOWED; + case tHCI_STATUS::HCI_ERR_HOST_REJECT_RESOURCES: + return State::RESOURCES_EXCEEDED; + default: + return State::STATE_UNKNOWN; + } +} + +void LogAclCompletionEvent(const hci::Address& address, ErrorCode reason, + bool is_locally_initiated) { + bluetooth::os::LogMetricBluetoothEvent(address, + is_locally_initiated ? EventType::ACL_CONNECTION_INITIATOR + : EventType::ACL_CONNECTION_RESPONDER, + MapErrorCodeToState(reason)); +} + +void LogRemoteNameRequestCompletion(const RawAddress& raw_address, tHCI_STATUS hci_status) { + hci::Address address = bluetooth::ToGdAddress(raw_address); + bluetooth::os::LogMetricBluetoothEvent( + address, EventType::REMOTE_NAME_REQUEST, + MapHCIStatusToState(hci_status)); +} + +void LogAclAfterRemoteNameRequest(const RawAddress& raw_address, tBTM_STATUS status) { + hci::Address address = bluetooth::ToGdAddress(raw_address); + + switch (status) { + case BTM_SUCCESS: + bluetooth::os::LogMetricBluetoothEvent(address, EventType::ACL_CONNECTION_INITIATOR, + State::ALREADY_CONNECTED); + break; + case BTM_NO_RESOURCES: + bluetooth::os::LogMetricBluetoothEvent( + address, EventType::ACL_CONNECTION_INITIATOR, + MapErrorCodeToState(ErrorCode::CONNECTION_REJECTED_LIMITED_RESOURCES)); + break; + default: + break; + } +} + +void LogUserConfirmationRequestResponse(const hci::Address& address, bool positive) { + bluetooth::os::LogMetricBluetoothEvent(address, EventType::USER_CONF_REQUEST, + positive ? State::SUCCESS : State::FAIL); +} + +void LogAuthenticationComplete(const RawAddress& raw_address, tHCI_STATUS hci_status) { + hci::Address address = bluetooth::ToGdAddress(raw_address); + bluetooth::os::LogMetricBluetoothEvent(address, + hci_status == tHCI_STATUS::HCI_SUCCESS + ? EventType::AUTHENTICATION_COMPLETE + : EventType::AUTHENTICATION_COMPLETE_FAIL, + MapHCIStatusToState(hci_status)); +} + +} // namespace metrics +} // namespace bluetooth diff --git a/system/gd/metrics/bluetooth_event.h b/system/gd/metrics/bluetooth_event.h new file mode 100644 index 0000000000..06532181c9 --- /dev/null +++ b/system/gd/metrics/bluetooth_event.h @@ -0,0 +1,40 @@ +/* + * Copyright 2024 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "hci/address.h" +#include "hci/hci_packets.h" +#include "stack/include/btm_status.h" +#include "stack/include/hci_error_code.h" +#include "types/raw_address.h" + +namespace bluetooth { +namespace metrics { + +void LogAclCompletionEvent(const hci::Address& address, hci::ErrorCode reason, + bool is_locally_initiated); + +void LogRemoteNameRequestCompletion(const RawAddress& raw_address, tHCI_STATUS hci_status); + +void LogAclAfterRemoteNameRequest(const RawAddress& raw_address, tBTM_STATUS status); + +void LogUserConfirmationRequestResponse(const hci::Address& address, bool positive); + +void LogAuthenticationComplete(const RawAddress& raw_address, tHCI_STATUS hci_status); + +} // namespace metrics +} // namespace bluetooth diff --git a/system/gd/os/chromeos/system_properties.cc b/system/gd/os/chromeos/system_properties.cc index aef6dadcc1..ee65fcff4c 100644 --- a/system/gd/os/chromeos/system_properties.cc +++ b/system/gd/os/chromeos/system_properties.cc @@ -16,7 +16,7 @@ #include "os/system_properties.h" -#include <mutex> +#include <mutex> // NOLINT #include <string> #include <unordered_map> @@ -29,7 +29,7 @@ std::mutex properties_mutex; // Properties set along with some default values for Floss. std::unordered_map<std::string, std::string> properties = { {"bluetooth.profile.avrcp.target.enabled", "true"}, -}; + {"bluetooth.gd.start_timeout", "12000"}}; } // namespace std::optional<std::string> GetSystemProperty(const std::string& property) { diff --git a/system/gd/os/fake_timer/fake_timerfd.cc b/system/gd/os/fake_timer/fake_timerfd.cc index ea6dbabb24..400a92743c 100644 --- a/system/gd/os/fake_timer/fake_timerfd.cc +++ b/system/gd/os/fake_timer/fake_timerfd.cc @@ -19,6 +19,7 @@ #include <sys/eventfd.h> #include <unistd.h> +#include <cstdint> #include <map> namespace bluetooth { @@ -117,7 +118,7 @@ static bool fire_next_event(uint64_t new_clock) { } to_fire->active = is_periodic; uint64_t value = 1; - write(to_fire->fd, &value, sizeof(uint64_t)); + (void)write(to_fire->fd, &value, sizeof(uint64_t)); return true; } diff --git a/system/gd/os/linux/system_properties.cc b/system/gd/os/linux/system_properties.cc index aef6dadcc1..ee65fcff4c 100644 --- a/system/gd/os/linux/system_properties.cc +++ b/system/gd/os/linux/system_properties.cc @@ -16,7 +16,7 @@ #include "os/system_properties.h" -#include <mutex> +#include <mutex> // NOLINT #include <string> #include <unordered_map> @@ -29,7 +29,7 @@ std::mutex properties_mutex; // Properties set along with some default values for Floss. std::unordered_map<std::string, std::string> properties = { {"bluetooth.profile.avrcp.target.enabled", "true"}, -}; + {"bluetooth.gd.start_timeout", "12000"}}; } // namespace std::optional<std::string> GetSystemProperty(const std::string& property) { diff --git a/system/gd/rust/common/src/init_flags.rs b/system/gd/rust/common/src/init_flags.rs index 268fe0ff77..1276ced26d 100644 --- a/system/gd/rust/common/src/init_flags.rs +++ b/system/gd/rust/common/src/init_flags.rs @@ -207,7 +207,6 @@ pub fn set_all_for_testing() { init_flags!( name: InitFlags flags: { - classic_discovery_only, hci_adapter: i32, use_unified_connection_manager, } diff --git a/system/gd/rust/linux/client/src/dbus_iface.rs b/system/gd/rust/linux/client/src/dbus_iface.rs index 8566753d8e..d16767ee6d 100644 --- a/system/gd/rust/linux/client/src/dbus_iface.rs +++ b/system/gd/rust/linux/client/src/dbus_iface.rs @@ -2652,6 +2652,11 @@ impl IBluetoothMedia for BluetoothMediaDBus { dbus_generated!() } + #[dbus_method("IsInitialized")] + fn is_initialized(&self) -> bool { + dbus_generated!() + } + #[dbus_method("Cleanup")] fn cleanup(&mut self) -> bool { dbus_generated!() diff --git a/system/gd/rust/linux/mgmt/Cargo.toml b/system/gd/rust/linux/mgmt/Cargo.toml index 12b88b1683..b6dbfc30cc 100644 --- a/system/gd/rust/linux/mgmt/Cargo.toml +++ b/system/gd/rust/linux/mgmt/Cargo.toml @@ -29,11 +29,11 @@ log = "0.4.14" nix = "0.23" num-traits = "0.2" protobuf = "2.0" -regex = "1.5" serde_json = "1.0" syslog = "6" tokio = { version = "1.0", features = ["fs", "macros", "rt-multi-thread", "sync"] } libc = "0.2" +log-panics = "2.1.0" [build-dependencies] pkg-config = "0.3.19" diff --git a/system/gd/rust/linux/mgmt/src/main.rs b/system/gd/rust/linux/mgmt/src/main.rs index f88075ed98..7fd3aaeb46 100644 --- a/system/gd/rust/linux/mgmt/src/main.rs +++ b/system/gd/rust/linux/mgmt/src/main.rs @@ -10,6 +10,7 @@ use dbus_crossroads::Crossroads; use dbus_projection::DisconnectWatcher; use dbus_tokio::connection; use log::LevelFilter; +use log_panics; use manager_service::bluetooth_manager::BluetoothManager; use manager_service::powerd_suspend_manager::PowerdSuspendManager; use manager_service::{bluetooth_experimental_dbus, iface_bluetooth_manager}; @@ -50,6 +51,8 @@ pub async fn main() -> Result<(), Box<dyn std::error::Error>> { pid: 0, }; + log_panics::init(); + let logger = syslog::unix(formatter).expect("could not connect to syslog"); let _ = log::set_boxed_logger(Box::new(BasicLogger::new(logger))) .map(|()| log::set_max_level(config_util::get_log_level().unwrap_or(level_filter))); diff --git a/system/gd/rust/linux/mgmt/src/state_machine.rs b/system/gd/rust/linux/mgmt/src/state_machine.rs index a7676c4f9c..679c9e4b4a 100644 --- a/system/gd/rust/linux/mgmt/src/state_machine.rs +++ b/system/gd/rust/linux/mgmt/src/state_machine.rs @@ -9,7 +9,6 @@ use libc; use log::{debug, error, info, warn}; use nix::sys::signal::{self, Signal}; use nix::unistd::Pid; -use regex::Regex; use std::collections::{BTreeMap, HashMap}; use std::convert::TryFrom; use std::fmt::{Display, Formatter}; @@ -286,8 +285,12 @@ fn pid_inotify_async_fd() -> AsyncFd<inotify::Inotify> { /// Given an pid path, returns the adapter index for that pid path. fn get_hci_index_from_pid_path(path: &str) -> Option<VirtualHciIndex> { - let re = Regex::new(r"bluetooth([0-9]+).pid").unwrap(); - re.captures(path)?.get(1)?.as_str().parse().ok().map(VirtualHciIndex) + path.rsplit_once('/') + .or_else(|| Some(("", path))) // Contains no '/', so |path| is the last component. + .and_then(|tup| tup.1.strip_prefix("bluetooth")) + .and_then(|s| s.strip_suffix(".pid")) + .and_then(|p| p.parse::<i32>().ok()) + .map(VirtualHciIndex) } fn event_name_to_string(name: Option<&std::ffi::OsStr>) -> Option<String> { @@ -2182,14 +2185,18 @@ mod tests { get_hci_index_from_pid_path("/var/run/bluetooth/bluetooth0.pid"), Some(VirtualHciIndex(0)) ); + assert_eq!(get_hci_index_from_pid_path("bluetooth0.pid"), Some(VirtualHciIndex(0))); assert_eq!( get_hci_index_from_pid_path("/var/run/bluetooth/bluetooth1.pid"), Some(VirtualHciIndex(1)) ); + assert_eq!(get_hci_index_from_pid_path("bluetooth1.pid"), Some(VirtualHciIndex(1))); assert_eq!( get_hci_index_from_pid_path("/var/run/bluetooth/bluetooth10.pid"), Some(VirtualHciIndex(10)) ); + assert_eq!(get_hci_index_from_pid_path("bluetooth10.pid"), Some(VirtualHciIndex(10))); assert_eq!(get_hci_index_from_pid_path("/var/run/bluetooth/garbage"), None); + assert_eq!(get_hci_index_from_pid_path("garbage"), None); } } diff --git a/system/gd/rust/linux/service/src/iface_bluetooth_media.rs b/system/gd/rust/linux/service/src/iface_bluetooth_media.rs index 62f9ba36fe..88d6b200a5 100644 --- a/system/gd/rust/linux/service/src/iface_bluetooth_media.rs +++ b/system/gd/rust/linux/service/src/iface_bluetooth_media.rs @@ -268,6 +268,11 @@ impl IBluetoothMedia for IBluetoothMediaDBus { dbus_generated!() } + #[dbus_method("IsInitialized")] + fn is_initialized(&self) -> bool { + dbus_generated!() + } + #[dbus_method("Cleanup")] fn cleanup(&mut self) -> bool { dbus_generated!() diff --git a/system/gd/rust/linux/service/src/main.rs b/system/gd/rust/linux/service/src/main.rs index 2f08e20a04..c0a299d656 100644 --- a/system/gd/rust/linux/service/src/main.rs +++ b/system/gd/rust/linux/service/src/main.rs @@ -49,6 +49,8 @@ const ADMIN_SETTINGS_FILE_PATH: &str = "/var/lib/bluetooth/admin_policy.json"; const STACK_TURN_OFF_TIMEOUT_MS: Duration = Duration::from_millis(4000); // Time bt_stack_manager waits for cleanup const STACK_CLEANUP_TIMEOUT_MS: Duration = Duration::from_millis(1000); +// Time bt_stack_manager waits for cleanup profiles +const STACK_CLEANUP_PROFILES_TIMEOUT_MS: Duration = Duration::from_millis(100); const INIT_LOGGING_MAX_RETRY: u8 = 3; @@ -119,9 +121,6 @@ fn main() -> Result<(), Box<dyn Error>> { } } - // Always treat discovery as classic only - init_flags.push(String::from("INIT_classic_discovery_only=true")); - let (tx, rx) = Stack::create_channel(); let (api_tx, api_rx) = interface_manager::InterfaceManager::create_channel(); let sig_notifier = Arc::new(SigData { @@ -283,7 +282,7 @@ extern "C" fn handle_sigterm(_signum: i32) { if let Some((tx, notifier)) = guard.as_ref() { log::debug!("Handling SIGTERM by disabling the adapter!"); let txl = tx.clone(); - tokio::spawn(async move { + topstack::get_runtime().spawn(async move { // Send the shutdown message here. let _ = txl.send(Message::InterfaceShutdown).await; }); @@ -296,8 +295,13 @@ extern "C" fn handle_sigterm(_signum: i32) { log::debug!("SIGTERM cleaning up the stack."); let txl = tx.clone(); - tokio::spawn(async move { - // Send the cleanup message here. + topstack::get_runtime().spawn(async move { + // Clean up the profiles first as some of them might require main thread to clean up. + let _ = txl.send(Message::CleanupProfiles).await; + // Currently there is no good way to know when the profile is cleaned. + // Simply add a small delay here. + tokio::time::sleep(STACK_CLEANUP_PROFILES_TIMEOUT_MS).await; + // Send the cleanup message to clean up the main thread. let _ = txl.send(Message::Cleanup).await; }); diff --git a/system/gd/rust/linux/stack/src/bluetooth.rs b/system/gd/rust/linux/stack/src/bluetooth.rs index 4bccaccb18..de133b29ff 100644 --- a/system/gd/rust/linux/stack/src/bluetooth.rs +++ b/system/gd/rust/linux/stack/src/bluetooth.rs @@ -417,14 +417,29 @@ impl BluetoothDeviceContext { match &prop { BluetoothProperty::BdAddr(bdaddr) => { self.info.address = *bdaddr; - self.properties.insert(prop.get_type(), prop.clone()); + self.properties.insert(BtPropertyType::BdAddr, prop.clone()); } BluetoothProperty::BdName(bdname) => { if !bdname.is_empty() { self.info.name = bdname.clone(); - self.properties.insert(prop.get_type(), prop.clone()); + self.properties.insert(BtPropertyType::BdName, prop.clone()); } } + BluetoothProperty::Uuids(new_uuids) => { + // Merge the new and the old (if exist) UUIDs. + self.properties + .entry(BtPropertyType::Uuids) + .and_modify(|old_prop| { + if let BluetoothProperty::Uuids(old_uuids) = old_prop { + for uuid in new_uuids { + if !old_uuids.contains(uuid) { + old_uuids.push(*uuid); + } + } + } + }) + .or_insert(prop.clone()); + } _ => { self.properties.insert(prop.get_type(), prop.clone()); } @@ -1352,7 +1367,7 @@ impl Bluetooth { /// Disconnect the device if no HID or media profiles are enabled. pub fn disconnect_if_no_media_or_hid_profiles_connected(&mut self, device_address: RawAddress) { let context = match self.remote_devices.get(&device_address) { - Some(context) => context.clone(), + Some(context) => context, None => return, }; let device = context.info.clone(); @@ -1691,7 +1706,7 @@ impl BtifBluetoothCallbacks for Bluetooth { BtAclState::Disconnected, device_info, Instant::now(), - properties, + properties.clone(), )) .info .clone(); @@ -1700,6 +1715,17 @@ impl BtifBluetoothCallbacks for Bluetooth { callback.on_device_found(device_info.clone()); }); + // In btif_dm, Floss intentionally reports the UUIDs in EIR on DeviceFound, + // thus we forward the properties changed event to the clients here. + if !properties.is_empty() { + self.callbacks.for_all_callbacks(|callback| { + callback.on_device_properties_changed( + device_info.clone(), + properties.clone().into_iter().map(|x| x.get_type()).collect(), + ); + }); + } + self.bluetooth_admin.lock().unwrap().on_device_found(&device_info); } diff --git a/system/gd/rust/linux/stack/src/bluetooth_media.rs b/system/gd/rust/linux/stack/src/bluetooth_media.rs index c37b6c6a85..a140d2383c 100644 --- a/system/gd/rust/linux/stack/src/bluetooth_media.rs +++ b/system/gd/rust/linux/stack/src/bluetooth_media.rs @@ -92,6 +92,15 @@ const MEDIA_CLASSIC_AUDIO_PROFILES: &[Profile] = const MEDIA_LE_AUDIO_PROFILES: &[Profile] = &[Profile::LeAudio, Profile::VolumeControl, Profile::CoordinatedSet]; +const MEDIA_PROFILE_ENABLE_ORDER: &[Profile] = &[ + Profile::A2dpSource, + Profile::AvrcpTarget, + Profile::Hfp, + Profile::LeAudio, + Profile::VolumeControl, + Profile::CoordinatedSet, +]; + /// Group ID used to identify unknown/non-existent groups. pub const LEA_UNKNOWN_GROUP_ID: i32 = -1; @@ -108,6 +117,9 @@ pub trait IBluetoothMedia { /// initializes media (both A2dp and AVRCP) stack fn initialize(&mut self) -> bool; + /// Get if the media stack is initialized. + fn is_initialized(&self) -> bool; + /// clean up media stack fn cleanup(&mut self) -> bool; @@ -567,6 +579,14 @@ impl BluetoothMedia { } } + pub fn cleanup(&mut self) -> bool { + for profile in MEDIA_PROFILE_ENABLE_ORDER.iter().rev() { + self.disable_profile(&profile); + } + self.initialized = false; + true + } + fn is_profile_connected(&self, addr: &RawAddress, profile: &Profile) -> bool { self.is_any_profile_connected(addr, &[*profile]) } @@ -2317,7 +2337,16 @@ impl BluetoothMedia { // Ignore unless all profiles are cleared, where we need to do some clean up. if !is_profile_cleared { // Unbonded device is special, we need to reject the connection from them. - if !self.is_bonded(&addr) { + // However, it's rather tricky to distinguish between these two cases: + // (1) the unbonded device tries to reconnect some of the profiles. + // (2) we just unbond a device, so now the profiles are disconnected one-by-one. + // In case of (2), we should not send async_disconnect too soon because doing so + // might prevent on_bluetooth_audio_device_removed() from firing, since the conn + // state is already "Disconnecting" in notify_critical_profile_disconnected. + // Therefore to prevent it, we also check the state is still FullyConnected. + if !self.is_bonded(&addr) + && states.get(&addr).unwrap() != &DeviceConnectionStates::FullyConnected + { let tasks = self.fallback_tasks.clone(); let states = self.device_states.clone(); let txl = self.tx.clone(); @@ -3193,15 +3222,7 @@ impl IBluetoothMedia for BluetoothMedia { // TODO(b/284811956) A2DP needs to be enabled before AVRCP otherwise AVRCP gets memset'd. // Iterate the delay_enable_profiles hashmap directly when this is fixed. - let profile_order = vec![ - Profile::A2dpSource, - Profile::AvrcpTarget, - Profile::Hfp, - Profile::LeAudio, - Profile::VolumeControl, - Profile::CoordinatedSet, - ]; - for profile in profile_order { + for profile in MEDIA_PROFILE_ENABLE_ORDER { if self.delay_enable_profiles.contains(&profile) { self.enable_profile(&profile); } @@ -3596,8 +3617,12 @@ impl IBluetoothMedia for BluetoothMedia { } } + fn is_initialized(&self) -> bool { + self.initialized + } + fn cleanup(&mut self) -> bool { - true + self.cleanup() } // This may not disconnect all media profiles at once, but once the stack diff --git a/system/gd/rust/linux/stack/src/lib.rs b/system/gd/rust/linux/stack/src/lib.rs index a8f2529daa..2115efcf25 100644 --- a/system/gd/rust/linux/stack/src/lib.rs +++ b/system/gd/rust/linux/stack/src/lib.rs @@ -73,6 +73,8 @@ pub enum Message { AdapterShutdown, /// Clean up the adapter by calling btif cleanup. Cleanup, + /// Clean up the media by calling profile cleanup. + CleanupProfiles, // Adapter is enabled and ready. AdapterReady, @@ -250,6 +252,10 @@ impl Stack { bluetooth.lock().unwrap().cleanup(); } + Message::CleanupProfiles => { + bluetooth_media.lock().unwrap().cleanup(); + } + Message::AdapterReady => { // Initialize objects that need the adapter to be fully // enabled before running. diff --git a/system/gd/rust/linux/utils/src/adv_parser.rs b/system/gd/rust/linux/utils/src/adv_parser.rs index 23d3e28597..0f929bdf4e 100644 --- a/system/gd/rust/linux/utils/src/adv_parser.rs +++ b/system/gd/rust/linux/utils/src/adv_parser.rs @@ -6,8 +6,11 @@ use bt_topshim::bindings::root::bluetooth::Uuid; // Advertising data types. const FLAGS: u8 = 0x01; +const INCOMPLETE_LIST_16_BIT_SERVICE_UUIDS: u8 = 0x02; const COMPLETE_LIST_16_BIT_SERVICE_UUIDS: u8 = 0x03; +const INCOMPLETE_LIST_32_BIT_SERVICE_UUIDS: u8 = 0x04; const COMPLETE_LIST_32_BIT_SERVICE_UUIDS: u8 = 0x05; +const INCOMPLETE_LIST_128_BIT_SERVICE_UUIDS: u8 = 0x06; const COMPLETE_LIST_128_BIT_SERVICE_UUIDS: u8 = 0x07; const SHORTENED_LOCAL_NAME: u8 = 0x08; const COMPLETE_LOCAL_NAME: u8 = 0x09; @@ -68,6 +71,21 @@ pub fn extract_service_uuids(bytes: &[u8]) -> Vec<Uuid> { .flat_map(|slice| slice.chunks(16)) .filter_map(|chunk| Uuid::try_from_little_endian(chunk).ok()), ) + .chain( + iterate_adv_data(bytes, INCOMPLETE_LIST_16_BIT_SERVICE_UUIDS) + .flat_map(|slice| slice.chunks(2)) + .filter_map(|chunk| Uuid::try_from_little_endian(chunk).ok()), + ) + .chain( + iterate_adv_data(bytes, INCOMPLETE_LIST_32_BIT_SERVICE_UUIDS) + .flat_map(|slice| slice.chunks(4)) + .filter_map(|chunk| Uuid::try_from_little_endian(chunk).ok()), + ) + .chain( + iterate_adv_data(bytes, INCOMPLETE_LIST_128_BIT_SERVICE_UUIDS) + .flat_map(|slice| slice.chunks(16)) + .filter_map(|chunk| Uuid::try_from_little_endian(chunk).ok()), + ) .collect() } @@ -198,6 +216,57 @@ mod tests { ]) ); assert_eq!(uuids[2], Uuid::from([15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0])); + + let payload: Vec<u8> = vec![ + 2, + FLAGS, + 3, + 3, + INCOMPLETE_LIST_16_BIT_SERVICE_UUIDS, + 0x2C, + 0xFE, + 5, + INCOMPLETE_LIST_32_BIT_SERVICE_UUIDS, + 2, + 3, + 4, + 5, + 17, + INCOMPLETE_LIST_128_BIT_SERVICE_UUIDS, + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + ]; + let uuids = extract_service_uuids(payload.as_slice()); + assert_eq!(uuids.len(), 3); + assert_eq!( + uuids[0], + Uuid::from([ + 0x0, 0x0, 0xFE, 0x2C, 0x0, 0x0, 0x10, 0x0, 0x80, 0x0, 0x0, 0x80, 0x5f, 0x9b, 0x34, + 0xfb + ]) + ); + assert_eq!( + uuids[1], + Uuid::from([ + 0x5, 0x4, 0x3, 0x2, 0x0, 0x0, 0x10, 0x0, 0x80, 0x0, 0x0, 0x80, 0x5f, 0x9b, 0x34, + 0xfb + ]) + ); + assert_eq!(uuids[2], Uuid::from([15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0])); } #[test] diff --git a/system/gd/rust/linux/utils/src/uinput.rs b/system/gd/rust/linux/utils/src/uinput.rs index c129c92045..43bbd062ff 100644 --- a/system/gd/rust/linux/utils/src/uinput.rs +++ b/system/gd/rust/linux/utils/src/uinput.rs @@ -105,13 +105,8 @@ impl Default for UInputDevInfo { } impl UInputDevInfo { - pub fn serialize(&mut self) -> &[u8] { - unsafe { - slice::from_raw_parts( - (self as *const UInputDevInfo) as *const u8, - mem::size_of::<UInputDevInfo>(), - ) - } + pub fn serialize(&self) -> &[u8] { + unsafe { slice::from_raw_parts((self as *const Self) as *const u8, mem::size_of::<Self>()) } } } @@ -124,13 +119,8 @@ struct UInputEvent { } impl UInputEvent { - pub fn serialize(&mut self) -> &[u8] { - unsafe { - slice::from_raw_parts( - (self as *const UInputEvent) as *const u8, - mem::size_of::<UInputEvent>(), - ) - } + pub fn serialize(&self) -> &[u8] { + unsafe { slice::from_raw_parts((self as *const Self) as *const u8, mem::size_of::<Self>()) } } } @@ -184,10 +174,11 @@ impl UInputDev { )); } + let device_serialized = self.device.serialize(); if libc::write( fd, - self.device.serialize().as_ptr() as *const libc::c_void, - mem::size_of::<UInputDevInfo>(), + device_serialized.as_ptr() as *const libc::c_void, + device_serialized.len(), ) < 0 { libc::close(fd); @@ -236,14 +227,15 @@ impl UInputDev { code: libc::c_ushort, value: libc::c_int, ) -> i32 { - let mut event = + let event = UInputEvent { time: libc::timeval { tv_sec: 0, tv_usec: 0 }, event_type, code, value }; unsafe { + let event_serialized = event.serialize(); libc::write( self.fd, - event.serialize().as_ptr() as *const libc::c_void, - mem::size_of::<UInputDevInfo>(), + event_serialized.as_ptr() as *const libc::c_void, + event_serialized.len(), ) .try_into() .unwrap() diff --git a/system/gd/rust/shim/src/init_flags.rs b/system/gd/rust/shim/src/init_flags.rs index e514b17723..a5cf713604 100644 --- a/system/gd/rust/shim/src/init_flags.rs +++ b/system/gd/rust/shim/src/init_flags.rs @@ -12,7 +12,6 @@ mod ffi { fn dump() -> Vec<InitFlagWithValue>; - fn classic_discovery_only_is_enabled() -> bool; fn get_hci_adapter() -> i32; fn use_unified_connection_manager_is_enabled() -> bool; } diff --git a/system/gd/rust/topshim/btav/btav_shim.cc b/system/gd/rust/topshim/btav/btav_shim.cc index eb17f6ab61..ed4f6fe3b0 100644 --- a/system/gd/rust/topshim/btav/btav_shim.cc +++ b/system/gd/rust/topshim/btav/btav_shim.cc @@ -50,9 +50,14 @@ public: void GetFolderItems([[maybe_unused]] uint16_t player_id, [[maybe_unused]] std::string media_id, [[maybe_unused]] FolderItemsCallback folder_cb) override {} + void GetAddressedPlayer(GetAddressedPlayerCallback cb) override { cb.Run(currentPlayer_); } + void SetBrowsedPlayer([[maybe_unused]] uint16_t player_id, [[maybe_unused]] SetBrowsedPlayerCallback browse_cb) override {} + void SetAddressedPlayer([[maybe_unused]] uint16_t player_id, + [[maybe_unused]] SetAddressedPlayerCallback cb) override {} + void RegisterUpdateCallback(MediaCallbacks* callback) override { mediaCb_ = callback; } void UnregisterUpdateCallback([[maybe_unused]] MediaCallbacks* callback) override { diff --git a/system/gd/rust/topshim/build.rs b/system/gd/rust/topshim/build.rs index 7193004292..4c5a2416f7 100644 --- a/system/gd/rust/topshim/build.rs +++ b/system/gd/rust/topshim/build.rs @@ -63,7 +63,7 @@ fn main() { .opaque_type("std::.*") // Whitelist std::string though because we use it a lot .allowlist_type("std::string") - .rustfmt_bindings(true) + .formatter(bindgen::Formatter::Rustfmt) .derive_debug(true) .derive_partialeq(true) .derive_eq(true) diff --git a/system/gd/rust/topshim/facade/src/media_service.rs b/system/gd/rust/topshim/facade/src/media_service.rs index d2eae1f5fe..aba1a21f94 100644 --- a/system/gd/rust/topshim/facade/src/media_service.rs +++ b/system/gd/rust/topshim/facade/src/media_service.rs @@ -34,6 +34,7 @@ pub struct MediaServiceImpl { rt: Arc<Runtime>, pub btif_a2dp: Arc<Mutex<A2dp>>, btif_a2dp_sink: Arc<Mutex<A2dpSink>>, + #[allow(dead_code)] pub btif_avrcp: Arc<Mutex<Avrcp>>, } diff --git a/system/gd/rust/topshim/vc/vc_shim.cc b/system/gd/rust/topshim/vc/vc_shim.cc index 4f17a16830..b7f9c80825 100644 --- a/system/gd/rust/topshim/vc/vc_shim.cc +++ b/system/gd/rust/topshim/vc/vc_shim.cc @@ -98,10 +98,10 @@ public: topshim::rust::internal::connection_state_cb(state, address); } - void OnVolumeStateChanged(const RawAddress& address, uint8_t volume, bool mute, + void OnVolumeStateChanged(const RawAddress& address, uint8_t volume, bool mute, uint8_t flags, bool is_autonomous) override { - log::info("address={}, volume={}, mute={}, is_autonomous={}", ADDRESS_TO_LOGGABLE_CSTR(address), - volume, mute, is_autonomous); + log::info("address={}, volume={}, mute={}, flags={}, is_autonomous={}", + ADDRESS_TO_LOGGABLE_CSTR(address), volume, mute, flags, is_autonomous); topshim::rust::internal::volume_state_cb(address, volume, mute, is_autonomous); } diff --git a/system/include/hardware/avrcp/avrcp.h b/system/include/hardware/avrcp/avrcp.h index 32a3b7f3a4..2698cc9f9a 100644 --- a/system/include/hardware/avrcp/avrcp.h +++ b/system/include/hardware/avrcp/avrcp.h @@ -129,10 +129,16 @@ public: virtual void GetFolderItems(uint16_t player_id, std::string media_id, FolderItemsCallback folder_cb) = 0; + using GetAddressedPlayerCallback = base::Callback<void(uint16_t)>; + virtual void GetAddressedPlayer(GetAddressedPlayerCallback addressed_player) = 0; + using SetBrowsedPlayerCallback = base::Callback<void(bool success, std::string root_id, uint32_t num_items)>; virtual void SetBrowsedPlayer(uint16_t player_id, SetBrowsedPlayerCallback browse_cb) = 0; + using SetAddressedPlayerCallback = base::Callback<void(uint16_t)>; + virtual void SetAddressedPlayer(uint16_t player_id, SetAddressedPlayerCallback new_player) = 0; + virtual void PlayItem(uint16_t player_id, bool now_playing, std::string media_id) = 0; virtual void SetActiveDevice(const RawAddress& address) = 0; diff --git a/system/include/hardware/bt_vc.h b/system/include/hardware/bt_vc.h index 74ed814002..36aa2617ef 100644 --- a/system/include/hardware/bt_vc.h +++ b/system/include/hardware/bt_vc.h @@ -36,7 +36,7 @@ public: /* Callback for the volume change changed on the device */ virtual void OnVolumeStateChanged(const RawAddress& address, uint8_t volume, bool mute, - bool isAutonomous) = 0; + uint8_t flags, bool isAutonomous) = 0; /* Callback for the volume change changed on the group*/ virtual void OnGroupVolumeStateChanged(int group_id, uint8_t volume, bool mute, diff --git a/system/main/shim/acl.cc b/system/main/shim/acl.cc index 8da24a34c9..a169d4d6ee 100644 --- a/system/main/shim/acl.cc +++ b/system/main/shim/acl.cc @@ -55,6 +55,7 @@ #include "main/shim/entry.h" #include "main/shim/helpers.h" #include "main/shim/stack.h" +#include "metrics/bluetooth_event.h" #include "os/handler.h" #include "osi/include/allocator.h" #include "stack/acl/acl.h" @@ -1499,6 +1500,7 @@ void shim::legacy::Acl::OnConnectSuccess( locally_initiated); log::debug("Connection successful classic remote:{} handle:{} initiator:{}", remote_address, handle, (locally_initiated) ? "local" : "remote"); + metrics::LogAclCompletionEvent(remote_address, hci::ErrorCode::SUCCESS, locally_initiated); BTM_LogHistory(kBtmLogTag, ToRawAddress(remote_address), "Connection successful", (locally_initiated) ? "classic Local initiated" : "classic Remote initiated"); } @@ -1521,6 +1523,7 @@ void shim::legacy::Acl::OnConnectFail(hci::Address address, hci::ErrorCode reaso TRY_POSTING_ON_MAIN(acl_interface_.connection.classic.on_failed, bd_addr, ToLegacyHciErrorCode(reason), locally_initiated); log::warn("Connection failed classic remote:{} reason:{}", address, hci::ErrorCodeText(reason)); + metrics::LogAclCompletionEvent(address, reason, locally_initiated); BTM_LogHistory(kBtmLogTag, ToRawAddress(address), "Connection failed", base::StringPrintf("classic reason:%s", hci::ErrorCodeText(reason).c_str())); } diff --git a/system/main/shim/acl_api.cc b/system/main/shim/acl_api.cc index 5ea1247a1f..2b5d2669ad 100644 --- a/system/main/shim/acl_api.cc +++ b/system/main/shim/acl_api.cc @@ -35,8 +35,8 @@ #include "stack/btm/btm_sec.h" #include "stack/btm/security_device_record.h" #include "stack/include/bt_hdr.h" -#include "stack/include/inq_hci_link_interface.h" #include "stack/include/main_thread.h" +#include "stack/rnr/remote_name_request.h" #include "types/ble_address_with_type.h" #include "types/raw_address.h" #ifndef PROPERTY_BLE_PRIVACY_OWN_ADDRESS_ENABLED diff --git a/system/main/shim/btm_api.cc b/system/main/shim/btm_api.cc index 4719b6a589..753dc3d5d7 100644 --- a/system/main/shim/btm_api.cc +++ b/system/main/shim/btm_api.cc @@ -29,35 +29,36 @@ #include "main/shim/stack.h" #include "stack/btm/btm_ble_sec.h" #include "stack/btm/btm_dev.h" +#include "stack/include/btm_status.h" #include "types/raw_address.h" tBTM_STATUS bluetooth::shim::BTM_ClearEventFilter() { GetController()->SetEventFilterClearAll(); - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } tBTM_STATUS bluetooth::shim::BTM_ClearEventMask() { GetController()->SetEventMask(0); GetController()->LeSetEventMask(0); - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } tBTM_STATUS bluetooth::shim::BTM_ClearFilterAcceptList() { Stack::GetInstance()->GetAcl()->ClearFilterAcceptList(); - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } tBTM_STATUS bluetooth::shim::BTM_DisconnectAllAcls() { Stack::GetInstance()->GetAcl()->DisconnectAllForSuspend(); // Stack::GetInstance()->GetAcl()->Shutdown(); - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } tBTM_STATUS bluetooth::shim::BTM_SetEventFilterConnectionSetupAllDevices() { // Autoplumbed GetController()->SetEventFilterConnectionSetupAllDevices( bluetooth::hci::AutoAcceptFlag::AUTO_ACCEPT_ON_ROLE_SWITCH_ENABLED); - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } tBTM_STATUS bluetooth::shim::BTM_AllowWakeByHid( @@ -86,7 +87,7 @@ tBTM_STATUS bluetooth::shim::BTM_AllowWakeByHid( accept_future.wait(); } - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } tBTM_STATUS bluetooth::shim::BTM_RestoreFilterAcceptList( @@ -108,7 +109,7 @@ tBTM_STATUS bluetooth::shim::BTM_RestoreFilterAcceptList( accept_future.wait(); } - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } tBTM_STATUS bluetooth::shim::BTM_SetDefaultEventMaskExcept(uint64_t mask, uint64_t le_mask) { @@ -116,18 +117,18 @@ tBTM_STATUS bluetooth::shim::BTM_SetDefaultEventMaskExcept(uint64_t mask, uint64 uint64_t applied_le_mask = bluetooth::hci::Controller::kDefaultLeEventMask & ~(le_mask); GetController()->SetEventMask(applied_mask); GetController()->LeSetEventMask(applied_le_mask); - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } tBTM_STATUS bluetooth::shim::BTM_SetEventFilterInquiryResultAllDevices() { // Autoplumbed GetController()->SetEventFilterInquiryResultAllDevices(); - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } tBTM_STATUS bluetooth::shim::BTM_BleResetId() { btm_ble_reset_id(); - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } size_t bluetooth::shim::BTM_BleGetNumberOfAdvertisingInstancesInUse(void) { diff --git a/system/main/shim/l2c_api.h b/system/main/shim/l2c_api.h deleted file mode 100644 index 98f45b7d44..0000000000 --- a/system/main/shim/l2c_api.h +++ /dev/null @@ -1,458 +0,0 @@ -/* - * Copyright 2019 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include <vector> - -#include "stack/include/bt_hdr.h" -#include "stack/include/l2c_api.h" -#include "types/ble_address_with_type.h" -#include "types/hci_role.h" -#include "types/raw_address.h" - -namespace bluetooth { -namespace shim { - -/******************************************************************************* - * - * Function L2CA_Register - * - * Description Other layers call this function to register for L2CAP - * services. - * - * Returns PSM to use or zero if error. Typically, the PSM returned - * is the same as was passed in, but for an outgoing-only - * connection to a dynamic PSM, a "virtual" PSM is returned - * and should be used in the calls to L2CA_ConnectReq() and - * BTM_SetSecurityLevel(). - * - ******************************************************************************/ -uint16_t L2CA_Register(uint16_t psm, const tL2CAP_APPL_INFO& p_cb_info, bool enable_snoop, - tL2CAP_ERTM_INFO* p_ertm_info, uint16_t my_mtu, uint16_t required_remote_mtu, - uint16_t sec_level); - -/******************************************************************************* - * - * Function L2CA_Deregister - * - * Description Other layers call this function to deregister for L2CAP - * services. - * - * Returns void - * - ******************************************************************************/ -void L2CA_Deregister(uint16_t psm); - -/******************************************************************************* - * - * Function L2CA_AllocateLePSM - * - * Description Other layers call this function to find an unused LE PSM for - * L2CAP services. - * - * Returns LE_PSM to use if success. Otherwise returns 0. - * - ******************************************************************************/ -uint16_t L2CA_AllocateLePSM(void); - -/******************************************************************************* - * - * Function L2CA_FreeLePSM - * - * Description Free an assigned LE PSM. - * - * Returns void - * - ******************************************************************************/ -void L2CA_FreeLePSM(uint16_t psm); - -/******************************************************************************* - * - * Function L2CA_ConnectReq - * - * Description Higher layers call this function to create an L2CAP - * connection. - * Note that the connection is not established at this time, - * but connection establishment gets started. The callback - * will be invoked when connection establishes or fails. - * - * Returns the CID of the connection, or 0 if it failed to start - * - ******************************************************************************/ -uint16_t L2CA_ConnectReq(uint16_t psm, const RawAddress& p_bd_addr); - -/******************************************************************************* - * - * Function L2CA_RegisterLECoc - * - * Description Other layers call this function to register for L2CAP - * Connection Oriented Channel. - * - * Returns PSM to use or zero if error. Typically, the PSM returned - * is the same as was passed in, but for an outgoing-only - * connection to a dynamic PSM, a "virtual" PSM is returned - * and should be used in the calls to L2CA_ConnectLECocReq() - * and BTM_SetSecurityLevel(). - * - ******************************************************************************/ -uint16_t L2CA_RegisterLECoc(uint16_t psm, const tL2CAP_APPL_INFO& p_cb_info, uint16_t sec_level, - tL2CAP_LE_CFG_INFO cfg); - -/******************************************************************************* - * - * Function L2CA_DeregisterLECoc - * - * Description Other layers call this function to deregister for L2CAP - * Connection Oriented Channel. - * - * Returns void - * - ******************************************************************************/ -void L2CA_DeregisterLECoc(uint16_t psm); - -/******************************************************************************* - * - * Function L2CA_ConnectLECocReq - * - * Description Higher layers call this function to create an L2CAP LE COC. - * Note that the connection is not established at this time, - * but connection establishment gets started. The callback - * will be invoked when connection establishes or fails. - * - * Returns the CID of the connection, or 0 if it failed to start - * - ******************************************************************************/ -uint16_t L2CA_ConnectLECocReq(uint16_t psm, const RawAddress& p_bd_addr, tL2CAP_LE_CFG_INFO* p_cfg); - -/******************************************************************************* - * - * Function L2CA_GetPeerLECocConfig - * - * Description Get peers configuration for LE Connection Oriented Channel. - * - * Return value: true if peer is connected - * - ******************************************************************************/ -bool L2CA_GetPeerLECocConfig(uint16_t lcid, tL2CAP_LE_CFG_INFO* peer_cfg); - -/******************************************************************************* - * - * Function L2CA_ReconfigCreditBasedConnsReq - * - * Description Start reconfigure procedure on Credit Based Connection Oriented - * Channels. - * - * Return value: true if peer is connected - * - ******************************************************************************/ - -bool L2CA_ReconfigCreditBasedConnsReq(const RawAddress& bd_addr, std::vector<uint16_t>& lcids, - tL2CAP_LE_CFG_INFO* p_cfg); - -/******************************************************************************* - * - * Function L2CA_ConnectCreditBasedReq - * - * Description With this function L2CAP will initiate setup of up to 5 credit - * based connections for given psm using provided configuration. - * L2CAP will notify user on the connection result, by calling - * pL2CA_CreditBasedConnectCfm_Cb for each cid with a result. - * - * Return value: vector of allocated local cids for the connection - * - ******************************************************************************/ - -extern std::vector<uint16_t> L2CA_ConnectCreditBasedReq(uint16_t psm, const RawAddress& p_bd_addr, - tL2CAP_LE_CFG_INFO* p_cfg); - -/******************************************************************************* - * - * Function L2CA_ConnectCreditBasedRsp - * - * Description Response for the pL2CA_CreditBasedConnectInd_Cb which is the - * indication for peer requesting credit based connection. - * - * Return value: true if peer is connected - * - ******************************************************************************/ - -bool L2CA_ConnectCreditBasedRsp(const RawAddress& p_bd_addr, uint8_t id, - std::vector<uint16_t>& accepted_lcids, uint16_t result, - tL2CAP_LE_CFG_INFO* p_cfg); - -/******************************************************************************* - * - * Function L2CA_DisconnectReq - * - * Description Higher layers call this function to disconnect a channel. - * - * Returns true if disconnect sent, else false - * - ******************************************************************************/ -bool L2CA_DisconnectReq(uint16_t cid); - -bool L2CA_DisconnectLECocReq(uint16_t cid); - -/******************************************************************************* - * - * Function L2CA_DataWrite - * - * Description Higher layers call this function to write data. - * - * Returns tL2CAP_DW_RESULT::SUCCESS, if data accepted, else - * false - * tL2CAP_DW_RESULT::CONGESTED, if data accepted - * and the channel is congested - * tL2CAP_DW_RESULT::FAILED, if error - * - ******************************************************************************/ -uint8_t L2CA_DataWrite(uint16_t cid, BT_HDR* p_data); - -uint8_t L2CA_LECocDataWrite(uint16_t cid, BT_HDR* p_data); - -/******************************************************************************* - * - * Function L2CA_SetIdleTimeoutByBdAddr - * - * Description Higher layers call this function to set the idle timeout for - * a connection. The "idle timeout" is the amount of time that - * a connection can remain up with no L2CAP channels on it. - * A timeout of zero means that the connection will be torn - * down immediately when the last channel is removed. - * A timeout of 0xFFFF means no timeout. Values are in seconds. - * A bd_addr is the remote BD address. If bd_addr = - * RawAddress::kAny, then the idle timeouts for all active - * l2cap links will be changed. - * - * Returns true if command succeeded, false if failed - * - * NOTE This timeout applies to all logical channels active on the - * ACL link. - ******************************************************************************/ -bool L2CA_SetIdleTimeoutByBdAddr(const RawAddress& bd_addr, uint16_t timeout, - tBT_TRANSPORT transport); - -/******************************************************************************* - * - * Function L2CA_FlushChannel - * - * Description This function flushes none, some or all buffers queued up - * for xmission for a particular CID. If called with - * L2CAP_FLUSH_CHANS_GET (0), it simply returns the number - * of buffers queued for that CID L2CAP_FLUSH_CHANS_ALL (0xffff) - * flushes all buffers. All other values specifies the maximum - * buffers to flush. - * - * Returns Number of buffers left queued for that CID - * - ******************************************************************************/ -uint16_t L2CA_FlushChannel(uint16_t lcid, uint16_t num_to_flush); - -/******************************************************************************* - * - * Function L2CA_SetAclPriority - * - * Description Sets the transmission priority for an ACL channel. - * (For initial implementation only two values are valid. - * L2CAP_PRIORITY_NORMAL and L2CAP_PRIORITY_HIGH). - * - * Returns true if a valid channel, else false - * - ******************************************************************************/ -bool L2CA_SetAclPriority(const RawAddress& bd_addr, tL2CAP_PRIORITY priority); - -/******************************************************************************* - * - * Function L2CA_SetTxPriority - * - * Description Sets the transmission priority for a channel. (FCR Mode) - * - * Returns true if a valid channel, else false - * - ******************************************************************************/ -bool L2CA_SetTxPriority(uint16_t cid, tL2CAP_CHNL_PRIORITY priority); - -/******************************************************************************* - * - * Function L2CA_SetChnlFlushability - * - * Description Higher layers call this function to set a channels - * flushability flags - * - * Returns true if CID found, else false - * - ******************************************************************************/ -bool L2CA_SetChnlFlushability(uint16_t cid, bool is_flushable); - -/******************************************************************************* - * - * Function L2CA_GetPeerFeatures - * - * Description Get a peers features and fixed channel map - * - * Parameters: BD address of the peer - * Pointers to features and channel mask storage area - * - * Return value: true if peer is connected - * - ******************************************************************************/ -bool L2CA_GetPeerFeatures(const RawAddress& bd_addr, uint32_t* p_ext_feat, uint8_t* p_chnl_mask); - -/******************************************************************************* - * - * Function L2CA_RegisterFixedChannel - * - * Description Register a fixed channel. - * - * Parameters: Fixed Channel # - * Channel Callbacks and config - * - * Return value: true if registered OK - * - ******************************************************************************/ -bool L2CA_RegisterFixedChannel(uint16_t fixed_cid, tL2CAP_FIXED_CHNL_REG* p_freg); - -/******************************************************************************* - * - * Function L2CA_ConnectFixedChnl - * - * Description Connect an fixed signalling channel to a remote device. - * - * Parameters: Fixed CID - * BD Address of remote - * - * Return value: true if connection started - * - ******************************************************************************/ -bool L2CA_ConnectFixedChnl(uint16_t fixed_cid, const RawAddress& bd_addr); - -/******************************************************************************* - * - * Function L2CA_SendFixedChnlData - * - * Description Write data on a fixed signalling channel. - * - * Parameters: Fixed CID - * BD Address of remote - * Pointer to buffer of type BT_HDR - * - * Return value tL2CAP_DW_RESULT::SUCCESS, if data accepted - * tL2CAP_DW_RESULT::FAILED, if error - * - ******************************************************************************/ -uint16_t L2CA_SendFixedChnlData(uint16_t fixed_cid, const RawAddress& rem_bda, BT_HDR* p_buf); - -/******************************************************************************* - * - * Function L2CA_RemoveFixedChnl - * - * Description Remove a fixed channel to a remote device. - * - * Parameters: Fixed CID - * BD Address of remote - * Idle timeout to use (or 0xFFFF if don't care) - * - * Return value: true if channel removed - * - ******************************************************************************/ -bool L2CA_RemoveFixedChnl(uint16_t fixed_cid, const RawAddress& rem_bda); - -uint16_t L2CA_GetLeHandle(const RawAddress& rem_bda); -hci_role_t L2CA_GetBleConnRole(const RawAddress& bd_addr); - -void L2CA_LeConnectionUpdate(const RawAddress& rem_bda, uint16_t min_int, uint16_t max_int, - uint16_t latency, uint16_t timeout, uint16_t min_ce_len, - uint16_t max_ce_len); - -/******************************************************************************* - * - * Function L2CA_SetLeGattTimeout - * - * Description Higher layers call this function to set the idle timeout for - * a fixed channel. The "idle timeout" is the amount of time - * that a connection can remain up with no L2CAP channels on - * it. A timeout of zero means that the connection will be torn - * down immediately when the last channel is removed. - * A timeout of 0xFFFF means no timeout. Values are in seconds. - * A bd_addr is the remote BD address. If bd_addr = - * RawAddress::kAny, then the idle timeouts for all active - * l2cap links will be changed. - * - * Returns true if command succeeded, false if failed - * - ******************************************************************************/ -bool L2CA_SetLeGattTimeout(const RawAddress& rem_bda, uint16_t idle_tout); - -bool L2CA_MarkLeLinkAsActive(const RawAddress& rem_bda); - -bool L2CA_UpdateBleConnParams(const RawAddress& rem_bda, uint16_t min_int, uint16_t max_int, - uint16_t latency, uint16_t timeout, uint16_t min_ce_len, - uint16_t max_ce_len); -/* When called with lock=true, LE connection parameters will be locked on - * fastest value, and we won't accept request to change it from remote. When - * called with lock=false, parameters are relaxed. - */ -void L2CA_LockBleConnParamsForServiceDiscovery(const RawAddress& rem_bda, bool lock); - -/* When called with lock=true, LE connection parameters will be locked on - * fastest value, and we won't accept request to change it from remote. When - * called with lock=false, parameters are relaxed. - */ -void L2CA_LockBleConnParamsForProfileConnection(const RawAddress& rem_bda, bool lock); - -/******************************************************************************* - * - * Function L2CA_GetBleConnRole - * - * Description This function returns the connection role. - * - * Returns link role. - * - ******************************************************************************/ -hci_role_t L2CA_GetBleConnRole(const RawAddress& bd_addr); - -/** - * Check whether an ACL or LE link to the remote device is established - */ -bool L2CA_IsLinkEstablished(const RawAddress& bd_addr, tBT_TRANSPORT transport); - -void L2CA_ConnectForSecurity(const RawAddress& bd_addr); - -// Set bonding state to acquire/release link refcount -void L2CA_SetBondingState(const RawAddress& p_bd_addr, bool is_bonding); - -void L2CA_SwitchRoleToCentral(const RawAddress& addr); - -bool L2CA_ReadRemoteVersion(const RawAddress& addr, uint8_t* lmp_version, uint16_t* manufacturer, - uint16_t* lmp_sub_version); - -uint8_t* L2CA_ReadRemoteFeatures(const RawAddress& addr); - -void L2CA_DisconnectLink(const RawAddress& remote); - -uint16_t L2CA_GetNumLinks(); - -bool L2CA_IsLeLink(uint16_t acl_handle); - -void L2CA_ReadConnectionAddr(const RawAddress& pseudo_addr, RawAddress& conn_addr, - tBLE_ADDR_TYPE* p_addr_type); - -bool L2CA_ReadRemoteConnectionAddr(const RawAddress& pseudo_addr, RawAddress& conn_addr, - tBLE_ADDR_TYPE* p_addr_type); - -} // namespace shim -} // namespace bluetooth diff --git a/system/main/shim/le_scanning_manager.cc b/system/main/shim/le_scanning_manager.cc index 605d62a794..30ab1135a6 100644 --- a/system/main/shim/le_scanning_manager.cc +++ b/system/main/shim/le_scanning_manager.cc @@ -35,11 +35,11 @@ #include "main/shim/helpers.h" #include "main/shim/le_scanning_manager.h" #include "main/shim/shim.h" -#include "os/log.h" #include "stack/btm/btm_int_types.h" #include "stack/include/advertise_data_parser.h" #include "stack/include/bt_dev_class.h" #include "stack/include/btm_log_history.h" +#include "stack/include/btm_status.h" #include "storage/device.h" #include "storage/le_device.h" #include "storage/storage_module.h" @@ -217,7 +217,7 @@ void BleScannerInterfaceImpl::ScanFilterParamSetup( bluetooth::shim::GetScanning()->ScanFilterParameterSetup(apcf_action, filter_index, advertising_filter_parameter); // TODO refactor callback mechanism - do_in_jni_thread(base::BindOnce(cb, 0, 0, btm_status_value(BTM_SUCCESS))); + do_in_jni_thread(base::BindOnce(cb, 0, 0, btm_status_value(tBTM_STATUS::BTM_SUCCESS))); } /** Configure a scan filter condition */ @@ -234,7 +234,7 @@ void BleScannerInterfaceImpl::ScanFilterAdd(int filter_index, std::vector<ApcfCo new_filters.push_back(command); } bluetooth::shim::GetScanning()->ScanFilterAdd(filter_index, new_filters); - do_in_jni_thread(base::BindOnce(cb, 0, 0, 0, btm_status_value(BTM_SUCCESS))); + do_in_jni_thread(base::BindOnce(cb, 0, 0, 0, btm_status_value(tBTM_STATUS::BTM_SUCCESS))); } /** Clear all scan filter conditions for specific filter index*/ @@ -250,7 +250,7 @@ void BleScannerInterfaceImpl::ScanFilterEnable(bool enable, EnableCallback cb) { bluetooth::shim::GetScanning()->ScanFilterEnable(enable); uint8_t action = enable ? 1 : 0; - do_in_jni_thread(base::BindOnce(cb, action, btm_status_value(BTM_SUCCESS))); + do_in_jni_thread(base::BindOnce(cb, action, btm_status_value(tBTM_STATUS::BTM_SUCCESS))); } #if TARGET_FLOSS @@ -343,7 +343,7 @@ void BleScannerInterfaceImpl::BatchscanConfigStorage(int client_if, int batch_sc log::info("in shim layer"); bluetooth::shim::GetScanning()->BatchScanConifgStorage(batch_scan_full_max, batch_scan_trunc_max, batch_scan_notify_threshold, client_if); - do_in_jni_thread(base::BindOnce(cb, btm_status_value(BTM_SUCCESS))); + do_in_jni_thread(base::BindOnce(cb, btm_status_value(tBTM_STATUS::BTM_SUCCESS))); } /* Enable batchscan */ @@ -354,14 +354,14 @@ void BleScannerInterfaceImpl::BatchscanEnable(int scan_mode, int scan_interval, auto batch_scan_discard_rule = static_cast<bluetooth::hci::BatchScanDiscardRule>(discard_rule); bluetooth::shim::GetScanning()->BatchScanEnable(batch_scan_mode, scan_window, scan_interval, batch_scan_discard_rule); - do_in_jni_thread(base::BindOnce(cb, btm_status_value(BTM_SUCCESS))); + do_in_jni_thread(base::BindOnce(cb, btm_status_value(tBTM_STATUS::BTM_SUCCESS))); } /* Disable batchscan */ void BleScannerInterfaceImpl::BatchscanDisable(Callback cb) { log::info("in shim layer"); bluetooth::shim::GetScanning()->BatchScanDisable(); - do_in_jni_thread(base::BindOnce(cb, btm_status_value(BTM_SUCCESS))); + do_in_jni_thread(base::BindOnce(cb, btm_status_value(tBTM_STATUS::BTM_SUCCESS))); } /* Read out batchscan reports */ diff --git a/system/main/shim/shim.cc b/system/main/shim/shim.cc index ce75897db4..51f15e5858 100644 --- a/system/main/shim/shim.cc +++ b/system/main/shim/shim.cc @@ -66,7 +66,3 @@ bool bluetooth::shim::is_gd_stack_started_up() { bool bluetooth::shim::is_gd_dumpsys_module_started() { return bluetooth::shim::Stack::GetInstance()->IsDumpsysModuleStarted(); } - -bool bluetooth::shim::is_classic_discovery_only_enabled() { - return bluetooth::common::init_flags::classic_discovery_only_is_enabled(); -} diff --git a/system/main/shim/shim.h b/system/main/shim/shim.h index d297b91b07..1b728ab6ae 100644 --- a/system/main/shim/shim.h +++ b/system/main/shim/shim.h @@ -47,12 +47,5 @@ bool is_gd_stack_started_up(); */ bool is_gd_dumpsys_module_started(); -/** - * Checks whether discovery should be classic only (vs also triggering BLE). - * - * @return true if discovery should be limited to classic. - */ -bool is_classic_discovery_only_enabled(); - } // namespace shim } // namespace bluetooth diff --git a/system/osi/src/stack_power_telemetry.cc b/system/osi/src/stack_power_telemetry.cc index 06695776df..7f4d513fcc 100644 --- a/system/osi/src/stack_power_telemetry.cc +++ b/system/osi/src/stack_power_telemetry.cc @@ -386,7 +386,7 @@ void power_telemetry::PowerTelemetry::LogTxPower(void* res) { tBTM_TX_POWER_RESULT* result = (tBTM_TX_POWER_RESULT*)res; LogDataContainer& ldc = pimpl_->GetCurrentLogDataContainer(); - if (result->status != BTM_SUCCESS) { + if (result->status != tBTM_STATUS::BTM_SUCCESS) { return; } diff --git a/system/osi/test/stack_power_telemetry_test.cc b/system/osi/test/stack_power_telemetry_test.cc index cc48518eaa..ccaaf028e9 100644 --- a/system/osi/test/stack_power_telemetry_test.cc +++ b/system/osi/test/stack_power_telemetry_test.cc @@ -3,6 +3,7 @@ #include <gtest/gtest.h> #include "osi/include/stack_power_telemetry.h" +#include "stack/include/btm_status.h" #include "types/raw_address.h" class PowerTelemetryTest : public ::testing::Test { @@ -97,7 +98,7 @@ TEST_F(PowerTelemetryTest, test_LogTxPower) { dummy_res.rem_bda = bdaddr; // Failed Case. Shouldn't crash if no init data - dummy_res.status = BTM_SUCCESS; + dummy_res.status = tBTM_STATUS::BTM_SUCCESS; void* p = &dummy_res; power_telemetry::GetInstance().LogTxPower(p); @@ -269,7 +270,7 @@ TEST_F(PowerTelemetryTest, test_feature_flag) { LogDataContainer& ldc = power_telemetry::GetInstance().pimpl_->GetCurrentLogDataContainer(); tBTM_TX_POWER_RESULT dummy_res; dummy_res.rem_bda = bdaddr; - dummy_res.status = BTM_SUCCESS; + dummy_res.status = tBTM_STATUS::BTM_SUCCESS; void* p = &dummy_res; power_telemetry::GetInstance().LogLinkDetails(handle, bdaddr, isConnected, true); diff --git a/system/packet/avrcp/register_notification_packet.cc b/system/packet/avrcp/register_notification_packet.cc index 2adeae761e..dfe62f386b 100644 --- a/system/packet/avrcp/register_notification_packet.cc +++ b/system/packet/avrcp/register_notification_packet.cc @@ -44,8 +44,11 @@ bool RegisterNotificationResponse::IsValid() const { if (size() < kMinSize()) { return false; } - if (GetCType() != CType::INTERIM && GetCType() != CType::CHANGED && - GetCType() != CType::REJECTED) { + // Rejected type packets is not followed by event, but by error code instead. + if (GetCType() == CType::REJECTED) { + return true; + } + if (GetCType() != CType::INTERIM && GetCType() != CType::CHANGED) { return false; } diff --git a/system/pdl/hci/hci_packets.pdl b/system/pdl/hci/hci_packets.pdl index d641d1d96d..cbda6ff235 100644 --- a/system/pdl/hci/hci_packets.pdl +++ b/system/pdl/hci/hci_packets.pdl @@ -5210,6 +5210,15 @@ struct CsPreferredPeerAntenna { _reserved_ : 4, } +enum CsSnrControl : 8 { + ADJUST_18_DB = 0x00, + ADJUST_21_DB = 0x01, + ADJUST_24_DB = 0x02, + ADJUST_27_DB = 0x03, + ADJUST_30_DB = 0x04, + NOT_APPLIED = 0xFF, +} + packet LeCsSetProcedureParameters : DistanceMeasurementCommand (op_code = LE_CS_SET_PROCEDURE_PARAMETERS) { connection_handle: 12, _reserved_ : 4, @@ -5225,6 +5234,8 @@ packet LeCsSetProcedureParameters : DistanceMeasurementCommand (op_code = LE_CS phy : CsPhy, tx_pwr_delta : 8, preferred_peer_antenna : CsPreferredPeerAntenna, + snr_control_initiator: CsSnrControl, + snr_control_reflector: CsSnrControl, } packet LeCsSetProcedureParametersComplete : CommandComplete (command_op_code = LE_CS_SET_PROCEDURE_PARAMETERS) { @@ -5255,15 +5266,19 @@ packet LeCsTest : DistanceMeasurementCommand (op_code = LE_CS_TEST) { cs_sync_antenna_selection : 8, cs_subevent_length : 24, cs_subevent_interval : 16, + max_num_subevents : 8, transmit_power_level : 8, t_ip1_time : 8, t_ip2_time : 8, t_fcs_time : 8, t_pm_time : 8, t_sw_time : 8, - tone_antenna_config : 8, - companion_signal_enable : 8, + tone_antenna_config_selection : 8, + _reserved_ : 8, + snr_control_initiator: CsSnrControl, + snr_control_reflector: CsSnrControl, drbg_nonce : 16, + channel_map_repetition : 8, override_config : 8, override_parameters_length : 8, override_parameters_data : 8[], diff --git a/system/profile/avrcp/connection_handler.cc b/system/profile/avrcp/connection_handler.cc index 334c843ca6..1c443ca527 100644 --- a/system/profile/avrcp/connection_handler.cc +++ b/system/profile/avrcp/connection_handler.cc @@ -137,7 +137,7 @@ bool ConnectionHandler::ConnectDevice(const RawAddress& bdaddr) { auto connection_lambda = [](ConnectionHandler* instance_, const RawAddress& bdaddr, tSDP_STATUS status, uint16_t version, uint16_t features) { log::info("SDP Completed features=0x{:x}", features); - if (status != SDP_SUCCESS || !(features & BTA_AV_FEAT_RCCT)) { + if (status != tSDP_STATUS::SDP_SUCCESS || !(features & BTA_AV_FEAT_RCCT)) { log::error( "Failed to do SDP: status=0x{:x} features=0x{:x} supports " "controller: {}", @@ -404,7 +404,7 @@ void ConnectionHandler::AcceptorControlCb(uint8_t handle, uint8_t event, uint16_ // as this one which will be closed when the device is disconnected. AvrcpConnect(false, RawAddress::kAny); - if (com::android::bluetooth::flags::avrcp_connect_a2dp_delayed()) { + if (com::android::bluetooth::flags::avrcp_connect_a2dp_with_delay()) { // Check peer audio role: src or sink and connect A2DP after 3 seconds SdpLookupAudioRole(handle); } @@ -477,11 +477,11 @@ void ConnectionHandler::SdpCb(RawAddress bdaddr, SdpCallback cb, tSDP_DISCOVERY_ bool retry, tSDP_STATUS status) { log::verbose("SDP lookup callback received"); - if (status == SDP_CONN_FAILED && !retry) { + if (status == tSDP_STATUS::SDP_CONN_FAILED && !retry) { log::warn("SDP Failure retry again"); SdpLookup(bdaddr, cb, true); return; - } else if (status != AVRC_SUCCESS) { + } else if (status != tSDP_STATUS::SDP_SUCCESS) { log::error("SDP Failure: status = {}", (unsigned int)status); cb.Run(status, 0, 0); osi_free(disc_db); diff --git a/system/profile/avrcp/device.cc b/system/profile/avrcp/device.cc index d34f6abbb0..4466485b4d 100644 --- a/system/profile/avrcp/device.cc +++ b/system/profile/avrcp/device.cc @@ -135,12 +135,15 @@ void Device::VendorPacketHandler(uint8_t label, std::shared_ptr<VendorPacket> pk return; } - if (register_notification->GetEvent() != Event::VOLUME_CHANGED) { + // The rejected packet doesn't have an event field, so we just have to assume it is indeed + // for the volume changed event since that's the only one we possibly register. + if (pkt->GetCType() == CType::REJECTED || + register_notification->GetEvent() == Event::VOLUME_CHANGED) { + HandleVolumeChanged(label, register_notification); + } else { log::warn("{}: Unhandled register notification received: {}", address_, register_notification->GetEvent()); - return; } - HandleVolumeChanged(label, register_notification); break; } case CommandPdu::SET_ABSOLUTE_VOLUME: @@ -189,10 +192,6 @@ void Device::VendorPacketHandler(uint8_t label, std::shared_ptr<VendorPacket> pk } break; case CommandPdu::SET_ADDRESSED_PLAYER: { - // TODO (apanicke): Implement set addressed player. We don't need - // this currently since the current implementation only has one - // player and the player will never change, but we need it for a - // more complete implementation. auto set_addressed_player_request = Packet::Specialize<SetAddressedPlayerRequest>(pkt); if (!set_addressed_player_request->IsValid()) { @@ -202,9 +201,10 @@ void Device::VendorPacketHandler(uint8_t label, std::shared_ptr<VendorPacket> pk return; } - media_interface_->GetMediaPlayerList(base::Bind(&Device::HandleSetAddressedPlayer, - weak_ptr_factory_.GetWeakPtr(), label, - set_addressed_player_request)); + media_interface_->SetAddressedPlayer( + set_addressed_player_request->GetPlayerId(), + base::Bind(&Device::HandleSetAddressedPlayer, weak_ptr_factory_.GetWeakPtr(), label, + set_addressed_player_request)); } break; case CommandPdu::LIST_PLAYER_APPLICATION_SETTING_ATTRIBUTES: { @@ -456,7 +456,7 @@ void Device::HandleNotification(uint8_t label, } break; case Event::ADDRESSED_PLAYER_CHANGED: { - media_interface_->GetMediaPlayerList(base::Bind(&Device::AddressedPlayerNotificationResponse, + media_interface_->GetAddressedPlayer(base::Bind(&Device::AddressedPlayerNotificationResponse, weak_ptr_factory_.GetWeakPtr(), label, true)); } break; @@ -703,10 +703,8 @@ void Device::PlaybackPosNotificationResponse(uint8_t label, bool interim, PlaySt } } -// TODO (apanicke): Finish implementing when we add support for more than one -// player -void Device::AddressedPlayerNotificationResponse(uint8_t label, bool interim, uint16_t curr_player, - std::vector<MediaPlayerInfo> /* unused */) { +void Device::AddressedPlayerNotificationResponse(uint8_t label, bool interim, + uint16_t curr_player) { log::verbose("curr_player_id={}", (unsigned int)curr_player); if (interim) { @@ -902,7 +900,7 @@ void Device::HandlePlayItem(uint8_t label, std::shared_ptr<PlayItemRequest> pkt) } void Device::HandleSetAddressedPlayer(uint8_t label, std::shared_ptr<SetAddressedPlayerRequest> pkt, - uint16_t curr_player, std::vector<MediaPlayerInfo> players) { + uint16_t curr_player) { log::verbose("PlayerId={}", pkt->GetPlayerId()); if (curr_player != pkt->GetPlayerId()) { @@ -1698,7 +1696,7 @@ void Device::HandleAddressedPlayerUpdate() { log::warn("{}: Device is not registered for addressed player updates", address_); return; } - media_interface_->GetMediaPlayerList(base::Bind(&Device::AddressedPlayerNotificationResponse, + media_interface_->GetAddressedPlayer(base::Bind(&Device::AddressedPlayerNotificationResponse, weak_ptr_factory_.GetWeakPtr(), addr_player_changed_.second, false)); } diff --git a/system/profile/avrcp/device.h b/system/profile/avrcp/device.h index 1f96503172..437c85a94f 100644 --- a/system/profile/avrcp/device.h +++ b/system/profile/avrcp/device.h @@ -207,8 +207,7 @@ public: virtual void HandleAddressedPlayerUpdate(); virtual void RejectNotification(); virtual void AddressedPlayerNotificationResponse(uint8_t label, bool interim, - uint16_t curr_player, - std::vector<MediaPlayerInfo> /* unused */); + uint16_t curr_player); // GET FOLDER ITEMS virtual void HandleGetFolderItems(uint8_t label, std::shared_ptr<GetFolderItemsRequest> request); @@ -257,7 +256,7 @@ public: // SET ADDRESSED PLAYER virtual void HandleSetAddressedPlayer(uint8_t label, std::shared_ptr<SetAddressedPlayerRequest> request, - uint16_t curr_player, std::vector<MediaPlayerInfo> players); + uint16_t curr_player); // LIST PLAYER APPLICATION SETTING ATTRIBUTES virtual void ListPlayerApplicationSettingAttributesResponse( diff --git a/system/profile/avrcp/tests/avrcp_connection_handler_test.cc b/system/profile/avrcp/tests/avrcp_connection_handler_test.cc index 3fbb10ca41..ac8217a267 100644 --- a/system/profile/avrcp/tests/avrcp_connection_handler_test.cc +++ b/system/profile/avrcp/tests/avrcp_connection_handler_test.cc @@ -205,7 +205,7 @@ TEST_F(AvrcpConnectionHandlerTest, remoteDeviceConnectionTest) { // device connects. EXPECT_CALL(mock_avrcp_, OpenBrowse(1, AVCT_ACP)).Times(1); - if (com::android::bluetooth::flags::avrcp_connect_a2dp_delayed()) { + if (com::android::bluetooth::flags::avrcp_connect_a2dp_with_delay()) { // Set an expectation that SDP for audio will be performed EXPECT_CALL(mock_a2dp_, find_audio_sink_service(_, _)).Times(1); } @@ -214,7 +214,7 @@ TEST_F(AvrcpConnectionHandlerTest, remoteDeviceConnectionTest) { conn_cb.ctrl_cback.Run(1, AVRC_OPEN_IND_EVT, 0, &RawAddress::kAny); // Run the SDP callback with status success - sdp_cb.Run(SDP_SUCCESS); + sdp_cb.Run(tSDP_STATUS::SDP_SUCCESS); // Check that a device was created ASSERT_TRUE(current_device_ != nullptr); @@ -245,7 +245,7 @@ TEST_F(AvrcpConnectionHandlerTest, noAbsoluteVolumeTest) { tAVRC_FIND_CBACK sdp_cb; SetUpSdp(&sdp_cb, false, false); - if (com::android::bluetooth::flags::avrcp_connect_a2dp_delayed()) { + if (com::android::bluetooth::flags::avrcp_connect_a2dp_with_delay()) { // Set an expectation that SDP for audio will be performed EXPECT_CALL(mock_a2dp_, find_audio_sink_service(_, _)).Times(1); } @@ -256,7 +256,7 @@ TEST_F(AvrcpConnectionHandlerTest, noAbsoluteVolumeTest) { conn_cb.ctrl_cback.Run(1, AVRC_OPEN_IND_EVT, 0, &RawAddress::kAny); // Run the SDP callback with status success - sdp_cb.Run(SDP_SUCCESS); + sdp_cb.Run(tSDP_STATUS::SDP_SUCCESS); // Check that a device was created ASSERT_TRUE(current_device_ != nullptr); @@ -289,7 +289,7 @@ TEST_F(AvrcpConnectionHandlerTest, absoluteVolumeTest) { tAVRC_FIND_CBACK sdp_cb; SetUpSdp(&sdp_cb, false, true); - if (com::android::bluetooth::flags::avrcp_connect_a2dp_delayed()) { + if (com::android::bluetooth::flags::avrcp_connect_a2dp_with_delay()) { // Set an expectation that SDP for audio will be performed EXPECT_CALL(mock_a2dp_, find_audio_sink_service(_, _)).Times(1); } @@ -298,7 +298,7 @@ TEST_F(AvrcpConnectionHandlerTest, absoluteVolumeTest) { conn_cb.ctrl_cback.Run(1, AVRC_OPEN_IND_EVT, 0, &RawAddress::kAny); // Run the SDP callback with status success - sdp_cb.Run(SDP_SUCCESS); + sdp_cb.Run(tSDP_STATUS::SDP_SUCCESS); // Check that a device was created ASSERT_TRUE(current_device_ != nullptr); @@ -321,7 +321,7 @@ TEST_F(AvrcpConnectionHandlerTest, disconnectTest) { &mock_volume_)); connection_handler_ = ConnectionHandler::Get(); - if (com::android::bluetooth::flags::avrcp_connect_a2dp_delayed()) { + if (com::android::bluetooth::flags::avrcp_connect_a2dp_with_delay()) { // Set an expectation that SDP for audio will be performed EXPECT_CALL(mock_a2dp_, find_audio_sink_service(_, _)).Times(1); } @@ -381,7 +381,7 @@ TEST_F(AvrcpConnectionHandlerTest, multipleRemoteDeviceConnectionTest) { current_device_.reset(); // Run the SDP callback with status success - sdp_cb.Run(SDP_SUCCESS); + sdp_cb.Run(tSDP_STATUS::SDP_SUCCESS); // Set an Expectations that SDP will be performed again SetUpSdp(&sdp_cb, false, false); @@ -398,7 +398,7 @@ TEST_F(AvrcpConnectionHandlerTest, multipleRemoteDeviceConnectionTest) { ASSERT_TRUE(current_device_ != nullptr); // Run the SDP callback with status success - sdp_cb.Run(SDP_SUCCESS); + sdp_cb.Run(tSDP_STATUS::SDP_SUCCESS); connection_handler_ = nullptr; ConnectionHandler::CleanUp(); @@ -452,7 +452,7 @@ TEST_F(AvrcpConnectionHandlerTest, connectToRemoteDeviceTest) { .WillOnce(DoAll(SetArgPointee<0>(1), SaveArgPointee<1>(&conn_cb), Return(0))); // Complete SDP - sdp_cb.Run(SDP_SUCCESS); + sdp_cb.Run(tSDP_STATUS::SDP_SUCCESS); // Check that the callback was sent with us as the initiator ASSERT_EQ(conn_cb.conn, 0); @@ -494,7 +494,7 @@ TEST_F(AvrcpConnectionHandlerTest, connectToBrowsableRemoteDeviceTest) { .WillOnce(DoAll(SetArgPointee<0>(1), SaveArgPointee<1>(&conn_cb), Return(0))); // Complete SDP - sdp_cb.Run(SDP_SUCCESS); + sdp_cb.Run(tSDP_STATUS::SDP_SUCCESS); // Check that the callback was sent with us as the initiator ASSERT_EQ(conn_cb.conn, 0); @@ -544,7 +544,7 @@ TEST_F(AvrcpConnectionHandlerTest, disconnectWhileDoingSdpTest) { conn_cb.ctrl_cback.Run(1, AVRC_CLOSE_IND_EVT, 0, &RawAddress::kAny); // Signal that SDP has completed - sdp_cb.Run(SDP_SUCCESS); + sdp_cb.Run(tSDP_STATUS::SDP_SUCCESS); connection_handler_ = nullptr; ConnectionHandler::CleanUp(); @@ -593,7 +593,7 @@ TEST_F(AvrcpConnectionHandlerTest, connectionCollisionTest) { EXPECT_CALL(mock_avrcp_, Close(_)); // Run the SDP callback with status success - sdp_cb.Run(SDP_SUCCESS); + sdp_cb.Run(tSDP_STATUS::SDP_SUCCESS); connection_handler_ = nullptr; ConnectionHandler::CleanUp(); diff --git a/system/profile/avrcp/tests/avrcp_device_fuzz/avrcp_device_fuzz.cc b/system/profile/avrcp/tests/avrcp_device_fuzz/avrcp_device_fuzz.cc index 1ec4719ab2..e7c02fd758 100644 --- a/system/profile/avrcp/tests/avrcp_device_fuzz/avrcp_device_fuzz.cc +++ b/system/profile/avrcp/tests/avrcp_device_fuzz/avrcp_device_fuzz.cc @@ -135,6 +135,11 @@ public: } folder_cb.Run(list); } + using GetAddressedPlayerCallback = base::Callback<void(uint16_t)>; + void GetAddressedPlayer(GetAddressedPlayerCallback addressed_player) { + uint16_t currentPlayer = mFdp->ConsumeIntegral<uint16_t>(); + addressed_player.Run(currentPlayer); + } using SetBrowsedPlayerCallback = base::Callback<void(bool success, std::string root_id, uint32_t num_items)>; void SetBrowsedPlayer(uint16_t player_id, SetBrowsedPlayerCallback browse_cb) { @@ -143,6 +148,10 @@ public: browse_cb.Run(player_id, rootId, numItems); return; } + using SetAddressedPlayerCallback = base::Callback<void(uint16_t)>; + void SetAddressedPlayer(uint16_t player_id, SetAddressedPlayerCallback new_player) { + new_player.Run(player_id); + } void PlayItem(uint16_t /* player_id */, bool /* now_playing */, std::string /* media_id */) { return; } diff --git a/system/profile/avrcp/tests/avrcp_device_test.cc b/system/profile/avrcp/tests/avrcp_device_test.cc index 997096ca59..135de5017b 100644 --- a/system/profile/avrcp/tests/avrcp_device_test.cc +++ b/system/profile/avrcp/tests/avrcp_device_test.cc @@ -500,10 +500,10 @@ TEST_F(AvrcpDeviceTest, addressPlayerChangedBeforeInterim) { test_device->RegisterInterfaces(&interface, &a2dp_interface, nullptr, nullptr); - MediaInterface::MediaListCallback interim_cb; - MediaInterface::MediaListCallback changed_cb; + MediaInterface::GetAddressedPlayerCallback interim_cb; + MediaInterface::GetAddressedPlayerCallback changed_cb; - EXPECT_CALL(interface, GetMediaPlayerList(_)) + EXPECT_CALL(interface, GetAddressedPlayer(_)) .Times(2) .WillOnce(SaveArg<0>(&interim_cb)) .WillOnce(SaveArg<0>(&changed_cb)); @@ -536,11 +536,11 @@ TEST_F(AvrcpDeviceTest, addressPlayerChangedBeforeInterim) { // Send the data needed for the interim response MediaPlayerInfo info = {0, "Test Player", true}; std::vector<MediaPlayerInfo> list = {info}; - interim_cb.Run(0, list); + interim_cb.Run(0); // Send addressed player update, should succeed test_device->HandleAddressedPlayerUpdate(); - changed_cb.Run(0, list); + changed_cb.Run(0); } TEST_F(AvrcpDeviceTest, nowPlayingTest) { @@ -1102,7 +1102,7 @@ TEST_F(AvrcpDeviceTest, setAddressedPlayerTest) { MediaPlayerInfo info = {0, "Test Player", true}; std::vector<MediaPlayerInfo> list = {info}; - EXPECT_CALL(interface, GetMediaPlayerList(_)).WillRepeatedly(InvokeCb<0>(0, list)); + EXPECT_CALL(interface, SetAddressedPlayer(_, _)).WillRepeatedly(InvokeCb<1>(0)); auto set_addr_player_rej_rsp = RejectBuilder::MakeBuilder(CommandPdu::SET_ADDRESSED_PLAYER, Status::INVALID_PLAYER_ID); diff --git a/system/profile/avrcp/tests/avrcp_test_helper.h b/system/profile/avrcp/tests/avrcp_test_helper.h index 91d076e99a..7a2f63ab2a 100644 --- a/system/profile/avrcp/tests/avrcp_test_helper.h +++ b/system/profile/avrcp/tests/avrcp_test_helper.h @@ -43,8 +43,10 @@ public: MOCK_METHOD1(GetPlayStatus, void(MediaInterface::PlayStatusCallback)); MOCK_METHOD1(GetNowPlayingList, void(MediaInterface::NowPlayingCallback)); MOCK_METHOD1(GetMediaPlayerList, void(MediaInterface::MediaListCallback)); + MOCK_METHOD1(GetAddressedPlayer, void(MediaInterface::GetAddressedPlayerCallback)); MOCK_METHOD3(GetFolderItems, void(uint16_t, std::string, MediaInterface::FolderItemsCallback)); MOCK_METHOD2(SetBrowsedPlayer, void(uint16_t, MediaInterface::SetBrowsedPlayerCallback)); + MOCK_METHOD2(SetAddressedPlayer, void(uint16_t, MediaInterface::SetAddressedPlayerCallback)); MOCK_METHOD3(PlayItem, void(uint16_t, bool, std::string)); MOCK_METHOD1(SetActiveDevice, void(const RawAddress&)); MOCK_METHOD1(RegisterUpdateCallback, void(MediaCallbacks*)); diff --git a/system/rust/Android.bp b/system/rust/Android.bp index dfb0521323..95f50cf9cf 100644 --- a/system/rust/Android.bp +++ b/system/rust/Android.bp @@ -36,8 +36,10 @@ rust_defaults { "libbitflags", "libbt_common", "libbt_shim", + "libbytes", "libcxx", "liblog_rust", + "libpdl_runtime", "libscopeguard", ], whole_static_libs: [ @@ -193,7 +195,7 @@ gensrcs { genrule { name: "bluetooth_core_rust_packets", - defaults: ["pdl_rust_noalloc_generator_defaults"], + defaults: ["pdl_rust_generator_defaults"], srcs: ["src/packets.pdl"], out: ["_packets.rs"], } diff --git a/system/rust/Cargo.toml b/system/rust/Cargo.toml index 21dfee2f20..a9ab090891 100644 --- a/system/rust/Cargo.toml +++ b/system/rust/Cargo.toml @@ -31,13 +31,14 @@ android_logger = "*" jni = "*" paste = "*" async-trait = "*" -pdl-runtime = "0.3.0" +pdl-runtime = "0.3.1" tokio-test = "0.4.2" tokio = { version = "1.23.0", features = ["macros"] } scopeguard = "1.1.0" +bytes = "1.5.0" [build-dependencies] -pdl-compiler = "0.3.0" +pdl-compiler = "0.3.1" [lib] crate-type = ["rlib"] diff --git a/system/rust/build.rs b/system/rust/build.rs index c296fb8e0b..bae31cdcaa 100644 --- a/system/rust/build.rs +++ b/system/rust/build.rs @@ -2,7 +2,6 @@ //! //! Run `cargo install --path .` in `external/rust/crates/pdl-compiler` to ensure `pdlc` //! is in your path. -use pdl_compiler; use std::{env, fs::File, io::Write, path::Path}; fn main() { @@ -13,9 +12,8 @@ fn main() { let mut sources = pdl_compiler::ast::SourceDatabase::new(); let file = pdl_compiler::parser::parse_file(&mut sources, "src/packets.pdl") .expect("failed to parse input pdl file"); - let schema = pdl_compiler::backends::intermediate::generate(&file).unwrap(); - let generated = pdl_compiler::backends::rust_no_allocation::generate(&file, &schema).unwrap(); + let generated = pdl_compiler::backends::rust::generate(&sources, &file, &[]); dest_file.write_all(generated.as_bytes()).unwrap(); println!("cargo:rerun-if-changed=build.rs"); diff --git a/system/rust/src/core/ffi/module.cc b/system/rust/src/core/ffi/module.cc index cfee5cf84e..f43e19a1f8 100644 --- a/system/rust/src/core/ffi/module.cc +++ b/system/rust/src/core/ffi/module.cc @@ -53,7 +53,8 @@ namespace { future_t* Start() { auto fut = future_new(); - if (bt_gatt_callbacks == nullptr) { + auto callbacks = bt_gatt_callbacks; + if (callbacks == nullptr) { // We can't crash here since some adapter tests mis-use the stack // startup/cleanup logic and start the stack without GATT, but don't fully // mock out the native layer. @@ -64,7 +65,7 @@ future_t* Start() { return fut; } bluetooth::rust_shim::start( - std::make_unique<bluetooth::gatt::GattServerCallbacks>(*bt_gatt_callbacks->server), + std::make_unique<bluetooth::gatt::GattServerCallbacks>(*callbacks->server), std::make_unique<bluetooth::connection::LeAclManagerShim>(), *fut); return fut; diff --git a/system/rust/src/core/uuid.rs b/system/rust/src/core/uuid.rs index d519854063..fe1756c7fe 100644 --- a/system/rust/src/core/uuid.rs +++ b/system/rust/src/core/uuid.rs @@ -1,8 +1,6 @@ //! A UUID (See Core Spec 5.3 Vol 1E 2.9.1. Basic Types) -use crate::packets::{ - ParseError, Uuid128Builder, Uuid128View, Uuid16Builder, Uuid16View, UuidBuilder, UuidView, -}; +use crate::packets::att; /// A UUID (See Core Spec 5.3 Vol 1E 2.9.1. Basic Types) /// @@ -33,83 +31,74 @@ impl Uuid { } } -impl TryFrom<UuidView<'_>> for Uuid { - type Error = ParseError; +impl TryFrom<att::Uuid> for Uuid { + type Error = att::Uuid; - fn try_from(value: UuidView<'_>) -> Result<Self, ParseError> { - let bytes = value.get_data_iter().collect::<Vec<_>>(); + fn try_from(value: att::Uuid) -> Result<Self, att::Uuid> { + let bytes = value.data.as_slice(); Ok(match bytes.len() { 2 => Self::new(u16::from_le_bytes([bytes[0], bytes[1]]) as u32), 4 => Self::new(u32::from_le_bytes([bytes[0], bytes[1], bytes[2], bytes[3]])), // TODO(aryarahul) - should we handle >16 byte Uuids and drop extra bytes? - _ => Self::new_from_le_bytes( - bytes.try_into().map_err(|_| ParseError::OutOfBoundsAccess)?, - ), + _ => Self::new_from_le_bytes(bytes.try_into().map_err(|_| value)?), }) } } -impl From<Uuid16View<'_>> for Uuid { - fn from(uuid: Uuid16View) -> Self { - Self::new(uuid.get_data() as u32) +impl From<att::Uuid16> for Uuid { + fn from(uuid: att::Uuid16) -> Self { + Self::new(uuid.data as u32) } } -impl From<Uuid128View<'_>> for Uuid { - fn from(uuid: Uuid128View) -> Self { - Self::new_from_le_bytes( - uuid.get_data_iter() - .collect::<Vec<_>>() - .try_into() - .expect("Uuid128View MUST have exactly 16 bytes"), - ) +impl From<att::Uuid128> for Uuid { + fn from(uuid: att::Uuid128) -> Self { + Self::new_from_le_bytes(uuid.data) } } -impl From<Uuid> for UuidBuilder { +impl From<Uuid> for att::Uuid { fn from(value: Uuid) -> Self { // TODO(aryarahul): compress to UUID-16 if possible - UuidBuilder { data: value.le_bytes().into_iter().collect() } + att::Uuid { data: value.le_bytes().to_vec() } } } -impl TryFrom<Uuid> for Uuid16Builder { +impl TryFrom<Uuid> for att::Uuid16 { type Error = Uuid; fn try_from(value: Uuid) -> Result<Self, Self::Error> { let backing = u128::from_be_bytes(value.0); if backing & ((1u128 << 96) - 1) == BASE_UUID { if let Ok(data) = u16::try_from(backing >> 96) { - return Ok(Uuid16Builder { data }); + return Ok(att::Uuid16 { data }); } } Err(value) } } -impl From<Uuid> for Uuid128Builder { +impl From<Uuid> for att::Uuid128 { fn from(value: Uuid) -> Self { - Uuid128Builder { data: value.le_bytes().to_vec().into() } + att::Uuid128 { data: value.le_bytes() } } } #[cfg(test)] mod test { - use crate::utils::packet::build_view_or_crash; - use super::*; #[test] fn test_uuid16_builder_successful() { let uuid = Uuid::new(0x0102); - let builder: Uuid16Builder = uuid.try_into().unwrap(); + let builder: att::Uuid16 = uuid.try_into().unwrap(); assert_eq!(builder.data, 0x0102); } #[test] fn test_uuid16_builder_fail_nonzero_trailing_bytes() { let uuid = Uuid::new(0x01020304); - let res: Result<Uuid16Builder, _> = uuid.try_into(); + let res: Result<att::Uuid16, _> = uuid.try_into(); assert!(res.is_err()); } @@ -118,14 +107,14 @@ mod test { let mut uuid = Uuid::new(0x0102); uuid.0[0] = 1; - let res: Result<Uuid16Builder, _> = uuid.try_into(); + let res: Result<att::Uuid16, _> = uuid.try_into(); assert!(res.is_err()); } #[test] fn test_uuid128_builder() { let uuid = Uuid::new(0x01020304); - let builder: Uuid128Builder = uuid.into(); + let builder: att::Uuid128 = uuid.into(); assert_eq!(builder.data[..12], BASE_UUID.to_le_bytes()[..12]); assert_eq!(builder.data[12..], [4, 3, 2, 1]); } @@ -133,7 +122,7 @@ mod test { #[test] fn test_uuid_builder() { let uuid = Uuid::new(0x01020304); - let builder: UuidBuilder = uuid.into(); + let builder: att::Uuid = uuid.into(); assert_eq!(builder.data[..12], BASE_UUID.to_le_bytes()[..12]); assert_eq!(builder.data[12..], [4, 3, 2, 1]); } @@ -141,7 +130,7 @@ mod test { #[test] fn test_uuid_from_16_fixed_view() { let expected = Uuid::new(0x0102); - let actual: Uuid = build_view_or_crash(Uuid16Builder { data: 0x0102 }).view().into(); + let actual: Uuid = att::Uuid16 { data: 0x0102 }.try_into().unwrap(); assert_eq!(expected, actual); } @@ -149,25 +138,21 @@ mod test { fn test_uuid_from_128_fixed_view() { let data = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]; let expected = Uuid::new_from_le_bytes(data); - let actual: Uuid = build_view_or_crash(Uuid128Builder { data: data.into() }).view().into(); + let actual: Uuid = att::Uuid128 { data }.try_into().unwrap(); assert_eq!(expected, actual); } #[test] fn test_uuid_from_16_view() { let expected = Uuid::new(0x0102); - let actual: Uuid = - build_view_or_crash(UuidBuilder { data: [2, 1].into() }).view().try_into().unwrap(); + let actual: Uuid = att::Uuid { data: vec![2, 1] }.try_into().unwrap(); assert_eq!(expected, actual); } #[test] fn test_uuid_from_32_view() { let expected = Uuid::new(0x01020304); - let actual: Uuid = build_view_or_crash(UuidBuilder { data: [4, 3, 2, 1].into() }) - .view() - .try_into() - .unwrap(); + let actual: Uuid = att::Uuid { data: vec![4, 3, 2, 1] }.try_into().unwrap(); assert_eq!(expected, actual); } @@ -175,16 +160,14 @@ mod test { fn test_uuid_from_128_view() { let data = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]; let expected = Uuid::new_from_le_bytes(data); - let actual: Uuid = - build_view_or_crash(UuidBuilder { data: data.into() }).view().try_into().unwrap(); + let actual: Uuid = att::Uuid { data: data.into() }.try_into().unwrap(); assert_eq!(expected, actual); } #[test] fn test_uuid_from_invalid_view() { - let packet = - build_view_or_crash(UuidBuilder { data: [10, 9, 8, 7, 6, 5, 4, 3, 2, 1].into() }); - let res = Uuid::try_from(packet.view()); + let packet = att::Uuid { data: vec![10, 9, 8, 7, 6, 5, 4, 3, 2, 1] }; + let res = Uuid::try_from(packet); assert!(res.is_err()); } } diff --git a/system/rust/src/gatt/arbiter.rs b/system/rust/src/gatt/arbiter.rs index 77a3867d02..f25250043b 100644 --- a/system/rust/src/gatt/arbiter.rs +++ b/system/rust/src/gatt/arbiter.rs @@ -1,15 +1,13 @@ //! This module handles "arbitration" of ATT packets, to determine whether they //! should be handled by the primary stack or by the Rust stack +use pdl_runtime::Packet; use std::sync::{Arc, Mutex}; use log::{error, trace, warn}; use std::sync::RwLock; -use crate::{ - do_in_rust_thread, - packets::{AttOpcode, OwnedAttView, OwnedPacket}, -}; +use crate::{do_in_rust_thread, packets::att}; use super::{ ffi::{InterceptAction, StoreCallbacksFromRust}, @@ -62,19 +60,19 @@ pub fn has_arbiter() -> bool { fn try_parse_att_server_packet( isolation_manager: &IsolationManager, tcb_idx: TransportIndex, - packet: Box<[u8]>, -) -> Option<OwnedAttView> { + packet: &[u8], +) -> Option<att::Att> { isolation_manager.get_server_id(tcb_idx)?; - let att = OwnedAttView::try_parse(packet).ok()?; + let att = att::Att::decode_full(packet).ok()?; - if att.view().get_opcode() == AttOpcode::EXCHANGE_MTU_REQUEST { + if att.opcode == att::AttOpcode::ExchangeMtuRequest { // special case: this server opcode is handled by legacy stack, and we snoop // on its handling, since the MTU is shared between the client + server return None; } - match classify_opcode(att.view().get_opcode()) { + match classify_opcode(att.opcode) { OperationType::Command | OperationType::Request | OperationType::Confirmation => Some(att), _ => None, } @@ -123,13 +121,13 @@ fn intercept_packet(tcb_idx: u8, packet: Vec<u8>) -> InterceptAction { } let tcb_idx = TransportIndex(tcb_idx); - if let Some(att) = with_arbiter(|arbiter| { - try_parse_att_server_packet(arbiter, tcb_idx, packet.into_boxed_slice()) - }) { + if let Some(att) = + with_arbiter(|arbiter| try_parse_att_server_packet(arbiter, tcb_idx, &packet)) + { do_in_rust_thread(move |modules| { trace!("pushing packet to GATT"); if let Some(bearer) = modules.gatt_module.get_bearer(tcb_idx) { - bearer.handle_packet(att.view()) + bearer.handle_packet(att) } else { error!("Bearer for {tcb_idx:?} not found"); } @@ -160,10 +158,7 @@ mod test { use crate::{ gatt::ids::{AttHandle, ServerId}, - packets::{ - AttBuilder, AttExchangeMtuRequestBuilder, AttOpcode, AttReadRequestBuilder, - Serializable, - }, + packets::att, }; const TCB_IDX: TransportIndex = TransportIndex(1); @@ -183,15 +178,12 @@ mod test { #[test] fn test_packet_capture_when_isolated() { let isolation_manager = create_manager_with_isolated_connection(TCB_IDX, SERVER_ID); - let packet = AttBuilder { - opcode: AttOpcode::READ_REQUEST, - _child_: AttReadRequestBuilder { attribute_handle: AttHandle(1).into() }.into(), - }; + let packet = att::AttReadRequest { attribute_handle: AttHandle(1).into() }; let out = try_parse_att_server_packet( &isolation_manager, TCB_IDX, - packet.to_vec().unwrap().into(), + &packet.encode_to_vec().unwrap(), ); assert!(out.is_some()); @@ -200,15 +192,16 @@ mod test { #[test] fn test_packet_bypass_when_isolated() { let isolation_manager = create_manager_with_isolated_connection(TCB_IDX, SERVER_ID); - let packet = AttBuilder { - opcode: AttOpcode::ERROR_RESPONSE, - _child_: AttReadRequestBuilder { attribute_handle: AttHandle(1).into() }.into(), + let packet = att::AttErrorResponse { + opcode_in_error: att::AttOpcode::ReadResponse, + handle_in_error: AttHandle(1).into(), + error_code: att::AttErrorCode::InvalidHandle, }; let out = try_parse_att_server_packet( &isolation_manager, TCB_IDX, - packet.to_vec().unwrap().into(), + &packet.encode_to_vec().unwrap(), ); assert!(out.is_none()); @@ -217,15 +210,12 @@ mod test { #[test] fn test_mtu_bypass() { let isolation_manager = create_manager_with_isolated_connection(TCB_IDX, SERVER_ID); - let packet = AttBuilder { - opcode: AttOpcode::EXCHANGE_MTU_REQUEST, - _child_: AttExchangeMtuRequestBuilder { mtu: 64 }.into(), - }; + let packet = att::AttExchangeMtuRequest { mtu: 64 }; let out = try_parse_att_server_packet( &isolation_manager, TCB_IDX, - packet.to_vec().unwrap().into(), + &packet.encode_to_vec().unwrap(), ); assert!(out.is_none()); @@ -234,15 +224,12 @@ mod test { #[test] fn test_packet_bypass_when_not_isolated() { let isolation_manager = IsolationManager::new(); - let packet = AttBuilder { - opcode: AttOpcode::READ_REQUEST, - _child_: AttReadRequestBuilder { attribute_handle: AttHandle(1).into() }.into(), - }; + let packet = att::AttReadRequest { attribute_handle: AttHandle(1).into() }; let out = try_parse_att_server_packet( &isolation_manager, TCB_IDX, - packet.to_vec().unwrap().into(), + &packet.encode_to_vec().unwrap(), ); assert!(out.is_none()); diff --git a/system/rust/src/gatt/callbacks.rs b/system/rust/src/gatt/callbacks.rs index 2d6a58cbdd..377d5a81f6 100644 --- a/system/rust/src/gatt/callbacks.rs +++ b/system/rust/src/gatt/callbacks.rs @@ -9,7 +9,7 @@ pub use callback_transaction_manager::{CallbackResponseError, CallbackTransactio use async_trait::async_trait; use log::warn; -use crate::packets::AttErrorCode; +use crate::packets::att::AttErrorCode; use super::{ ffi::AttributeBackingType, @@ -166,7 +166,7 @@ impl<T: GattDatastore + ?Sized> RawGattDatastore for T { ) -> Result<Vec<u8>, AttErrorCode> { if offset != 0 { warn!("got read blob request for non-long attribute {handle:?}"); - return Err(AttErrorCode::ATTRIBUTE_NOT_LONG); + return Err(AttErrorCode::AttributeNotLong); } self.read(tcb_idx, handle, attr_type).await } @@ -183,7 +183,7 @@ impl<T: GattDatastore + ?Sized> RawGattDatastore for T { match write_type { GattWriteRequestType::Prepare { .. } => { warn!("got prepare write attempt on {tcb_idx:?} to characteristic {handle:?} not supporting write_without_response"); - Err(AttErrorCode::WRITE_REQUEST_REJECTED) + Err(AttErrorCode::WriteRequestRejected) } GattWriteRequestType::Request => self.write(tcb_idx, handle, attr_type, data).await, } @@ -270,10 +270,10 @@ mod test { let MockDatastoreEvents::Read(_, _, _, resp) = resp else { unreachable!(); }; - resp.send(Err(AttErrorCode::APPLICATION_ERROR)).unwrap(); + resp.send(Err(AttErrorCode::ApplicationError)).unwrap(); // assert: got the supplied response - assert_eq!(pending.await.unwrap(), Err(AttErrorCode::APPLICATION_ERROR)); + assert_eq!(pending.await.unwrap(), Err(AttErrorCode::ApplicationError)); }); } @@ -292,7 +292,7 @@ mod test { )); // assert: got the correct error code - assert_eq!(resp, Err(AttErrorCode::ATTRIBUTE_NOT_LONG)); + assert_eq!(resp, Err(AttErrorCode::AttributeNotLong)); // assert: no pending events assert_eq!(rx.try_recv().unwrap_err(), TryRecvError::Empty); } @@ -353,10 +353,10 @@ mod test { let MockDatastoreEvents::Write(_, _, _, _, resp) = resp else { unreachable!(); }; - resp.send(Err(AttErrorCode::APPLICATION_ERROR)).unwrap(); + resp.send(Err(AttErrorCode::ApplicationError)).unwrap(); // assert: got the supplied response - assert_eq!(pending.await.unwrap(), Err(AttErrorCode::APPLICATION_ERROR)); + assert_eq!(pending.await.unwrap(), Err(AttErrorCode::ApplicationError)); }); } @@ -376,7 +376,7 @@ mod test { )); // assert: got the correct error code - assert_eq!(resp, Err(AttErrorCode::WRITE_REQUEST_REJECTED)); + assert_eq!(resp, Err(AttErrorCode::WriteRequestRejected)); // assert: no event sent up assert_eq!(rx.try_recv().unwrap_err(), TryRecvError::Empty); } diff --git a/system/rust/src/gatt/callbacks/callback_transaction_manager.rs b/system/rust/src/gatt/callbacks/callback_transaction_manager.rs index 4210d64535..f877f17d81 100644 --- a/system/rust/src/gatt/callbacks/callback_transaction_manager.rs +++ b/system/rust/src/gatt/callbacks/callback_transaction_manager.rs @@ -9,7 +9,7 @@ use crate::{ ids::{AttHandle, ConnectionId, ServerId, TransactionId, TransportIndex}, GattCallbacks, }, - packets::AttErrorCode, + packets::att::AttErrorCode, }; use super::{ @@ -121,7 +121,7 @@ impl PendingTransactionWatcher { .pending_transactions .remove(&(self.conn_id, self.trans_id)); warn!("no response received from Java after timeout - returning UNLIKELY_ERROR"); - Err(AttErrorCode::UNLIKELY_ERROR) + Err(AttErrorCode::UnlikelyError) } } } diff --git a/system/rust/src/gatt/channel.rs b/system/rust/src/gatt/channel.rs index 6625eb1911..57d1b53b06 100644 --- a/system/rust/src/gatt/channel.rs +++ b/system/rust/src/gatt/channel.rs @@ -1,7 +1,8 @@ //! This represents the TX end of an ATT Transport, to be either mocked (in //! test) or linked to FFI (in production). -use crate::packets::{AttBuilder, SerializeError}; +use crate::packets::att; +use pdl_runtime::EncodeError; use super::ids::TransportIndex; @@ -14,9 +15,5 @@ pub trait AttTransport { /// /// The tcb_idx is an identifier for this transport supplied from the /// native stack, and represents an underlying ACL-LE connection. - fn send_packet( - &self, - tcb_idx: TransportIndex, - packet: AttBuilder, - ) -> Result<(), SerializeError>; + fn send_packet(&self, tcb_idx: TransportIndex, packet: att::Att) -> Result<(), EncodeError>; } diff --git a/system/rust/src/gatt/ffi.rs b/system/rust/src/gatt/ffi.rs index 71007ebaf2..110de114d3 100644 --- a/system/rust/src/gatt/ffi.rs +++ b/system/rust/src/gatt/ffi.rs @@ -1,6 +1,8 @@ //! FFI interfaces for the GATT module. Some structs are exported so that //! core::init can instantiate and pass them into the main loop. +use pdl_runtime::EncodeError; +use pdl_runtime::Packet; use std::iter::Peekable; use anyhow::{bail, Result}; @@ -11,7 +13,7 @@ use tokio::task::spawn_local; use crate::{ do_in_rust_thread, - packets::{AttBuilder, AttErrorCode, Serializable, SerializeError}, + packets::att::{self, AttErrorCode}, }; use super::{ @@ -266,12 +268,8 @@ impl GattCallbacks for GattCallbacksImpl { pub struct AttTransportImpl(); impl AttTransport for AttTransportImpl { - fn send_packet( - &self, - tcb_idx: TransportIndex, - packet: AttBuilder, - ) -> Result<(), SerializeError> { - SendPacketToPeer(tcb_idx.0, packet.to_vec()?); + fn send_packet(&self, tcb_idx: TransportIndex, packet: att::Att) -> Result<(), EncodeError> { + SendPacketToPeer(tcb_idx.0, packet.encode_to_vec()?); Ok(()) } } @@ -418,7 +416,7 @@ fn send_response(_server_id: u8, conn_id: u16, trans_id: u32, status: u8, value: let value = if status == 0 { Ok(value.to_vec()) } else { - Err(AttErrorCode::try_from(status).unwrap_or(AttErrorCode::UNLIKELY_ERROR)) + Err(AttErrorCode::try_from(status).unwrap_or(AttErrorCode::UnlikelyError)) }; trace!("send_response {conn_id:?}, {trans_id:?}, {:?}", value.as_ref().err()); @@ -438,7 +436,7 @@ fn send_response(_server_id: u8, conn_id: u16, trans_id: u32, status: u8, value: fn send_indication(_server_id: u8, handle: u16, conn_id: u16, value: &[u8]) { let handle = AttHandle(handle); let conn_id = ConnectionId(conn_id); - let value = value.into(); + let value = value.to_vec(); trace!("send_indication {handle:?}, {conn_id:?}"); diff --git a/system/rust/src/gatt/mocks/mock_datastore.rs b/system/rust/src/gatt/mocks/mock_datastore.rs index 901fe75565..0e024efd91 100644 --- a/system/rust/src/gatt/mocks/mock_datastore.rs +++ b/system/rust/src/gatt/mocks/mock_datastore.rs @@ -6,7 +6,7 @@ use crate::{ ffi::AttributeBackingType, ids::{AttHandle, TransportIndex}, }, - packets::AttErrorCode, + packets::att::AttErrorCode, }; use async_trait::async_trait; use log::info; diff --git a/system/rust/src/gatt/mocks/mock_raw_datastore.rs b/system/rust/src/gatt/mocks/mock_raw_datastore.rs index 0deb220d28..c43b47d586 100644 --- a/system/rust/src/gatt/mocks/mock_raw_datastore.rs +++ b/system/rust/src/gatt/mocks/mock_raw_datastore.rs @@ -6,7 +6,7 @@ use crate::{ ffi::AttributeBackingType, ids::{AttHandle, TransportIndex}, }, - packets::AttErrorCode, + packets::att::AttErrorCode, }; use async_trait::async_trait; use log::info; diff --git a/system/rust/src/gatt/mocks/mock_transport.rs b/system/rust/src/gatt/mocks/mock_transport.rs index 9227eeb127..4db740c71a 100644 --- a/system/rust/src/gatt/mocks/mock_transport.rs +++ b/system/rust/src/gatt/mocks/mock_transport.rs @@ -2,29 +2,27 @@ use crate::{ gatt::{channel::AttTransport, ids::TransportIndex}, - packets::{AttBuilder, Serializable, SerializeError}, + packets::att, }; +use pdl_runtime::EncodeError; +use pdl_runtime::Packet; use tokio::sync::mpsc::{self, unbounded_channel, UnboundedReceiver}; /// Routes calls to AttTransport into a channel containing AttBuilders -pub struct MockAttTransport(mpsc::UnboundedSender<(TransportIndex, AttBuilder)>); +pub struct MockAttTransport(mpsc::UnboundedSender<(TransportIndex, att::Att)>); impl MockAttTransport { /// Constructor. Returns Self and the RX side of a channel containing /// AttBuilders sent on TransportIndices - pub fn new() -> (Self, UnboundedReceiver<(TransportIndex, AttBuilder)>) { + pub fn new() -> (Self, UnboundedReceiver<(TransportIndex, att::Att)>) { let (tx, rx) = unbounded_channel(); (Self(tx), rx) } } impl AttTransport for MockAttTransport { - fn send_packet( - &self, - tcb_idx: TransportIndex, - packet: AttBuilder, - ) -> Result<(), SerializeError> { - packet.to_vec()?; // trigger SerializeError if needed + fn send_packet(&self, tcb_idx: TransportIndex, packet: att::Att) -> Result<(), EncodeError> { + packet.encode_to_vec()?; // trigger SerializeError if needed self.0.send((tcb_idx, packet)).unwrap(); Ok(()) } diff --git a/system/rust/src/gatt/opcode_types.rs b/system/rust/src/gatt/opcode_types.rs index 0c932eb886..d92da99ea4 100644 --- a/system/rust/src/gatt/opcode_types.rs +++ b/system/rust/src/gatt/opcode_types.rs @@ -1,6 +1,6 @@ //! This module lets us classify AttOpcodes to determine how to handle them -use crate::packets::AttOpcode; +use crate::packets::att::AttOpcode; /// The type of ATT operation performed by the packet /// (see Core Spec 5.3 Vol 3F 3.3 Attribute PDU for details) @@ -23,40 +23,40 @@ pub enum OperationType { /// bitmasking, but is done explicitly for clarity. pub fn classify_opcode(opcode: AttOpcode) -> OperationType { match opcode { - AttOpcode::ERROR_RESPONSE => OperationType::Response, - AttOpcode::EXCHANGE_MTU_RESPONSE => OperationType::Response, - AttOpcode::FIND_INFORMATION_RESPONSE => OperationType::Response, - AttOpcode::FIND_BY_TYPE_VALUE_RESPONSE => OperationType::Response, - AttOpcode::READ_BY_TYPE_RESPONSE => OperationType::Response, - AttOpcode::READ_RESPONSE => OperationType::Response, - AttOpcode::READ_BLOB_RESPONSE => OperationType::Response, - AttOpcode::READ_MULTIPLE_RESPONSE => OperationType::Response, - AttOpcode::READ_BY_GROUP_TYPE_RESPONSE => OperationType::Response, - AttOpcode::WRITE_RESPONSE => OperationType::Response, - AttOpcode::PREPARE_WRITE_RESPONSE => OperationType::Response, - AttOpcode::EXECUTE_WRITE_RESPONSE => OperationType::Response, - AttOpcode::READ_MULTIPLE_VARIABLE_RESPONSE => OperationType::Response, - - AttOpcode::EXCHANGE_MTU_REQUEST => OperationType::Request, - AttOpcode::FIND_INFORMATION_REQUEST => OperationType::Request, - AttOpcode::FIND_BY_TYPE_VALUE_REQUEST => OperationType::Request, - AttOpcode::READ_BY_TYPE_REQUEST => OperationType::Request, - AttOpcode::READ_REQUEST => OperationType::Request, - AttOpcode::READ_BLOB_REQUEST => OperationType::Request, - AttOpcode::READ_MULTIPLE_REQUEST => OperationType::Request, - AttOpcode::READ_BY_GROUP_TYPE_REQUEST => OperationType::Request, - AttOpcode::WRITE_REQUEST => OperationType::Request, - AttOpcode::PREPARE_WRITE_REQUEST => OperationType::Request, - AttOpcode::EXECUTE_WRITE_REQUEST => OperationType::Request, - AttOpcode::READ_MULTIPLE_VARIABLE_REQUEST => OperationType::Request, - - AttOpcode::WRITE_COMMAND => OperationType::Command, - AttOpcode::SIGNED_WRITE_COMMAND => OperationType::Command, - - AttOpcode::HANDLE_VALUE_NOTIFICATION => OperationType::Notification, - - AttOpcode::HANDLE_VALUE_INDICATION => OperationType::Indication, - - AttOpcode::HANDLE_VALUE_CONFIRMATION => OperationType::Confirmation, + AttOpcode::ErrorResponse => OperationType::Response, + AttOpcode::ExchangeMtuResponse => OperationType::Response, + AttOpcode::FindInformationResponse => OperationType::Response, + AttOpcode::FindByTypeValueResponse => OperationType::Response, + AttOpcode::ReadByTypeResponse => OperationType::Response, + AttOpcode::ReadResponse => OperationType::Response, + AttOpcode::ReadBlobResponse => OperationType::Response, + AttOpcode::ReadMultipleResponse => OperationType::Response, + AttOpcode::ReadByGroupTypeResponse => OperationType::Response, + AttOpcode::WriteResponse => OperationType::Response, + AttOpcode::PrepareWriteResponse => OperationType::Response, + AttOpcode::ExecuteWriteResponse => OperationType::Response, + AttOpcode::ReadMultipleVariableResponse => OperationType::Response, + + AttOpcode::ExchangeMtuRequest => OperationType::Request, + AttOpcode::FindInformationRequest => OperationType::Request, + AttOpcode::FindByTypeValueRequest => OperationType::Request, + AttOpcode::ReadByTypeRequest => OperationType::Request, + AttOpcode::ReadRequest => OperationType::Request, + AttOpcode::ReadBlobRequest => OperationType::Request, + AttOpcode::ReadMultipleRequest => OperationType::Request, + AttOpcode::ReadByGroupTypeRequest => OperationType::Request, + AttOpcode::WriteRequest => OperationType::Request, + AttOpcode::PrepareWriteRequest => OperationType::Request, + AttOpcode::ExecuteWriteRequest => OperationType::Request, + AttOpcode::ReadMultipleVariableRequest => OperationType::Request, + + AttOpcode::WriteCommand => OperationType::Command, + AttOpcode::SignedWriteCommand => OperationType::Command, + + AttOpcode::HandleValueNotification => OperationType::Notification, + + AttOpcode::HandleValueIndication => OperationType::Indication, + + AttOpcode::HandleValueConfirmation => OperationType::Confirmation, } } diff --git a/system/rust/src/gatt/server/att_database.rs b/system/rust/src/gatt/server/att_database.rs index 47e67270a2..cd322c6f8c 100644 --- a/system/rust/src/gatt/server/att_database.rs +++ b/system/rust/src/gatt/server/att_database.rs @@ -4,18 +4,18 @@ use bitflags::bitflags; use crate::{ core::uuid::Uuid, gatt::ids::AttHandle, - packets::{AttErrorCode, AttHandleBuilder, AttHandleView}, + packets::att::{self, AttErrorCode}, }; -impl From<AttHandleView<'_>> for AttHandle { - fn from(value: AttHandleView) -> Self { - AttHandle(value.get_handle()) +impl From<att::AttHandle> for AttHandle { + fn from(value: att::AttHandle) -> Self { + AttHandle(value.handle) } } -impl From<AttHandle> for AttHandleBuilder { +impl From<AttHandle> for att::AttHandle { fn from(value: AttHandle) -> Self { - AttHandleBuilder { handle: value.0 } + att::AttHandle { handle: value.0 } } } diff --git a/system/rust/src/gatt/server/att_server_bearer.rs b/system/rust/src/gatt/server/att_server_bearer.rs index b6ba9c5ebb..0d78ad1278 100644 --- a/system/rust/src/gatt/server/att_server_bearer.rs +++ b/system/rust/src/gatt/server/att_server_bearer.rs @@ -2,6 +2,7 @@ //! It handles ATT transactions and unacknowledged operations, backed by an //! AttDatabase (that may in turn be backed by an upper-layer protocol) +use pdl_runtime::EncodeError; use std::{cell::Cell, future::Future}; use anyhow::Result; @@ -18,11 +19,8 @@ use crate::{ mtu::{AttMtu, MtuEvent}, opcode_types::{classify_opcode, OperationType}, }, - packets::{ - AttBuilder, AttChild, AttErrorCode, AttErrorResponseBuilder, AttView, Packet, - SerializeError, - }, - utils::{owned_handle::OwnedHandle, packet::HACK_child_to_opcode}, + packets::att::{self, AttErrorCode}, + utils::owned_handle::OwnedHandle, }; use super::{ @@ -42,7 +40,7 @@ enum AttRequestState<T: AttDatabase> { #[derive(Debug)] pub enum SendError { /// The packet failed to serialize - SerializeError(SerializeError), + SerializeError(EncodeError), /// The connection no longer exists ConnectionDropped, } @@ -52,7 +50,7 @@ pub enum SendError { /// take place at a time pub struct AttServerBearer<T: AttDatabase> { // general - send_packet: Box<dyn Fn(AttBuilder) -> Result<(), SerializeError>>, + send_packet: Box<dyn Fn(att::Att) -> Result<(), EncodeError>>, mtu: AttMtu, // request state @@ -69,10 +67,7 @@ pub struct AttServerBearer<T: AttDatabase> { impl<T: AttDatabase + Clone + 'static> AttServerBearer<T> { /// Constructor, wrapping an ATT channel (for outgoing packets) and an /// AttDatabase - pub fn new( - db: T, - send_packet: impl Fn(AttBuilder) -> Result<(), SerializeError> + 'static, - ) -> Self { + pub fn new(db: T, send_packet: impl Fn(att::Att) -> Result<(), EncodeError> + 'static) -> Self { let (indication_handler, pending_confirmation) = IndicationHandler::new(db.clone()); Self { send_packet: Box::new(send_packet), @@ -87,9 +82,7 @@ impl<T: AttDatabase + Clone + 'static> AttServerBearer<T> { } } - fn send_packet(&self, packet: impl Into<AttChild>) -> Result<(), SerializeError> { - let child = packet.into(); - let packet = AttBuilder { opcode: HACK_child_to_opcode(&child), _child_: child }; + fn send_packet(&self, packet: att::Att) -> Result<(), EncodeError> { (self.send_packet)(packet) } } @@ -97,8 +90,8 @@ impl<T: AttDatabase + Clone + 'static> AttServerBearer<T> { impl<T: AttDatabase + Clone + 'static> WeakBoxRef<'_, AttServerBearer<T>> { /// Handle an incoming packet, and send outgoing packets as appropriate /// using the owned ATT channel. - pub fn handle_packet(&self, packet: AttView<'_>) { - match classify_opcode(packet.get_opcode()) { + pub fn handle_packet(&self, packet: att::Att) { + match classify_opcode(packet.opcode) { OperationType::Command => { self.command_handler.process_packet(packet); } @@ -153,18 +146,18 @@ impl<T: AttDatabase + Clone + 'static> WeakBoxRef<'_, AttServerBearer<T>> { self.mtu.handle_event(mtu_event) } - fn handle_request(&self, packet: AttView<'_>) { + fn handle_request(&self, packet: att::Att) { let curr_request = self.curr_request.replace(AttRequestState::Replacing); self.curr_request.replace(match curr_request { AttRequestState::Idle(mut request_handler) => { // even if the MTU is updated afterwards, 5.3 3F 3.4.2.2 states that the // request-time MTU should be used let mtu = self.mtu.snapshot_or_default(); - let packet = packet.to_owned_packet(); let this = self.downgrade(); + let opcode = packet.opcode; let task = spawn_local(async move { trace!("starting ATT transaction"); - let reply = request_handler.process_packet(packet.view(), mtu).await; + let reply = request_handler.process_packet(packet, mtu).await; this.with(|this| { this.map(|this| { match this.send_packet(reply) { @@ -174,11 +167,11 @@ impl<T: AttDatabase + Clone + 'static> WeakBoxRef<'_, AttServerBearer<T>> { Err(err) => { error!("serializer failure {err:?}, dropping packet and sending failed reply"); // if this also fails, we're stuck - if let Err(err) = this.send_packet(AttErrorResponseBuilder { - opcode_in_error: packet.view().get_opcode(), + if let Err(err) = this.send_packet(att::AttErrorResponse { + opcode_in_error: opcode, handle_in_error: AttHandle(0).into(), - error_code: AttErrorCode::UNLIKELY_ERROR, - }) { + error_code: AttErrorCode::UnlikelyError, + }.try_into().unwrap()) { panic!("unexpected serialize error for known-good packet {err:?}") } } @@ -203,7 +196,7 @@ impl<T: AttDatabase + Clone + 'static> WeakBoxRef<'_, AttServerBearer<T>> { } impl<T: AttDatabase + Clone + 'static> WeakBox<AttServerBearer<T>> { - fn try_send_packet(&self, packet: impl Into<AttChild>) -> Result<(), SendError> { + fn try_send_packet(&self, packet: att::Att) -> Result<(), SendError> { self.with(|this| { this.ok_or_else(|| { warn!("connection dropped before packet sent"); @@ -237,14 +230,8 @@ mod test { test::test_att_db::TestAttDatabase, }, }, - packets::{ - AttHandleValueConfirmationBuilder, AttOpcode, AttReadRequestBuilder, - AttReadResponseBuilder, - }, - utils::{ - packet::build_att_view_or_crash, - task::{block_on_locally, try_await}, - }, + packets::att, + utils::task::{block_on_locally, try_await}, }; const VALID_HANDLE: AttHandle = AttHandle(3); @@ -254,7 +241,7 @@ mod test { const TCB_IDX: TransportIndex = TransportIndex(1); fn open_connection( - ) -> (SharedBox<AttServerBearer<TestAttDatabase>>, UnboundedReceiver<AttBuilder>) { + ) -> (SharedBox<AttServerBearer<TestAttDatabase>>, UnboundedReceiver<att::Att>) { let db = TestAttDatabase::new(vec![ ( AttAttribute { @@ -287,12 +274,9 @@ mod test { block_on_locally(async { let (conn, mut rx) = open_connection(); conn.as_ref().handle_packet( - build_att_view_or_crash(AttReadRequestBuilder { - attribute_handle: VALID_HANDLE.into(), - }) - .view(), + att::AttReadRequest { attribute_handle: VALID_HANDLE.into() }.try_into().unwrap(), ); - assert_eq!(rx.recv().await.unwrap().opcode, AttOpcode::READ_RESPONSE); + assert_eq!(rx.recv().await.unwrap().opcode, att::AttOpcode::ReadResponse); assert_eq!(rx.try_recv(), Err(TryRecvError::Empty)); }); } @@ -302,21 +286,15 @@ mod test { block_on_locally(async { let (conn, mut rx) = open_connection(); conn.as_ref().handle_packet( - build_att_view_or_crash(AttReadRequestBuilder { - attribute_handle: INVALID_HANDLE.into(), - }) - .view(), + att::AttReadRequest { attribute_handle: INVALID_HANDLE.into() }.try_into().unwrap(), ); - assert_eq!(rx.recv().await.unwrap().opcode, AttOpcode::ERROR_RESPONSE); + assert_eq!(rx.recv().await.unwrap().opcode, att::AttOpcode::ErrorResponse); assert_eq!(rx.try_recv(), Err(TryRecvError::Empty)); conn.as_ref().handle_packet( - build_att_view_or_crash(AttReadRequestBuilder { - attribute_handle: VALID_HANDLE.into(), - }) - .view(), + att::AttReadRequest { attribute_handle: VALID_HANDLE.into() }.try_into().unwrap(), ); - assert_eq!(rx.recv().await.unwrap().opcode, AttOpcode::READ_RESPONSE); + assert_eq!(rx.recv().await.unwrap().opcode, att::AttOpcode::ReadResponse); assert_eq!(rx.try_recv(), Err(TryRecvError::Empty)); }); } @@ -361,15 +339,11 @@ mod test { // act: send two read requests before replying to either read // first request block_on_locally(async { - let req1 = build_att_view_or_crash(AttReadRequestBuilder { - attribute_handle: VALID_HANDLE.into(), - }); - conn.as_ref().handle_packet(req1.view()); + let req1 = att::AttReadRequest { attribute_handle: VALID_HANDLE.into() }; + conn.as_ref().handle_packet(req1.try_into().unwrap()); // second request - let req2 = build_att_view_or_crash(AttReadRequestBuilder { - attribute_handle: ANOTHER_VALID_HANDLE.into(), - }); - conn.as_ref().handle_packet(req2.view()); + let req2 = att::AttReadRequest { attribute_handle: ANOTHER_VALID_HANDLE.into() }; + conn.as_ref().handle_packet(req2.try_into().unwrap()); // handle first reply let MockDatastoreEvents::Read( TCB_IDX, @@ -385,13 +359,7 @@ mod test { // assert: that the first reply was made let resp = rx.recv().await.unwrap(); - assert_eq!( - resp, - AttBuilder { - opcode: AttOpcode::READ_RESPONSE, - _child_: AttReadResponseBuilder { value: data.into() }.into() - } - ); + assert_eq!(resp, att::AttReadResponse { value: data.to_vec() }.try_into().unwrap()); // assert no other replies were made assert_eq!(rx.try_recv(), Err(TryRecvError::Empty)); // assert no callbacks are pending @@ -408,12 +376,10 @@ mod test { // act: send an indication let pending_send = spawn_local(conn.as_ref().send_indication(VALID_HANDLE, vec![1, 2, 3])); - assert_eq!(rx.recv().await.unwrap().opcode, AttOpcode::HANDLE_VALUE_INDICATION); + assert_eq!(rx.recv().await.unwrap().opcode, att::AttOpcode::HandleValueIndication); assert_eq!(rx.try_recv(), Err(TryRecvError::Empty)); // and the confirmation - conn.as_ref().handle_packet( - build_att_view_or_crash(AttHandleValueConfirmationBuilder {}).view(), - ); + conn.as_ref().handle_packet(att::AttHandleValueConfirmation {}.try_into().unwrap()); // assert: the indication was correctly sent assert!(matches!(pending_send.await.unwrap(), Ok(()))); @@ -432,22 +398,18 @@ mod test { // wait for/capture the outgoing packet let sent1 = rx.recv().await.unwrap(); // send the response - conn.as_ref().handle_packet( - build_att_view_or_crash(AttHandleValueConfirmationBuilder {}).view(), - ); + conn.as_ref().handle_packet(att::AttHandleValueConfirmation {}.try_into().unwrap()); // send the second indication let pending_send2 = spawn_local(conn.as_ref().send_indication(VALID_HANDLE, vec![1, 2, 3])); // wait for/capture the outgoing packet let sent2 = rx.recv().await.unwrap(); // and the response - conn.as_ref().handle_packet( - build_att_view_or_crash(AttHandleValueConfirmationBuilder {}).view(), - ); + conn.as_ref().handle_packet(att::AttHandleValueConfirmation {}.try_into().unwrap()); // assert: exactly two indications were sent - assert_eq!(sent1.opcode, AttOpcode::HANDLE_VALUE_INDICATION); - assert_eq!(sent2.opcode, AttOpcode::HANDLE_VALUE_INDICATION); + assert_eq!(sent1.opcode, att::AttOpcode::HandleValueIndication); + assert_eq!(sent2.opcode, att::AttOpcode::HandleValueIndication); assert_eq!(rx.try_recv(), Err(TryRecvError::Empty)); // and that both got successful responses assert!(matches!(pending_send1.await.unwrap(), Ok(()))); @@ -467,7 +429,7 @@ mod test { let pending_send2 = spawn_local(conn.as_ref().send_indication(ANOTHER_VALID_HANDLE, vec![1, 2, 3])); // assert: only one was initially sent - assert_eq!(rx.recv().await.unwrap().opcode, AttOpcode::HANDLE_VALUE_INDICATION); + assert_eq!(rx.recv().await.unwrap().opcode, att::AttOpcode::HandleValueIndication); assert_eq!(rx.try_recv(), Err(TryRecvError::Empty)); // and both are still pending assert!(!pending_send1.is_finished()); @@ -489,9 +451,7 @@ mod test { // wait for/capture the outgoing packet let sent1 = rx.recv().await.unwrap(); // send response for the first one - conn.as_ref().handle_packet( - build_att_view_or_crash(AttHandleValueConfirmationBuilder {}).view(), - ); + conn.as_ref().handle_packet(att::AttHandleValueConfirmation {}.try_into().unwrap()); // wait for/capture the outgoing packet let sent2 = rx.recv().await.unwrap(); @@ -500,8 +460,8 @@ mod test { assert!(matches!(pending_send1.await.unwrap(), Ok(()))); assert!(!pending_send2.is_finished()); // and that both indications have been sent - assert_eq!(sent1.opcode, AttOpcode::HANDLE_VALUE_INDICATION); - assert_eq!(sent2.opcode, AttOpcode::HANDLE_VALUE_INDICATION); + assert_eq!(sent1.opcode, att::AttOpcode::HandleValueIndication); + assert_eq!(sent2.opcode, att::AttOpcode::HandleValueIndication); assert_eq!(rx.try_recv(), Err(TryRecvError::Empty)); }); } @@ -520,22 +480,18 @@ mod test { // wait for/capture the outgoing packet let sent1 = rx.recv().await.unwrap(); // send response for the first one - conn.as_ref().handle_packet( - build_att_view_or_crash(AttHandleValueConfirmationBuilder {}).view(), - ); + conn.as_ref().handle_packet(att::AttHandleValueConfirmation {}.try_into().unwrap()); // wait for/capture the outgoing packet let sent2 = rx.recv().await.unwrap(); // and now the second - conn.as_ref().handle_packet( - build_att_view_or_crash(AttHandleValueConfirmationBuilder {}).view(), - ); + conn.as_ref().handle_packet(att::AttHandleValueConfirmation {}.try_into().unwrap()); // assert: both futures have completed successfully assert!(matches!(pending_send1.await.unwrap(), Ok(()))); assert!(matches!(pending_send2.await.unwrap(), Ok(()))); // and both indications have been sent - assert_eq!(sent1.opcode, AttOpcode::HANDLE_VALUE_INDICATION); - assert_eq!(sent2.opcode, AttOpcode::HANDLE_VALUE_INDICATION); + assert_eq!(sent1.opcode, att::AttOpcode::HandleValueIndication); + assert_eq!(sent2.opcode, att::AttOpcode::HandleValueIndication); assert_eq!(rx.try_recv(), Err(TryRecvError::Empty)); }); } @@ -573,7 +529,7 @@ mod test { conn.as_ref().handle_mtu_event(MtuEvent::IncomingResponse(100)).unwrap(); // assert: the indication was sent - assert_eq!(rx.recv().await.unwrap().opcode, AttOpcode::HANDLE_VALUE_INDICATION); + assert_eq!(rx.recv().await.unwrap().opcode, att::AttOpcode::HandleValueIndication); }); } @@ -606,14 +562,11 @@ mod test { // act: send server packet conn.as_ref().handle_packet( - build_att_view_or_crash(AttReadRequestBuilder { - attribute_handle: VALID_HANDLE.into(), - }) - .view(), + att::AttReadRequest { attribute_handle: VALID_HANDLE.into() }.try_into().unwrap(), ); // assert: that we reply even while the MTU req is outstanding - assert_eq!(rx.recv().await.unwrap().opcode, AttOpcode::READ_RESPONSE); + assert_eq!(rx.recv().await.unwrap().opcode, att::AttOpcode::ReadResponse); }); } @@ -631,12 +584,10 @@ mod test { conn.as_ref().handle_mtu_event(MtuEvent::OutgoingRequest).unwrap(); conn.as_ref().handle_mtu_event(MtuEvent::IncomingResponse(512)).unwrap(); // finally resolve the first indication, so the second indication can be sent - conn.as_ref().handle_packet( - build_att_view_or_crash(AttHandleValueConfirmationBuilder {}).view(), - ); + conn.as_ref().handle_packet(att::AttHandleValueConfirmation {}.try_into().unwrap()); // assert: the second indication successfully sent (so it used the new MTU) - assert_eq!(rx.recv().await.unwrap().opcode, AttOpcode::HANDLE_VALUE_INDICATION); + assert_eq!(rx.recv().await.unwrap().opcode, att::AttOpcode::HandleValueIndication); }); } } diff --git a/system/rust/src/gatt/server/command_handler.rs b/system/rust/src/gatt/server/command_handler.rs index 763c68f7d0..da54bb1ad8 100644 --- a/system/rust/src/gatt/server/command_handler.rs +++ b/system/rust/src/gatt/server/command_handler.rs @@ -1,6 +1,6 @@ use log::warn; -use crate::packets::{AttOpcode, AttView, AttWriteCommandView, Packet}; +use crate::packets::att; use super::att_database::AttDatabase; @@ -14,21 +14,18 @@ impl<Db: AttDatabase> AttCommandHandler<Db> { Self { db } } - pub fn process_packet(&self, packet: AttView<'_>) { + pub fn process_packet(&self, packet: att::Att) { let snapshotted_db = self.db.snapshot(); - match packet.get_opcode() { - AttOpcode::WRITE_COMMAND => { - let Ok(packet) = AttWriteCommandView::try_parse(packet) else { + match packet.opcode { + att::AttOpcode::WriteCommand => { + let Ok(packet) = att::AttWriteCommand::try_from(packet) else { warn!("failed to parse WRITE_COMMAND packet"); return; }; - snapshotted_db.write_no_response_attribute( - packet.get_handle().into(), - &packet.get_value_iter().collect::<Vec<_>>(), - ); + snapshotted_db.write_no_response_attribute(packet.handle.into(), &packet.value); } _ => { - warn!("Dropping unsupported opcode {:?}", packet.get_opcode()); + warn!("Dropping unsupported opcode {:?}", packet.opcode); } } } @@ -47,8 +44,8 @@ mod test { test::test_att_db::TestAttDatabase, }, }, - packets::{AttErrorCode, AttErrorResponseBuilder, AttOpcode, AttWriteCommandBuilder}, - utils::{packet::build_att_view_or_crash, task::block_on_locally}, + packets::att, + utils::task::block_on_locally, }; #[test] @@ -66,11 +63,10 @@ mod test { let data = [1, 2]; // act: send write command - let att_view = build_att_view_or_crash(AttWriteCommandBuilder { - handle: AttHandle(3).into(), - value: data.into(), - }); - handler.process_packet(att_view.view()); + let att_view = att::AttWriteCommand { handle: AttHandle(3).into(), value: data.to_vec() } + .try_into() + .unwrap(); + handler.process_packet(att_view); // assert: the db has been updated assert_eq!(block_on_locally(db.read_attribute(AttHandle(3))).unwrap(), data); @@ -83,12 +79,14 @@ mod test { let handler = AttCommandHandler { db }; // act: send a packet that should not be handled here - let att_view = build_att_view_or_crash(AttErrorResponseBuilder { - opcode_in_error: AttOpcode::EXCHANGE_MTU_REQUEST, + let att_view = att::AttErrorResponse { + opcode_in_error: att::AttOpcode::ExchangeMtuRequest, handle_in_error: AttHandle(1).into(), - error_code: AttErrorCode::UNLIKELY_ERROR, - }); - handler.process_packet(att_view.view()); + error_code: att::AttErrorCode::UnlikelyError, + } + .try_into() + .unwrap(); + handler.process_packet(att_view); // assert: nothing happens (we crash if anything is unhandled within a mock) } diff --git a/system/rust/src/gatt/server/gatt_database.rs b/system/rust/src/gatt/server/gatt_database.rs index b1c688f0a7..d1590b3866 100644 --- a/system/rust/src/gatt/server/gatt_database.rs +++ b/system/rust/src/gatt/server/gatt_database.rs @@ -2,6 +2,7 @@ //! by converting a registry of services into a list of attributes, and proxying //! ATT read/write requests into characteristic reads/writes +use pdl_runtime::Packet; use std::{cell::RefCell, collections::BTreeMap, ops::RangeInclusive, rc::Rc}; use anyhow::{bail, Result}; @@ -18,11 +19,7 @@ use crate::{ ffi::AttributeBackingType, ids::{AttHandle, TransportIndex}, }, - packets::{ - AttErrorCode, GattCharacteristicDeclarationValueBuilder, - GattCharacteristicPropertiesBuilder, GattServiceDeclarationValueBuilder, Serializable, - UuidBuilder, - }, + packets::att::{self, AttErrorCode}, }; use super::{ @@ -186,8 +183,8 @@ impl GattDatabase { permissions: AttPermissions::READABLE, }, AttAttributeBackingValue::Static( - GattServiceDeclarationValueBuilder { uuid: UuidBuilder::from(service.type_) } - .to_vec() + att::GattServiceDeclarationValue { uuid: service.type_.into() } + .encode_to_vec() .map_err(|e| { anyhow::anyhow!("failed to encode primary service declaration: {e:?}") })?, @@ -210,8 +207,8 @@ impl GattDatabase { permissions: AttPermissions::READABLE, }, AttAttributeBackingValue::Static( - GattCharacteristicDeclarationValueBuilder { - properties: GattCharacteristicPropertiesBuilder { + att::GattCharacteristicDeclarationValue { + properties: att::GattCharacteristicProperties { broadcast: 0, read: characteristic.permissions.readable().into(), write_without_response: characteristic @@ -227,7 +224,7 @@ impl GattDatabase { handle: characteristic.handle.into(), uuid: characteristic.type_.into(), } - .to_vec() + .encode_to_vec() .map_err(|e| { anyhow::anyhow!("failed to encode characteristic declaration: {e:?}") })?, @@ -351,14 +348,14 @@ impl AttDatabase for AttDatabaseImpl { let value = self.gatt_db.with(|gatt_db| { let Some(gatt_db) = gatt_db else { // db must have been closed - return Err(AttErrorCode::INVALID_HANDLE); + return Err(AttErrorCode::InvalidHandle); }; let services = gatt_db.schema.borrow(); let Some(attr) = services.attributes.get(&handle) else { - return Err(AttErrorCode::INVALID_HANDLE); + return Err(AttErrorCode::InvalidHandle); }; if !attr.attribute.permissions.readable() { - return Err(AttErrorCode::READ_NOT_PERMITTED); + return Err(AttErrorCode::ReadNotPermitted); } Ok(attr.value.clone()) })?; @@ -392,14 +389,14 @@ impl AttDatabase for AttDatabaseImpl { let value = self.gatt_db.with(|gatt_db| { let Some(gatt_db) = gatt_db else { // db must have been closed - return Err(AttErrorCode::INVALID_HANDLE); + return Err(AttErrorCode::InvalidHandle); }; let services = gatt_db.schema.borrow(); let Some(attr) = services.attributes.get(&handle) else { - return Err(AttErrorCode::INVALID_HANDLE); + return Err(AttErrorCode::InvalidHandle); }; if !attr.attribute.permissions.writable_with_response() { - return Err(AttErrorCode::WRITE_NOT_PERMITTED); + return Err(AttErrorCode::WriteNotPermitted); } Ok(attr.value.clone()) })?; @@ -407,7 +404,7 @@ impl AttDatabase for AttDatabaseImpl { match value { AttAttributeBackingValue::Static(val) => { error!("A static attribute {val:?} is marked as writable - ignoring it and rejecting the write..."); - return Err(AttErrorCode::WRITE_NOT_PERMITTED); + return Err(AttErrorCode::WriteNotPermitted); } AttAttributeBackingValue::DynamicCharacteristic(datastore) => { datastore @@ -521,6 +518,7 @@ mod test { mock_datastore::{MockDatastore, MockDatastoreEvents}, mock_raw_datastore::{MockRawDatastore, MockRawDatastoreEvents}, }, + packets::att, utils::task::block_on_locally, }; @@ -545,7 +543,7 @@ mod test { let resp = tokio_test::block_on(att_db.read_attribute(AttHandle(1))); - assert_eq!(resp, Err(AttErrorCode::INVALID_HANDLE)) + assert_eq!(resp, Err(AttErrorCode::InvalidHandle)) } #[test] @@ -577,9 +575,9 @@ mod test { ); assert_eq!( service_value, - GattServiceDeclarationValueBuilder { uuid: SERVICE_TYPE.into() } - .to_vec() - .map_err(|_| AttErrorCode::UNLIKELY_ERROR) + att::GattServiceDeclarationValue { uuid: SERVICE_TYPE.into() } + .encode_to_vec() + .map_err(|_| AttErrorCode::UnlikelyError) ); } @@ -714,8 +712,8 @@ mod test { assert_eq!( characteristic_decl, - GattCharacteristicDeclarationValueBuilder { - properties: GattCharacteristicPropertiesBuilder { + att::GattCharacteristicDeclarationValue { + properties: att::GattCharacteristicProperties { read: 1, broadcast: 0, write_without_response: 0, @@ -728,8 +726,8 @@ mod test { handle: CHARACTERISTIC_VALUE_HANDLE.into(), uuid: CHARACTERISTIC_TYPE.into() } - .to_vec() - .map_err(|_| AttErrorCode::UNLIKELY_ERROR) + .encode_to_vec() + .map_err(|_| AttErrorCode::UnlikelyError) ); } @@ -762,8 +760,8 @@ mod test { tokio_test::block_on(att_db.read_attribute(CHARACTERISTIC_DECLARATION_HANDLE)); assert_eq!( characteristic_decl, - GattCharacteristicDeclarationValueBuilder { - properties: GattCharacteristicPropertiesBuilder { + att::GattCharacteristicDeclarationValue { + properties: att::GattCharacteristicProperties { read: 1, broadcast: 0, write_without_response: 1, @@ -776,8 +774,8 @@ mod test { handle: CHARACTERISTIC_VALUE_HANDLE.into(), uuid: CHARACTERISTIC_TYPE.into() } - .to_vec() - .map_err(|_| AttErrorCode::UNLIKELY_ERROR) + .encode_to_vec() + .map_err(|_| AttErrorCode::UnlikelyError) ); } @@ -852,7 +850,7 @@ mod test { gatt_db.get_att_database(TCB_IDX).read_attribute(CHARACTERISTIC_VALUE_HANDLE), ); - assert_eq!(characteristic_value, Err(AttErrorCode::READ_NOT_PERMITTED)); + assert_eq!(characteristic_value, Err(AttErrorCode::ReadNotPermitted)); } #[test] @@ -985,7 +983,7 @@ mod test { else { unreachable!(); }; - reply.send(Err(AttErrorCode::UNLIKELY_ERROR)).unwrap(); + reply.send(Err(AttErrorCode::UnlikelyError)).unwrap(); }, att_db.write_attribute(CHARACTERISTIC_VALUE_HANDLE, &data) ) @@ -993,7 +991,7 @@ mod test { }); // assert: the supplied value matches what the att datastore returned - assert_eq!(res, Err(AttErrorCode::UNLIKELY_ERROR)); + assert_eq!(res, Err(AttErrorCode::UnlikelyError)); } #[test] @@ -1021,7 +1019,7 @@ mod test { gatt_db.get_att_database(TCB_IDX).write_attribute(CHARACTERISTIC_VALUE_HANDLE, &data), ); - assert_eq!(characteristic_value, Err(AttErrorCode::WRITE_NOT_PERMITTED)); + assert_eq!(characteristic_value, Err(AttErrorCode::WriteNotPermitted)); } #[test] diff --git a/system/rust/src/gatt/server/indication_handler.rs b/system/rust/src/gatt/server/indication_handler.rs index 0a06003a7b..44ffe7ef27 100644 --- a/system/rust/src/gatt/server/indication_handler.rs +++ b/system/rust/src/gatt/server/indication_handler.rs @@ -6,10 +6,7 @@ use tokio::{ time::timeout, }; -use crate::{ - gatt::ids::AttHandle, - packets::{AttChild, AttHandleValueIndicationBuilder}, -}; +use crate::{gatt::ids::AttHandle, packets::att}; use super::{ att_database::{AttDatabase, StableAttDatabase}, @@ -53,7 +50,7 @@ impl<T: AttDatabase> IndicationHandler<T> { handle: AttHandle, data: &[u8], mtu: usize, - send_packet: impl FnOnce(AttChild) -> Result<(), SendError>, + send_packet: impl FnOnce(att::Att) -> Result<(), SendError>, ) -> Result<(), IndicationError> { let data_size = data.len(); // As per Core Spec 5.3 Vol 3F 3.4.7.2, the indicated value must be at most @@ -78,7 +75,9 @@ impl<T: AttDatabase> IndicationHandler<T> { let _ = self.pending_confirmation.try_recv(); send_packet( - AttHandleValueIndicationBuilder { handle: handle.into(), value: data.into() }.into(), + att::AttHandleValueIndication { handle: handle.into(), value: data.to_vec() } + .try_into() + .unwrap(), ) .map_err(IndicationError::SendError)?; @@ -116,6 +115,7 @@ impl ConfirmationWatcher { #[cfg(test)] mod test { + use crate::packets::att; use tokio::{sync::oneshot, task::spawn_local, time::Instant}; use crate::{ @@ -175,12 +175,11 @@ mod test { }); // assert: that an AttHandleValueIndication was sent on the channel - let AttChild::AttHandleValueIndication(indication) = rx.await.unwrap() else { - unreachable!() - }; + let indication = rx.await.unwrap(); assert_eq!( - indication, - AttHandleValueIndicationBuilder { handle: HANDLE.into(), value: DATA.into() } + Ok(indication), + att::AttHandleValueIndication { handle: HANDLE.into(), value: DATA.to_vec() } + .try_into() ); }); } @@ -354,7 +353,7 @@ mod test { IndicationHandler::new(get_att_database()); // act: send an indication with an ATT_MTU of 4 and data length of 3 - let res = indication_handler.send(HANDLE, &[1, 2, 3], 4, move |_| unreachable!()).await; + let res = indication_handler.send(HANDLE, &DATA, 4, move |_| unreachable!()).await; // assert: that we got the expected error, indicating the max data size (not the // ATT_MTU, but ATT_MTU-3) diff --git a/system/rust/src/gatt/server/request_handler.rs b/system/rust/src/gatt/server/request_handler.rs index 74cbb7f3e0..a84bdfcea9 100644 --- a/system/rust/src/gatt/server/request_handler.rs +++ b/system/rust/src/gatt/server/request_handler.rs @@ -1,13 +1,10 @@ use log::warn; +use pdl_runtime::DecodeError; +use pdl_runtime::EncodeError; use crate::{ gatt::ids::AttHandle, - packets::{ - AttChild, AttErrorCode, AttErrorResponseBuilder, AttFindByTypeValueRequestView, - AttFindInformationRequestView, AttOpcode, AttReadByGroupTypeRequestView, - AttReadByTypeRequestView, AttReadRequestView, AttView, AttWriteRequestView, Packet, - ParseError, - }, + packets::att::{self, AttErrorCode}, }; use super::{ @@ -27,6 +24,26 @@ pub struct AttRequestHandler<Db: AttDatabase> { db: Db, } +/// Type of errors raised by request handlers. +#[allow(dead_code)] +enum ProcessingError { + DecodeError(DecodeError), + EncodeError(EncodeError), + RequestNotSupported(att::AttOpcode), +} + +impl From<DecodeError> for ProcessingError { + fn from(err: DecodeError) -> Self { + Self::DecodeError(err) + } +} + +impl From<EncodeError> for ProcessingError { + fn from(err: EncodeError) -> Self { + Self::EncodeError(err) + } +} + impl<Db: AttDatabase> AttRequestHandler<Db> { pub fn new(db: Db) -> Self { Self { db } @@ -35,65 +52,53 @@ impl<Db: AttDatabase> AttRequestHandler<Db> { // Runs a task to process an incoming packet. Takes an exclusive reference to // ensure that only one request is outstanding at a time (notifications + // commands should take a different path) - pub async fn process_packet(&mut self, packet: AttView<'_>, mtu: usize) -> AttChild { - match self.try_parse_and_process_packet(packet, mtu).await { + pub async fn process_packet(&mut self, packet: att::Att, mtu: usize) -> att::Att { + match self.try_parse_and_process_packet(&packet, mtu).await { Ok(result) => result, Err(_) => { // parse error, assume it's an unsupported request // TODO(aryarahul): distinguish between REQUEST_NOT_SUPPORTED and INVALID_PDU - AttErrorResponseBuilder { - opcode_in_error: packet.get_opcode(), + att::AttErrorResponse { + opcode_in_error: packet.opcode, handle_in_error: AttHandle(0).into(), - error_code: AttErrorCode::REQUEST_NOT_SUPPORTED, + error_code: AttErrorCode::RequestNotSupported, } - .into() + .try_into() + .unwrap() } } } async fn try_parse_and_process_packet( &mut self, - packet: AttView<'_>, + packet: &att::Att, mtu: usize, - ) -> Result<AttChild, ParseError> { + ) -> Result<att::Att, ProcessingError> { let snapshotted_db = self.db.snapshot(); - match packet.get_opcode() { - AttOpcode::READ_REQUEST => { - Ok(handle_read_request(AttReadRequestView::try_parse(packet)?, mtu, &self.db).await) + match packet.opcode { + att::AttOpcode::ReadRequest => { + Ok(handle_read_request(packet.try_into()?, mtu, &self.db).await?) + } + att::AttOpcode::ReadByGroupTypeRequest => { + Ok(handle_read_by_group_type_request(packet.try_into()?, mtu, &snapshotted_db) + .await?) + } + att::AttOpcode::ReadByTypeRequest => { + Ok(handle_read_by_type_request(packet.try_into()?, mtu, &snapshotted_db).await?) } - AttOpcode::READ_BY_GROUP_TYPE_REQUEST => { - handle_read_by_group_type_request( - AttReadByGroupTypeRequestView::try_parse(packet)?, - mtu, - &snapshotted_db, - ) - .await + att::AttOpcode::FindInformationRequest => { + Ok(handle_find_information_request(packet.try_into()?, mtu, &snapshotted_db)?) } - AttOpcode::READ_BY_TYPE_REQUEST => { - handle_read_by_type_request( - AttReadByTypeRequestView::try_parse(packet)?, - mtu, - &snapshotted_db, - ) - .await + att::AttOpcode::FindByTypeValueRequest => { + Ok(handle_find_by_type_value_request(packet.try_into()?, mtu, &snapshotted_db) + .await?) } - AttOpcode::FIND_INFORMATION_REQUEST => Ok(handle_find_information_request( - AttFindInformationRequestView::try_parse(packet)?, - mtu, - &snapshotted_db, - )), - AttOpcode::FIND_BY_TYPE_VALUE_REQUEST => Ok(handle_find_by_type_value_request( - AttFindByTypeValueRequestView::try_parse(packet)?, - mtu, - &snapshotted_db, - ) - .await), - AttOpcode::WRITE_REQUEST => { - Ok(handle_write_request(AttWriteRequestView::try_parse(packet)?, &self.db).await) + att::AttOpcode::WriteRequest => { + Ok(handle_write_request(packet.try_into()?, &self.db).await?) } _ => { - warn!("Dropping unsupported opcode {:?}", packet.get_opcode()); - Err(ParseError::InvalidEnumValue) + warn!("Dropping unsupported opcode {:?}", packet.opcode); + Err(ProcessingError::RequestNotSupported(packet.opcode)) } } } @@ -110,8 +115,7 @@ mod test { request_handler::AttRequestHandler, test::test_att_db::TestAttDatabase, }, - packets::{AttReadRequestBuilder, AttReadResponseBuilder, AttWriteResponseBuilder}, - utils::packet::build_att_view_or_crash, + packets::att, }; #[test] @@ -126,18 +130,14 @@ mod test { vec![1, 2, 3], )]); let mut handler = AttRequestHandler { db }; - let att_view = build_att_view_or_crash(AttReadRequestBuilder { - attribute_handle: AttHandle(3).into(), - }); + let att_view = + att::AttReadRequest { attribute_handle: AttHandle(3).into() }.try_into().unwrap(); // act - let response = tokio_test::block_on(handler.process_packet(att_view.view(), 31)); + let response = tokio_test::block_on(handler.process_packet(att_view, 31)); // assert - assert_eq!( - response, - AttChild::AttReadResponse(AttReadResponseBuilder { value: [1, 2, 3].into() }) - ); + assert_eq!(Ok(response), att::AttReadResponse { value: vec![1, 2, 3] }.try_into()); } #[test] @@ -152,19 +152,20 @@ mod test { vec![1, 2, 3], )]); let mut handler = AttRequestHandler { db }; - let att_view = build_att_view_or_crash(AttWriteResponseBuilder {}); + let att_view = att::AttWriteResponse {}.try_into().unwrap(); // act - let response = tokio_test::block_on(handler.process_packet(att_view.view(), 31)); + let response = tokio_test::block_on(handler.process_packet(att_view, 31)); // assert assert_eq!( - response, - AttChild::AttErrorResponse(AttErrorResponseBuilder { - opcode_in_error: AttOpcode::WRITE_RESPONSE, + Ok(response), + att::AttErrorResponse { + opcode_in_error: att::AttOpcode::WriteResponse, handle_in_error: AttHandle(0).into(), - error_code: AttErrorCode::REQUEST_NOT_SUPPORTED - }) + error_code: AttErrorCode::RequestNotSupported + } + .try_into() ); } } diff --git a/system/rust/src/gatt/server/services/gap.rs b/system/rust/src/gatt/server/services/gap.rs index f5476301ff..81853fa006 100644 --- a/system/rust/src/gatt/server/services/gap.rs +++ b/system/rust/src/gatt/server/services/gap.rs @@ -15,7 +15,7 @@ use crate::{ AttPermissions, GattCharacteristicWithHandle, GattDatabase, GattServiceWithHandle, }, }, - packets::AttErrorCode, + packets::att::AttErrorCode, }; struct GapService; @@ -44,7 +44,7 @@ impl GattDatastore for GapService { DEVICE_NAME_HANDLE => { // for non-bonded peers, don't let them read the device name // TODO(aryarahul): support discoverability, when we make this the main GATT server - Err(AttErrorCode::INSUFFICIENT_AUTHENTICATION) + Err(AttErrorCode::InsufficientAuthentication) } // 0x0000 from AssignedNumbers => "Unknown" DEVICE_APPEARANCE_HANDLE => Ok(vec![0x00, 0x00]), @@ -148,7 +148,7 @@ mod test { let name = block_on_locally(att_db.read_attribute(DEVICE_NAME_HANDLE)); // assert: the name is not readable - assert_eq!(name, Err(AttErrorCode::INSUFFICIENT_AUTHENTICATION)); + assert_eq!(name, Err(AttErrorCode::InsufficientAuthentication)); } #[test] diff --git a/system/rust/src/gatt/server/services/gatt.rs b/system/rust/src/gatt/server/services/gatt.rs index 6ba8e90238..40514b4812 100644 --- a/system/rust/src/gatt/server/services/gatt.rs +++ b/system/rust/src/gatt/server/services/gatt.rs @@ -1,5 +1,6 @@ //! The GATT service as defined in Core Spec 5.3 Vol 3G Section 7 +use pdl_runtime::Packet; use std::{cell::RefCell, collections::HashMap, ops::RangeInclusive, rc::Rc}; use anyhow::Result; @@ -24,10 +25,7 @@ use crate::{ }, }, }, - packets::{ - AttErrorCode, GattClientCharacteristicConfigurationBuilder, - GattClientCharacteristicConfigurationView, GattServiceChangedBuilder, Packet, Serializable, - }, + packets::att::{self, AttErrorCode}, }; #[derive(Default)] @@ -62,7 +60,7 @@ impl GattDatastore for GattService { _: AttributeBackingType, ) -> Result<Vec<u8>, AttErrorCode> { if handle == SERVICE_CHANGE_CCC_DESCRIPTOR_HANDLE { - GattClientCharacteristicConfigurationBuilder { + att::GattClientCharacteristicConfiguration { notification: 0, indication: self .clients @@ -72,8 +70,8 @@ impl GattDatastore for GattService { .unwrap_or(false) .into(), } - .to_vec() - .map_err(|_| AttErrorCode::UNLIKELY_ERROR) + .encode_to_vec() + .map_err(|_| AttErrorCode::UnlikelyError) } else { unreachable!() } @@ -87,18 +85,18 @@ impl GattDatastore for GattService { data: &[u8], ) -> Result<(), AttErrorCode> { if handle == SERVICE_CHANGE_CCC_DESCRIPTOR_HANDLE { - let ccc = GattClientCharacteristicConfigurationView::try_parse_from_buffer(data) - .map_err(|err| { + let ccc = + att::GattClientCharacteristicConfiguration::decode_full(data).map_err(|err| { warn!("failed to parse CCC descriptor, got: {err:?}"); - AttErrorCode::APPLICATION_ERROR + AttErrorCode::ApplicationError })?; let mut clients = self.clients.borrow_mut(); let state = clients.get_mut(&tcb_idx); let Some(state) = state else { error!("Received write request from disconnected client..."); - return Err(AttErrorCode::UNLIKELY_ERROR); + return Err(AttErrorCode::UnlikelyError); }; - state.registered_for_service_change = ccc.get_indication() != 0; + state.registered_for_service_change = ccc.indication != 0; Ok(()) } else { unreachable!() @@ -131,11 +129,11 @@ impl GattDatabaseCallbacks for GattService { spawn_local( bearer.send_indication( SERVICE_CHANGE_HANDLE, - GattServiceChangedBuilder { + att::GattServiceChanged { start_handle: (*range.start()).into(), end_handle: (*range.end()).into(), } - .to_vec() + .encode_to_vec() .unwrap(), ), ); @@ -191,7 +189,7 @@ mod test { }, }, }, - packets::{AttBuilder, AttChild}, + packets::att, utils::task::{block_on_locally, try_await}, }; @@ -209,7 +207,7 @@ mod test { fn add_connection( gatt_database: &SharedBox<GattDatabase>, tcb_idx: TransportIndex, - ) -> (AttDatabaseImpl, SharedBox<AttServerBearer<AttDatabaseImpl>>, UnboundedReceiver<AttBuilder>) + ) -> (AttDatabaseImpl, SharedBox<AttServerBearer<AttDatabaseImpl>>, UnboundedReceiver<att::Att>) { let att_database = gatt_database.get_att_database(tcb_idx); let (tx, rx) = unbounded_channel(); @@ -260,8 +258,8 @@ mod test { assert_eq!( Ok(resp), - GattClientCharacteristicConfigurationBuilder { notification: 0, indication: 0 } - .to_vec() + att::GattClientCharacteristicConfiguration { notification: 0, indication: 0 } + .encode_to_vec() ); } @@ -272,8 +270,8 @@ mod test { att_db .write_attribute( handle, - &GattClientCharacteristicConfigurationBuilder { notification: 0, indication: 1 } - .to_vec() + &att::GattClientCharacteristicConfiguration { notification: 0, indication: 1 } + .encode_to_vec() .unwrap(), ) .await @@ -295,8 +293,8 @@ mod test { // assert: we are registered for indications assert_eq!( Ok(resp), - GattClientCharacteristicConfigurationBuilder { notification: 0, indication: 1 } - .to_vec() + att::GattClientCharacteristicConfiguration { notification: 0, indication: 1 } + .encode_to_vec() ); } @@ -310,8 +308,8 @@ mod test { block_on_locally( att_db.write_attribute( SERVICE_CHANGE_CCC_DESCRIPTOR_HANDLE, - &GattClientCharacteristicConfigurationBuilder { notification: 0, indication: 1 } - .to_vec() + &att::GattClientCharacteristicConfiguration { notification: 0, indication: 1 } + .encode_to_vec() .unwrap(), ), ) @@ -320,8 +318,8 @@ mod test { block_on_locally( att_db.write_attribute( SERVICE_CHANGE_CCC_DESCRIPTOR_HANDLE, - &GattClientCharacteristicConfigurationBuilder { notification: 0, indication: 0 } - .to_vec() + &att::GattClientCharacteristicConfiguration { notification: 0, indication: 0 } + .encode_to_vec() .unwrap(), ), ) @@ -333,8 +331,8 @@ mod test { // assert: we are not registered for indications assert_eq!( Ok(resp), - GattClientCharacteristicConfigurationBuilder { notification: 0, indication: 0 } - .to_vec() + att::GattClientCharacteristicConfiguration { notification: 0, indication: 0 } + .encode_to_vec() ); } @@ -367,17 +365,14 @@ mod test { // assert: we received the service change indication let resp = rx.recv().await.unwrap(); - let AttChild::AttHandleValueIndication(resp) = resp._child_ else { + let Ok(resp): Result<att::AttHandleValueIndication, _> = resp.try_into() else { + unreachable!(); + }; + let Ok(resp) = att::GattServiceChanged::decode_full(resp.value.as_slice()) else { unreachable!(); }; - assert_eq!( - Ok(resp.value.into()), - GattServiceChangedBuilder { - start_handle: AttHandle(15).into(), - end_handle: AttHandle(17).into(), - } - .to_vec() - ); + assert_eq!(resp.start_handle.handle, 15); + assert_eq!(resp.end_handle.handle, 17); }); } @@ -415,8 +410,8 @@ mod test { // assert: both connections received the service change indication let resp1 = rx1.recv().await.unwrap(); let resp2 = rx2.recv().await.unwrap(); - assert!(matches!(resp1._child_, AttChild::AttHandleValueIndication(_))); - assert!(matches!(resp2._child_, AttChild::AttHandleValueIndication(_))); + assert!(matches!(resp1.try_into(), Ok(att::AttHandleValueIndication { .. }))); + assert!(matches!(resp2.try_into(), Ok(att::AttHandleValueIndication { .. }))); }); } @@ -452,7 +447,7 @@ mod test { // assert: the first connection received the service change indication let resp1 = rx1.recv().await.unwrap(); - assert!(matches!(resp1._child_, AttChild::AttHandleValueIndication(_))); + assert!(matches!(resp1.try_into(), Ok(att::AttHandleValueIndication { .. }))); // assert: the second connection received nothing assert!(try_await(async move { rx2.recv().await }).await.is_err()); }); @@ -494,7 +489,7 @@ mod test { // assert: the first connection received the service change indication let resp1 = rx1.recv().await.unwrap(); - assert!(matches!(resp1._child_, AttChild::AttHandleValueIndication(_))); + assert!(matches!(resp1.try_into(), Ok(att::AttHandleValueIndication { .. }))); // assert: the second connection is closed assert!(rx2.recv().await.is_none()); }); diff --git a/system/rust/src/gatt/server/test/test_att_db.rs b/system/rust/src/gatt/server/test/test_att_db.rs index 896f31d4f1..64752f51cf 100644 --- a/system/rust/src/gatt/server/test/test_att_db.rs +++ b/system/rust/src/gatt/server/test/test_att_db.rs @@ -3,7 +3,7 @@ use crate::{ ids::AttHandle, server::att_database::{AttAttribute, AttDatabase, StableAttDatabase}, }, - packets::AttErrorCode, + packets::att::AttErrorCode, }; use async_trait::async_trait; @@ -44,10 +44,10 @@ impl AttDatabase for TestAttDatabase { Some(TestAttributeWithData { attribute: AttAttribute { permissions, .. }, .. }) if !permissions.readable() => { - Err(AttErrorCode::READ_NOT_PERMITTED) + Err(AttErrorCode::ReadNotPermitted) } Some(TestAttributeWithData { data, .. }) => Ok(data.borrow().clone()), - None => Err(AttErrorCode::INVALID_HANDLE), + None => Err(AttErrorCode::InvalidHandle), } } async fn write_attribute(&self, handle: AttHandle, data: &[u8]) -> Result<(), AttErrorCode> { @@ -55,13 +55,13 @@ impl AttDatabase for TestAttDatabase { Some(TestAttributeWithData { attribute: AttAttribute { permissions, .. }, .. }) if !permissions.writable_with_response() => { - Err(AttErrorCode::WRITE_NOT_PERMITTED) + Err(AttErrorCode::WriteNotPermitted) } Some(TestAttributeWithData { data: data_cell, .. }) => { data_cell.replace(data.to_vec()); Ok(()) } - None => Err(AttErrorCode::INVALID_HANDLE), + None => Err(AttErrorCode::InvalidHandle), } } fn write_no_response_attribute(&self, handle: AttHandle, data: &[u8]) { diff --git a/system/rust/src/gatt/server/transactions/find_by_type_value.rs b/system/rust/src/gatt/server/transactions/find_by_type_value.rs index d3a463084a..382990f894 100644 --- a/system/rust/src/gatt/server/transactions/find_by_type_value.rs +++ b/system/rust/src/gatt/server/transactions/find_by_type_value.rs @@ -1,4 +1,5 @@ use log::warn; +use pdl_runtime::EncodeError; use crate::{ core::uuid::Uuid, @@ -6,10 +7,7 @@ use crate::{ ids::AttHandle, server::att_database::{AttAttribute, StableAttDatabase}, }, - packets::{ - AttChild, AttErrorCode, AttErrorResponseBuilder, AttFindByTypeValueRequestView, - AttFindByTypeValueResponseBuilder, AttOpcode, AttributeHandleRangeBuilder, - }, + packets::att::{self, AttErrorCode}, }; use super::helpers::{ @@ -18,34 +16,34 @@ use super::helpers::{ }; pub async fn handle_find_by_type_value_request( - request: AttFindByTypeValueRequestView<'_>, + request: att::AttFindByTypeValueRequest, mtu: usize, db: &impl StableAttDatabase, -) -> AttChild { +) -> Result<att::Att, EncodeError> { let Some(attrs) = filter_to_range( - request.get_starting_handle().into(), - request.get_ending_handle().into(), + request.starting_handle.clone().into(), + request.ending_handle.into(), db.list_attributes().into_iter(), ) else { - return AttErrorResponseBuilder { - opcode_in_error: AttOpcode::FIND_BY_TYPE_VALUE_REQUEST, - handle_in_error: AttHandle::from(request.get_starting_handle()).into(), - error_code: AttErrorCode::INVALID_HANDLE, + return att::AttErrorResponse { + opcode_in_error: att::AttOpcode::FindByTypeValueRequest, + handle_in_error: AttHandle::from(request.starting_handle).into(), + error_code: AttErrorCode::InvalidHandle, } - .into(); + .try_into(); }; // ATT_MTU-1 limit comes from Spec 5.3 Vol 3F Sec 3.4.3.4 let mut matches = PayloadAccumulator::new(mtu - 1); for attr @ AttAttribute { handle, type_, .. } in attrs { - if Uuid::from(request.get_attribute_type()) != type_ { + if Uuid::from(request.attribute_type.clone()) != type_ { continue; } if let Ok(value) = db.read_attribute(handle).await { - if value == request.get_attribute_value_iter().collect::<Vec<_>>() { + if value == request.attribute_value { // match found - if !matches.push(AttributeHandleRangeBuilder { + if !matches.push(att::AttributeHandleRange { found_attribute_handle: handle.into(), group_end_handle: find_group_end(db, attr) .map(|attr| attr.handle) @@ -61,14 +59,14 @@ pub async fn handle_find_by_type_value_request( } if matches.is_empty() { - AttErrorResponseBuilder { - opcode_in_error: AttOpcode::FIND_BY_TYPE_VALUE_REQUEST, - handle_in_error: AttHandle::from(request.get_starting_handle()).into(), - error_code: AttErrorCode::ATTRIBUTE_NOT_FOUND, + att::AttErrorResponse { + opcode_in_error: att::AttOpcode::FindByTypeValueRequest, + handle_in_error: request.starting_handle, + error_code: AttErrorCode::AttributeNotFound, } - .into() + .try_into() } else { - AttFindByTypeValueResponseBuilder { handles_info: matches.into_boxed_slice() }.into() + att::AttFindByTypeValueResponse { handles_info: matches.into_vec() }.try_into() } } @@ -84,8 +82,7 @@ mod test { test::test_att_db::TestAttDatabase, }, }, - packets::AttFindByTypeValueRequestBuilder, - utils::packet::build_view_or_crash, + packets::att, }; use super::*; @@ -127,34 +124,30 @@ mod test { ]); // act - let att_view = build_view_or_crash(AttFindByTypeValueRequestBuilder { + let att_view = att::AttFindByTypeValueRequest { starting_handle: AttHandle(3).into(), ending_handle: AttHandle(5).into(), attribute_type: UUID.try_into().unwrap(), - attribute_value: VALUE.into(), - }); - let response = - tokio_test::block_on(handle_find_by_type_value_request(att_view.view(), 128, &db)); + attribute_value: VALUE.to_vec(), + }; + let response = tokio_test::block_on(handle_find_by_type_value_request(att_view, 128, &db)); // assert: we only matched the ones with the correct UUID - let AttChild::AttFindByTypeValueResponse(response) = response else { - unreachable!("{response:?}") - }; assert_eq!( response, - AttFindByTypeValueResponseBuilder { - handles_info: [ - AttributeHandleRangeBuilder { + att::AttFindByTypeValueResponse { + handles_info: vec![ + att::AttributeHandleRange { found_attribute_handle: AttHandle(3).into(), group_end_handle: AttHandle(3).into(), }, - AttributeHandleRangeBuilder { + att::AttributeHandleRange { found_attribute_handle: AttHandle(5).into(), group_end_handle: AttHandle(5).into(), }, ] - .into() } + .try_into() ); } @@ -189,34 +182,30 @@ mod test { ]); // act - let att_view = build_view_or_crash(AttFindByTypeValueRequestBuilder { + let att_view = att::AttFindByTypeValueRequest { starting_handle: AttHandle(3).into(), ending_handle: AttHandle(5).into(), attribute_type: UUID.try_into().unwrap(), - attribute_value: VALUE.into(), - }); - let response = - tokio_test::block_on(handle_find_by_type_value_request(att_view.view(), 128, &db)); + attribute_value: VALUE.to_vec(), + }; + let response = tokio_test::block_on(handle_find_by_type_value_request(att_view, 128, &db)); // assert - let AttChild::AttFindByTypeValueResponse(response) = response else { - unreachable!("{response:?}") - }; assert_eq!( response, - AttFindByTypeValueResponseBuilder { - handles_info: [ - AttributeHandleRangeBuilder { + att::AttFindByTypeValueResponse { + handles_info: vec![ + att::AttributeHandleRange { found_attribute_handle: AttHandle(3).into(), group_end_handle: AttHandle(3).into(), }, - AttributeHandleRangeBuilder { + att::AttributeHandleRange { found_attribute_handle: AttHandle(5).into(), group_end_handle: AttHandle(5).into(), }, ] - .into() } + .try_into() ); } @@ -226,24 +215,23 @@ mod test { let db = TestAttDatabase::new(vec![]); // act: provide an invalid handle range - let att_view = build_view_or_crash(AttFindByTypeValueRequestBuilder { + let att_view = att::AttFindByTypeValueRequest { starting_handle: AttHandle(3).into(), ending_handle: AttHandle(1).into(), attribute_type: UUID.try_into().unwrap(), - attribute_value: VALUE.into(), - }); - let response = - tokio_test::block_on(handle_find_by_type_value_request(att_view.view(), 128, &db)); + attribute_value: VALUE.to_vec(), + }; + let response = tokio_test::block_on(handle_find_by_type_value_request(att_view, 128, &db)); // assert - let AttChild::AttErrorResponse(response) = response else { unreachable!("{response:?}") }; assert_eq!( response, - AttErrorResponseBuilder { - opcode_in_error: AttOpcode::FIND_BY_TYPE_VALUE_REQUEST, + att::AttErrorResponse { + opcode_in_error: att::AttOpcode::FindByTypeValueRequest, handle_in_error: AttHandle(3).into(), - error_code: AttErrorCode::INVALID_HANDLE, + error_code: AttErrorCode::InvalidHandle, } + .try_into() ); } @@ -260,24 +248,23 @@ mod test { )]); // act: query using a range that does not overlap with matching attributes - let att_view = build_view_or_crash(AttFindByTypeValueRequestBuilder { + let att_view = att::AttFindByTypeValueRequest { starting_handle: AttHandle(4).into(), ending_handle: AttHandle(5).into(), attribute_type: UUID.try_into().unwrap(), - attribute_value: VALUE.into(), - }); - let response = - tokio_test::block_on(handle_find_by_type_value_request(att_view.view(), 128, &db)); + attribute_value: VALUE.to_vec(), + }; + let response = tokio_test::block_on(handle_find_by_type_value_request(att_view, 128, &db)); - // assert: got ATTRIBUTE_NOT_FOUND erro - let AttChild::AttErrorResponse(response) = response else { unreachable!("{response:?}") }; + // assert: got ATTRIBUTE_NOT_FOUND error assert_eq!( response, - AttErrorResponseBuilder { - opcode_in_error: AttOpcode::FIND_BY_TYPE_VALUE_REQUEST, + att::AttErrorResponse { + opcode_in_error: att::AttOpcode::FindByTypeValueRequest, handle_in_error: AttHandle(4).into(), - error_code: AttErrorCode::ATTRIBUTE_NOT_FOUND, + error_code: AttErrorCode::AttributeNotFound, } + .try_into() ); } @@ -312,28 +299,24 @@ mod test { ]); // act: look for a particular characteristic declaration - let att_view = build_view_or_crash(AttFindByTypeValueRequestBuilder { + let att_view = att::AttFindByTypeValueRequest { starting_handle: AttHandle(3).into(), ending_handle: AttHandle(4).into(), attribute_type: CHARACTERISTIC_UUID.try_into().unwrap(), - attribute_value: VALUE.into(), - }); - let response = - tokio_test::block_on(handle_find_by_type_value_request(att_view.view(), 128, &db)); + attribute_value: VALUE.to_vec(), + }; + let response = tokio_test::block_on(handle_find_by_type_value_request(att_view, 128, &db)); // assert - let AttChild::AttFindByTypeValueResponse(response) = response else { - unreachable!("{response:?}") - }; assert_eq!( response, - AttFindByTypeValueResponseBuilder { - handles_info: [AttributeHandleRangeBuilder { + att::AttFindByTypeValueResponse { + handles_info: vec![att::AttributeHandleRange { found_attribute_handle: AttHandle(3).into(), group_end_handle: AttHandle(4).into(), },] - .into() } + .try_into() ); } @@ -360,28 +343,24 @@ mod test { ]); // act: use MTU = 5, so we can only fit one element in the output - let att_view = build_view_or_crash(AttFindByTypeValueRequestBuilder { + let att_view = att::AttFindByTypeValueRequest { starting_handle: AttHandle(3).into(), ending_handle: AttHandle(4).into(), attribute_type: UUID.try_into().unwrap(), - attribute_value: VALUE.into(), - }); - let response = - tokio_test::block_on(handle_find_by_type_value_request(att_view.view(), 5, &db)); + attribute_value: VALUE.to_vec(), + }; + let response = tokio_test::block_on(handle_find_by_type_value_request(att_view, 5, &db)); // assert: only one of the two matches produced - let AttChild::AttFindByTypeValueResponse(response) = response else { - unreachable!("{response:?}") - }; assert_eq!( response, - AttFindByTypeValueResponseBuilder { - handles_info: [AttributeHandleRangeBuilder { + att::AttFindByTypeValueResponse { + handles_info: vec![att::AttributeHandleRange { found_attribute_handle: AttHandle(3).into(), group_end_handle: AttHandle(3).into(), },] - .into() } + .try_into() ); } } diff --git a/system/rust/src/gatt/server/transactions/find_information_request.rs b/system/rust/src/gatt/server/transactions/find_information_request.rs index 26a573ffe0..e9079f3a1d 100644 --- a/system/rust/src/gatt/server/transactions/find_information_request.rs +++ b/system/rust/src/gatt/server/transactions/find_information_request.rs @@ -1,56 +1,40 @@ use crate::{ - gatt::{ - ids::AttHandle, - server::att_database::{AttAttribute, AttDatabase}, - }, - packets::{ - AttChild, AttErrorCode, AttErrorResponseBuilder, AttFindInformationLongResponseBuilder, - AttFindInformationRequestView, AttFindInformationResponseBuilder, - AttFindInformationResponseFormat, AttFindInformationResponseLongEntryBuilder, - AttFindInformationResponseShortEntryBuilder, AttFindInformationShortResponseBuilder, - AttOpcode, - }, + gatt::server::att_database::{AttAttribute, AttDatabase}, + packets::att::{self, AttErrorCode}, }; +use pdl_runtime::EncodeError; use super::helpers::{att_range_filter::filter_to_range, payload_accumulator::PayloadAccumulator}; pub fn handle_find_information_request<T: AttDatabase>( - request: AttFindInformationRequestView<'_>, + request: att::AttFindInformationRequest, mtu: usize, db: &T, -) -> AttChild { +) -> Result<att::Att, EncodeError> { let Some(attrs) = filter_to_range( - request.get_starting_handle().into(), - request.get_ending_handle().into(), + request.starting_handle.clone().into(), + request.ending_handle.into(), db.list_attributes().into_iter(), ) else { - return AttErrorResponseBuilder { - opcode_in_error: AttOpcode::FIND_INFORMATION_REQUEST, - handle_in_error: AttHandle::from(request.get_starting_handle()).into(), - error_code: AttErrorCode::INVALID_HANDLE, + return att::AttErrorResponse { + opcode_in_error: att::AttOpcode::FindInformationRequest, + handle_in_error: request.starting_handle.clone(), + error_code: AttErrorCode::InvalidHandle, } - .into(); + .try_into(); }; if let Some(resp) = handle_find_information_request_short(attrs.clone(), mtu) { - AttFindInformationResponseBuilder { - format: AttFindInformationResponseFormat::SHORT, - _child_: resp.into(), - } - .into() + resp.try_into() } else if let Some(resp) = handle_find_information_request_long(attrs, mtu) { - AttFindInformationResponseBuilder { - format: AttFindInformationResponseFormat::LONG, - _child_: resp.into(), - } - .into() + resp.try_into() } else { - AttErrorResponseBuilder { - opcode_in_error: AttOpcode::FIND_INFORMATION_REQUEST, - handle_in_error: AttHandle::from(request.get_starting_handle()).into(), - error_code: AttErrorCode::ATTRIBUTE_NOT_FOUND, + att::AttErrorResponse { + opcode_in_error: att::AttOpcode::FindInformationRequest, + handle_in_error: request.starting_handle, + error_code: AttErrorCode::AttributeNotFound, } - .into() + .try_into() } } @@ -59,13 +43,12 @@ pub fn handle_find_information_request<T: AttDatabase>( fn handle_find_information_request_short( attributes: impl Iterator<Item = AttAttribute>, mtu: usize, -) -> Option<AttFindInformationShortResponseBuilder> { +) -> Option<att::AttFindInformationShortResponse> { // Core Spec 5.3 Vol 3F 3.4.3.2 gives the ATT_MTU - 2 limit let mut out = PayloadAccumulator::new(mtu - 2); for AttAttribute { handle, type_: uuid, .. } in attributes { if let Ok(uuid) = uuid.try_into() { - if out.push(AttFindInformationResponseShortEntryBuilder { handle: handle.into(), uuid }) - { + if out.push(att::AttFindInformationResponseShortEntry { handle: handle.into(), uuid }) { // If we successfully pushed a 16-bit UUID, continue. In all other cases, we // should break. continue; @@ -77,19 +60,19 @@ fn handle_find_information_request_short( if out.is_empty() { None } else { - Some(AttFindInformationShortResponseBuilder { data: out.into_boxed_slice() }) + Some(att::AttFindInformationShortResponse { data: out.into_vec() }) } } fn handle_find_information_request_long( attributes: impl Iterator<Item = AttAttribute>, mtu: usize, -) -> Option<AttFindInformationLongResponseBuilder> { +) -> Option<att::AttFindInformationLongResponse> { // Core Spec 5.3 Vol 3F 3.4.3.2 gives the ATT_MTU - 2 limit let mut out = PayloadAccumulator::new(mtu - 2); for AttAttribute { handle, type_: uuid, .. } in attributes { - if !out.push(AttFindInformationResponseLongEntryBuilder { + if !out.push(att::AttFindInformationResponseLongEntry { handle: handle.into(), uuid: uuid.into(), }) { @@ -100,17 +83,17 @@ fn handle_find_information_request_long( if out.is_empty() { None } else { - Some(AttFindInformationLongResponseBuilder { data: out.into_boxed_slice() }) + Some(att::AttFindInformationLongResponse { data: out.into_vec() }) } } #[cfg(test)] mod test { + use crate::gatt::server::AttHandle; use crate::{ core::uuid::Uuid, gatt::server::{gatt_database::AttPermissions, test::test_att_db::TestAttDatabase}, - packets::AttFindInformationRequestBuilder, - utils::packet::build_view_or_crash, + packets::att, }; use super::*; @@ -146,35 +129,28 @@ mod test { ]); // act - let att_view = build_view_or_crash(AttFindInformationRequestBuilder { + let att_view = att::AttFindInformationRequest { starting_handle: AttHandle(3).into(), ending_handle: AttHandle(4).into(), - }); - let response = handle_find_information_request(att_view.view(), 128, &db); + }; + let response = handle_find_information_request(att_view, 128, &db); // assert - let AttChild::AttFindInformationResponse(response) = response else { - unreachable!("{response:?}"); - }; assert_eq!( response, - AttFindInformationResponseBuilder { - format: AttFindInformationResponseFormat::LONG, - _child_: AttFindInformationLongResponseBuilder { - data: [ - AttFindInformationResponseLongEntryBuilder { - handle: AttHandle(3).into(), - uuid: Uuid::new(0x01020304).into(), - }, - AttFindInformationResponseLongEntryBuilder { - handle: AttHandle(4).into(), - uuid: Uuid::new(0x01020305).into(), - } - ] - .into() - } - .into() + att::AttFindInformationLongResponse { + data: vec![ + att::AttFindInformationResponseLongEntry { + handle: AttHandle(3).into(), + uuid: Uuid::new(0x01020304).into(), + }, + att::AttFindInformationResponseLongEntry { + handle: AttHandle(4).into(), + uuid: Uuid::new(0x01020305).into(), + } + ] } + .try_into() ); } @@ -209,35 +185,28 @@ mod test { ]); // act - let att_view = build_view_or_crash(AttFindInformationRequestBuilder { + let att_view = att::AttFindInformationRequest { starting_handle: AttHandle(3).into(), ending_handle: AttHandle(5).into(), - }); - let response = handle_find_information_request(att_view.view(), 128, &db); + }; + let response = handle_find_information_request(att_view, 128, &db); // assert - let AttChild::AttFindInformationResponse(response) = response else { - unreachable!("{response:?}"); - }; assert_eq!( response, - AttFindInformationResponseBuilder { - format: AttFindInformationResponseFormat::SHORT, - _child_: AttFindInformationShortResponseBuilder { - data: [ - AttFindInformationResponseShortEntryBuilder { - handle: AttHandle(3).into(), - uuid: Uuid::new(0x0102).try_into().unwrap(), - }, - AttFindInformationResponseShortEntryBuilder { - handle: AttHandle(4).into(), - uuid: Uuid::new(0x0103).try_into().unwrap(), - } - ] - .into() - } - .into() + att::AttFindInformationShortResponse { + data: vec![ + att::AttFindInformationResponseShortEntry { + handle: AttHandle(3).into(), + uuid: Uuid::new(0x0102).try_into().unwrap(), + }, + att::AttFindInformationResponseShortEntry { + handle: AttHandle(4).into(), + uuid: Uuid::new(0x0103).try_into().unwrap(), + } + ] } + .try_into() ); } @@ -247,23 +216,21 @@ mod test { let db = TestAttDatabase::new(vec![]); // act: use an invalid handle range - let att_view = build_view_or_crash(AttFindInformationRequestBuilder { + let att_view = att::AttFindInformationRequest { starting_handle: AttHandle(3).into(), ending_handle: AttHandle(2).into(), - }); - let response = handle_find_information_request(att_view.view(), 128, &db); + }; + let response = handle_find_information_request(att_view, 128, &db); // assert: got INVALID_HANDLE - let AttChild::AttErrorResponse(response) = response else { - unreachable!("{response:?}"); - }; assert_eq!( response, - AttErrorResponseBuilder { - opcode_in_error: AttOpcode::FIND_INFORMATION_REQUEST, + att::AttErrorResponse { + opcode_in_error: att::AttOpcode::FindInformationRequest, handle_in_error: AttHandle(3).into(), - error_code: AttErrorCode::INVALID_HANDLE, + error_code: AttErrorCode::InvalidHandle, } + .try_into() ); } @@ -290,29 +257,22 @@ mod test { ]); // act: use MTU = 6, so only one entry can fit - let att_view = build_view_or_crash(AttFindInformationRequestBuilder { + let att_view = att::AttFindInformationRequest { starting_handle: AttHandle(3).into(), ending_handle: AttHandle(5).into(), - }); - let response = handle_find_information_request(att_view.view(), 6, &db); + }; + let response = handle_find_information_request(att_view, 6, &db); // assert: only one entry (not two) provided - let AttChild::AttFindInformationResponse(response) = response else { - unreachable!("{response:?}"); - }; assert_eq!( response, - AttFindInformationResponseBuilder { - format: AttFindInformationResponseFormat::SHORT, - _child_: AttFindInformationShortResponseBuilder { - data: [AttFindInformationResponseShortEntryBuilder { - handle: AttHandle(3).into(), - uuid: Uuid::new(0x0102).try_into().unwrap(), - },] - .into() - } - .into() + att::AttFindInformationShortResponse { + data: vec![att::AttFindInformationResponseShortEntry { + handle: AttHandle(3).into(), + uuid: Uuid::new(0x0102).try_into().unwrap(), + },] } + .try_into() ); } @@ -329,23 +289,21 @@ mod test { )]); // act: use a range that matches no attributes - let att_view = build_view_or_crash(AttFindInformationRequestBuilder { + let att_view = att::AttFindInformationRequest { starting_handle: AttHandle(4).into(), ending_handle: AttHandle(5).into(), - }); - let response = handle_find_information_request(att_view.view(), 6, &db); + }; + let response = handle_find_information_request(att_view, 6, &db); // assert: got ATTRIBUTE_NOT_FOUND - let AttChild::AttErrorResponse(response) = response else { - unreachable!("{response:?}"); - }; assert_eq!( response, - AttErrorResponseBuilder { - opcode_in_error: AttOpcode::FIND_INFORMATION_REQUEST, + att::AttErrorResponse { + opcode_in_error: att::AttOpcode::FindInformationRequest, handle_in_error: AttHandle(4).into(), - error_code: AttErrorCode::ATTRIBUTE_NOT_FOUND, + error_code: AttErrorCode::AttributeNotFound, } + .try_into() ); } } diff --git a/system/rust/src/gatt/server/transactions/helpers/att_filter_by_size_type.rs b/system/rust/src/gatt/server/transactions/helpers/att_filter_by_size_type.rs index ac93459bcf..1674597bc4 100644 --- a/system/rust/src/gatt/server/transactions/helpers/att_filter_by_size_type.rs +++ b/system/rust/src/gatt/server/transactions/helpers/att_filter_by_size_type.rs @@ -4,7 +4,7 @@ use crate::{ core::uuid::Uuid, gatt::server::att_database::{AttAttribute, StableAttDatabase}, - packets::AttErrorCode, + packets::att::AttErrorCode, }; /// An attribute and the value @@ -108,7 +108,7 @@ mod test { response.collect::<Vec<_>>(), vec![AttributeWithValue { attr: db.find_attribute(AttHandle(3)).unwrap(), - value: vec![4, 5] + value: vec![4, 5], }] ) } @@ -287,7 +287,7 @@ mod test { )); // assert: got READ_NOT_PERMITTED - assert!(matches!(response, Err(AttErrorCode::READ_NOT_PERMITTED))); + assert!(matches!(response, Err(AttErrorCode::ReadNotPermitted))); } #[test] diff --git a/system/rust/src/gatt/server/transactions/helpers/payload_accumulator.rs b/system/rust/src/gatt/server/transactions/helpers/payload_accumulator.rs index 72aa46b367..f372e1f6ae 100644 --- a/system/rust/src/gatt/server/transactions/helpers/payload_accumulator.rs +++ b/system/rust/src/gatt/server/transactions/helpers/payload_accumulator.rs @@ -1,21 +1,19 @@ -use crate::packets::Builder; - -pub struct PayloadAccumulator<T: Builder> { +pub struct PayloadAccumulator<T: pdl_runtime::Packet> { curr: usize, lim: usize, elems: Vec<T>, } -impl<T: Builder> PayloadAccumulator<T> { +impl<T: pdl_runtime::Packet> PayloadAccumulator<T> { pub fn new(size: usize) -> Self { - Self { curr: 0, lim: size * 8, elems: vec![] } + Self { curr: 0, lim: size, elems: vec![] } } #[must_use] pub fn push(&mut self, builder: T) -> bool { // if serialization fails we WANT to continue, to get a clean SerializeError at // the end - let elem_size = builder.size_in_bits().unwrap_or(0); + let elem_size = builder.encoded_len(); if elem_size + self.curr > self.lim { return false; } @@ -24,8 +22,8 @@ impl<T: Builder> PayloadAccumulator<T> { true } - pub fn into_boxed_slice(self) -> Box<[T]> { - self.elems.into_boxed_slice() + pub fn into_vec(self) -> Vec<T> { + self.elems } pub fn is_empty(&self) -> bool { @@ -35,23 +33,21 @@ impl<T: Builder> PayloadAccumulator<T> { #[cfg(test)] mod test { - use crate::packets::{AttBuilder, AttChild, AttOpcode}; + use crate::packets::att; use super::PayloadAccumulator; #[test] fn test_empty() { - let accumulator = PayloadAccumulator::<AttBuilder>::new(0); + let accumulator = PayloadAccumulator::<att::Att>::new(0); assert!(accumulator.is_empty()) } #[test] fn test_nonempty() { let mut accumulator = PayloadAccumulator::new(128); - let ok = accumulator.push(AttBuilder { - opcode: AttOpcode::WRITE_RESPONSE, - _child_: AttChild::RawData([1, 2].into()), - }); + let ok = accumulator + .push(att::Att { opcode: att::AttOpcode::WriteResponse, payload: vec![1, 2] }); assert!(ok); assert!(!accumulator.is_empty()) @@ -61,18 +57,13 @@ mod test { fn test_push_serialize() { let mut accumulator = PayloadAccumulator::new(128); - let ok = accumulator.push(AttBuilder { - opcode: AttOpcode::WRITE_RESPONSE, - _child_: AttChild::RawData([1, 2].into()), - }); + let ok = accumulator + .push(att::Att { opcode: att::AttOpcode::WriteResponse, payload: vec![1, 2] }); assert!(ok); assert_eq!( - accumulator.into_boxed_slice().as_ref(), - [AttBuilder { - opcode: AttOpcode::WRITE_RESPONSE, - _child_: AttChild::RawData([1, 2].into()), - }] + accumulator.into_vec().as_ref(), + [att::Att { opcode: att::AttOpcode::WriteResponse, payload: vec![1, 2] }] ); } @@ -81,25 +72,18 @@ mod test { let mut accumulator = PayloadAccumulator::new(5); // each builder is 3 bytes, so the first should succeed, the second should fail - let first_ok = accumulator.push(AttBuilder { - opcode: AttOpcode::WRITE_RESPONSE, - _child_: AttChild::RawData([1, 2].into()), - }); - let second_ok = accumulator.push(AttBuilder { - opcode: AttOpcode::WRITE_RESPONSE, - _child_: AttChild::RawData([3, 4].into()), - }); + let first_ok = accumulator + .push(att::Att { opcode: att::AttOpcode::WriteResponse, payload: vec![1, 2] }); + let second_ok = accumulator + .push(att::Att { opcode: att::AttOpcode::WriteResponse, payload: vec![3, 4] }); // assert: the first one is pushed and is correctly output, but the second is // dropped assert!(first_ok); assert!(!second_ok); assert_eq!( - accumulator.into_boxed_slice().as_ref(), - [AttBuilder { - opcode: AttOpcode::WRITE_RESPONSE, - _child_: AttChild::RawData([1, 2].into()), - }] + accumulator.into_vec().as_ref(), + [att::Att { opcode: att::AttOpcode::WriteResponse, payload: vec![1, 2] }] ); } @@ -108,29 +92,19 @@ mod test { let mut accumulator = PayloadAccumulator::new(5); // 3 + 2 bytes = the size, so both should push correctly - let first_ok = accumulator.push(AttBuilder { - opcode: AttOpcode::WRITE_RESPONSE, - _child_: AttChild::RawData([1, 2].into()), - }); - let second_ok = accumulator.push(AttBuilder { - opcode: AttOpcode::WRITE_RESPONSE, - _child_: AttChild::RawData([3].into()), - }); + let first_ok = accumulator + .push(att::Att { opcode: att::AttOpcode::WriteResponse, payload: vec![1, 2] }); + let second_ok = + accumulator.push(att::Att { opcode: att::AttOpcode::WriteResponse, payload: vec![3] }); // assert: both are pushed and output correctly assert!(first_ok); assert!(second_ok); assert_eq!( - accumulator.into_boxed_slice().as_ref(), + accumulator.into_vec().as_ref(), [ - AttBuilder { - opcode: AttOpcode::WRITE_RESPONSE, - _child_: AttChild::RawData([1, 2].into()), - }, - AttBuilder { - opcode: AttOpcode::WRITE_RESPONSE, - _child_: AttChild::RawData([3].into()), - } + att::Att { opcode: att::AttOpcode::WriteResponse, payload: vec![1, 2] }, + att::Att { opcode: att::AttOpcode::WriteResponse, payload: vec![3] } ] ); } diff --git a/system/rust/src/gatt/server/transactions/read_by_group_type_request.rs b/system/rust/src/gatt/server/transactions/read_by_group_type_request.rs index 762b8ce196..319d5e6c45 100644 --- a/system/rust/src/gatt/server/transactions/read_by_group_type_request.rs +++ b/system/rust/src/gatt/server/transactions/read_by_group_type_request.rs @@ -1,18 +1,12 @@ use crate::{ core::uuid::Uuid, - gatt::{ - ids::AttHandle, - server::{ - att_database::StableAttDatabase, - gatt_database::{PRIMARY_SERVICE_DECLARATION_UUID, SECONDARY_SERVICE_DECLARATION_UUID}, - }, - }, - packets::{ - AttChild, AttErrorCode, AttErrorResponseBuilder, AttOpcode, - AttReadByGroupTypeDataElementBuilder, AttReadByGroupTypeRequestView, - AttReadByGroupTypeResponseBuilder, ParseError, + gatt::server::{ + att_database::StableAttDatabase, + gatt_database::{PRIMARY_SERVICE_DECLARATION_UUID, SECONDARY_SERVICE_DECLARATION_UUID}, }, + packets::att::{self, AttErrorCode}, }; +use pdl_runtime::EncodeError; use super::helpers::{ att_filter_by_size_type::{filter_read_attributes_by_size_type, AttributeWithValue}, @@ -22,12 +16,10 @@ use super::helpers::{ }; pub async fn handle_read_by_group_type_request( - request: AttReadByGroupTypeRequestView<'_>, + request: att::AttReadByGroupTypeRequest, mtu: usize, db: &impl StableAttDatabase, -) -> Result<AttChild, ParseError> { - let group_type: Uuid = request.get_attribute_group_type().try_into()?; - +) -> Result<att::Att, EncodeError> { // As per spec (5.3 Vol 3F 3.4.4.9) // > If an attribute in the set of requested attributes would cause an // > ATT_ERROR_RSP PDU then this attribute cannot be included in an @@ -36,20 +28,25 @@ pub async fn handle_read_by_group_type_request( // // Thus, we populate this response on failure, but only return it if no prior // matches were accumulated. - let mut failure_response = AttErrorResponseBuilder { - opcode_in_error: AttOpcode::READ_BY_GROUP_TYPE_REQUEST, - handle_in_error: AttHandle::from(request.get_starting_handle()).into(), + let mut failure_response = att::AttErrorResponse { + opcode_in_error: request.opcode(), + handle_in_error: request.starting_handle.clone(), // the default error code if we just fail to find anything - error_code: AttErrorCode::ATTRIBUTE_NOT_FOUND, + error_code: AttErrorCode::AttributeNotFound, + }; + + let Ok(group_type): Result<Uuid, _> = request.attribute_group_type.try_into() else { + failure_response.error_code = AttErrorCode::InvalidPdu; + return failure_response.try_into(); }; let Some(attrs) = filter_to_range( - request.get_starting_handle().into(), - request.get_ending_handle().into(), + request.starting_handle.into(), + request.ending_handle.into(), db.list_attributes().into_iter(), ) else { - failure_response.error_code = AttErrorCode::INVALID_HANDLE; - return Ok(failure_response.into()); + failure_response.error_code = AttErrorCode::InvalidHandle; + return failure_response.try_into(); }; // As per Core Spec 5.3 Vol 3G 2.5.3 Attribute Grouping, only these UUIDs are @@ -57,8 +54,8 @@ pub async fn handle_read_by_group_type_request( // UUIDs do exist) if !matches!(group_type, PRIMARY_SERVICE_DECLARATION_UUID | SECONDARY_SERVICE_DECLARATION_UUID) { - failure_response.error_code = AttErrorCode::UNSUPPORTED_GROUP_TYPE; - return Ok(failure_response.into()); + failure_response.error_code = AttErrorCode::UnsupportedGroupType; + return failure_response.try_into(); } // MTU-2 limit comes from Core Spec 5.3 Vol 3F 3.4.4.9 @@ -68,13 +65,13 @@ pub async fn handle_read_by_group_type_request( match filter_read_attributes_by_size_type(db, attrs, group_type, mtu - 6).await { Ok(attrs) => { for AttributeWithValue { attr, value } in attrs { - if !matches.push(AttReadByGroupTypeDataElementBuilder { + if !matches.push(att::AttReadByGroupTypeDataElement { handle: attr.handle.into(), end_group_handle: find_group_end(db, attr) .expect("should never be None, since grouping UUID was validated earlier") .handle .into(), - value: value.into(), + value, }) { break; } @@ -82,15 +79,15 @@ pub async fn handle_read_by_group_type_request( } Err(err) => { failure_response.error_code = err; - return Ok(failure_response.into()); + return failure_response.try_into(); } } - Ok(if matches.is_empty() { - failure_response.into() + if matches.is_empty() { + failure_response.try_into() } else { - AttReadByGroupTypeResponseBuilder { data: matches.into_boxed_slice() }.into() - }) + att::AttReadByGroupTypeResponse { data: matches.into_vec() }.try_into() + } } #[cfg(test)] @@ -104,8 +101,7 @@ mod test { test::test_att_db::TestAttDatabase, }, }, - packets::AttReadByGroupTypeRequestBuilder, - utils::packet::build_view_or_crash, + packets::att, }; use super::*; @@ -141,36 +137,31 @@ mod test { ]); // act - let att_view = build_view_or_crash(AttReadByGroupTypeRequestBuilder { + let att_view = att::AttReadByGroupTypeRequest { starting_handle: AttHandle(2).into(), ending_handle: AttHandle(6).into(), attribute_group_type: PRIMARY_SERVICE_DECLARATION_UUID.into(), - }); - let response = - tokio_test::block_on(handle_read_by_group_type_request(att_view.view(), 31, &db)) - .unwrap(); + }; + let response = tokio_test::block_on(handle_read_by_group_type_request(att_view, 31, &db)); // assert: we identified both service groups - let AttChild::AttReadByGroupTypeResponse(response) = response else { - unreachable!("{:?}", response) - }; assert_eq!( response, - AttReadByGroupTypeResponseBuilder { - data: [ - AttReadByGroupTypeDataElementBuilder { + att::AttReadByGroupTypeResponse { + data: vec![ + att::AttReadByGroupTypeDataElement { handle: AttHandle(3).into(), end_group_handle: AttHandle(4).into(), - value: [4, 5].into(), + value: vec![4, 5], }, - AttReadByGroupTypeDataElementBuilder { + att::AttReadByGroupTypeDataElement { handle: AttHandle(5).into(), end_group_handle: AttHandle(5).into(), - value: [6, 7].into(), + value: vec![6, 7], }, ] - .into() } + .try_into() ); } @@ -180,24 +171,22 @@ mod test { let db = TestAttDatabase::new(vec![]); // act: try using an unsupported group type - let att_view = build_view_or_crash(AttReadByGroupTypeRequestBuilder { + let att_view = att::AttReadByGroupTypeRequest { starting_handle: AttHandle(2).into(), ending_handle: AttHandle(6).into(), attribute_group_type: CHARACTERISTIC_UUID.into(), - }); - let response = - tokio_test::block_on(handle_read_by_group_type_request(att_view.view(), 31, &db)) - .unwrap(); + }; + let response = tokio_test::block_on(handle_read_by_group_type_request(att_view, 31, &db)); // assert: got UNSUPPORTED_GROUP_TYPE - let AttChild::AttErrorResponse(response) = response else { unreachable!("{:?}", response) }; assert_eq!( response, - AttErrorResponseBuilder { + att::AttErrorResponse { handle_in_error: AttHandle(2).into(), - opcode_in_error: AttOpcode::READ_BY_GROUP_TYPE_REQUEST, - error_code: AttErrorCode::UNSUPPORTED_GROUP_TYPE, + opcode_in_error: att::AttOpcode::ReadByGroupTypeRequest, + error_code: AttErrorCode::UnsupportedGroupType, } + .try_into() ); } @@ -207,24 +196,22 @@ mod test { let db = TestAttDatabase::new(vec![]); // act: query with an invalid attribute range - let att_view = build_view_or_crash(AttReadByGroupTypeRequestBuilder { + let att_view = att::AttReadByGroupTypeRequest { starting_handle: AttHandle(3).into(), ending_handle: AttHandle(2).into(), attribute_group_type: PRIMARY_SERVICE_DECLARATION_UUID.into(), - }); - let response = - tokio_test::block_on(handle_read_by_group_type_request(att_view.view(), 31, &db)) - .unwrap(); + }; + let response = tokio_test::block_on(handle_read_by_group_type_request(att_view, 31, &db)); // assert: we return an INVALID_HANDLE error - let AttChild::AttErrorResponse(response) = response else { unreachable!("{:?}", response) }; assert_eq!( response, - AttErrorResponseBuilder { + att::AttErrorResponse { handle_in_error: AttHandle(3).into(), - opcode_in_error: AttOpcode::READ_BY_GROUP_TYPE_REQUEST, - error_code: AttErrorCode::INVALID_HANDLE, + opcode_in_error: att::AttOpcode::ReadByGroupTypeRequest, + error_code: AttErrorCode::InvalidHandle, } + .try_into() ) } @@ -242,29 +229,24 @@ mod test { // act: read the service value with MTU = 7, so the value is truncated to MTU-6 // = 1 - let att_view = build_view_or_crash(AttReadByGroupTypeRequestBuilder { + let att_view = att::AttReadByGroupTypeRequest { starting_handle: AttHandle(2).into(), ending_handle: AttHandle(6).into(), attribute_group_type: PRIMARY_SERVICE_DECLARATION_UUID.into(), - }); - let response = - tokio_test::block_on(handle_read_by_group_type_request(att_view.view(), 7, &db)) - .unwrap(); + }; + let response = tokio_test::block_on(handle_read_by_group_type_request(att_view, 7, &db)); // assert: we identified both service groups - let AttChild::AttReadByGroupTypeResponse(response) = response else { - unreachable!("{:?}", response) - }; assert_eq!( response, - AttReadByGroupTypeResponseBuilder { - data: [AttReadByGroupTypeDataElementBuilder { + att::AttReadByGroupTypeResponse { + data: vec![att::AttReadByGroupTypeDataElement { handle: AttHandle(3).into(), end_group_handle: AttHandle(3).into(), - value: [1].into(), + value: vec![1], },] - .into() } + .try_into() ); } @@ -291,29 +273,24 @@ mod test { ]); // act: read with MTU = 9, so we can only fit the first attribute (untruncated) - let att_view = build_view_or_crash(AttReadByGroupTypeRequestBuilder { + let att_view = att::AttReadByGroupTypeRequest { starting_handle: AttHandle(3).into(), ending_handle: AttHandle(6).into(), attribute_group_type: PRIMARY_SERVICE_DECLARATION_UUID.into(), - }); - let response = - tokio_test::block_on(handle_read_by_group_type_request(att_view.view(), 9, &db)) - .unwrap(); + }; + let response = tokio_test::block_on(handle_read_by_group_type_request(att_view, 9, &db)); // assert: we return only the first attribute - let AttChild::AttReadByGroupTypeResponse(response) = response else { - unreachable!("{:?}", response) - }; assert_eq!( response, - AttReadByGroupTypeResponseBuilder { - data: [AttReadByGroupTypeDataElementBuilder { + att::AttReadByGroupTypeResponse { + data: vec![att::AttReadByGroupTypeDataElement { handle: AttHandle(3).into(), end_group_handle: AttHandle(3).into(), - value: [4, 5, 6].into() + value: vec![4, 5, 6], },] - .into() } + .try_into() ) } @@ -340,30 +317,25 @@ mod test { ]); // act: search in an interval that includes the service but not its child - let att_view = build_view_or_crash(AttReadByGroupTypeRequestBuilder { + let att_view = att::AttReadByGroupTypeRequest { starting_handle: AttHandle(3).into(), ending_handle: AttHandle(3).into(), attribute_group_type: PRIMARY_SERVICE_DECLARATION_UUID.into(), - }); - let response = - tokio_test::block_on(handle_read_by_group_type_request(att_view.view(), 31, &db)) - .unwrap(); + }; + let response = tokio_test::block_on(handle_read_by_group_type_request(att_view, 31, &db)); // assert: the end_group_handle is correct, even though it exceeds the query // interval - let AttChild::AttReadByGroupTypeResponse(response) = response else { - unreachable!("{:?}", response) - }; assert_eq!( response, - AttReadByGroupTypeResponseBuilder { - data: [AttReadByGroupTypeDataElementBuilder { + att::AttReadByGroupTypeResponse { + data: vec![att::AttReadByGroupTypeDataElement { handle: AttHandle(3).into(), end_group_handle: AttHandle(4).into(), - value: [4, 5].into(), + value: vec![4, 5], },] - .into() } + .try_into() ); } @@ -390,24 +362,22 @@ mod test { ]); // act - let att_view = build_view_or_crash(AttReadByGroupTypeRequestBuilder { + let att_view = att::AttReadByGroupTypeRequest { starting_handle: AttHandle(5).into(), ending_handle: AttHandle(6).into(), attribute_group_type: PRIMARY_SERVICE_DECLARATION_UUID.into(), - }); - let response = - tokio_test::block_on(handle_read_by_group_type_request(att_view.view(), 31, &db)) - .unwrap(); + }; + let response = tokio_test::block_on(handle_read_by_group_type_request(att_view, 31, &db)); // assert: we return ATTRIBUTE_NOT_FOUND - let AttChild::AttErrorResponse(response) = response else { unreachable!("{:?}", response) }; assert_eq!( response, - AttErrorResponseBuilder { + att::AttErrorResponse { handle_in_error: AttHandle(5).into(), - opcode_in_error: AttOpcode::READ_BY_GROUP_TYPE_REQUEST, - error_code: AttErrorCode::ATTRIBUTE_NOT_FOUND, + opcode_in_error: att::AttOpcode::ReadByGroupTypeRequest, + error_code: AttErrorCode::AttributeNotFound, } + .try_into() ) } } diff --git a/system/rust/src/gatt/server/transactions/read_by_type_request.rs b/system/rust/src/gatt/server/transactions/read_by_type_request.rs index 83a1b0862a..3e7f3b44c4 100644 --- a/system/rust/src/gatt/server/transactions/read_by_type_request.rs +++ b/system/rust/src/gatt/server/transactions/read_by_type_request.rs @@ -1,12 +1,9 @@ use crate::{ core::uuid::Uuid, - gatt::{ids::AttHandle, server::att_database::StableAttDatabase}, - packets::{ - AttChild, AttErrorCode, AttErrorResponseBuilder, AttOpcode, - AttReadByTypeDataElementBuilder, AttReadByTypeRequestView, AttReadByTypeResponseBuilder, - ParseError, - }, + gatt::server::att_database::StableAttDatabase, + packets::att::{self, AttErrorCode}, }; +use pdl_runtime::EncodeError; use super::helpers::{ att_filter_by_size_type::{filter_read_attributes_by_size_type, AttributeWithValue}, @@ -15,12 +12,10 @@ use super::helpers::{ }; pub async fn handle_read_by_type_request( - request: AttReadByTypeRequestView<'_>, + request: att::AttReadByTypeRequest, mtu: usize, db: &impl StableAttDatabase, -) -> Result<AttChild, ParseError> { - let request_type: Uuid = request.get_attribute_type().try_into()?; - +) -> Result<att::Att, EncodeError> { // As per spec (5.3 Vol 3F 3.4.4.1) // > If an attribute in the set of requested attributes would cause an // > ATT_ERROR_RSP PDU then this attribute cannot be included in an @@ -29,20 +24,25 @@ pub async fn handle_read_by_type_request( // // Thus, we populate this response on failure, but only return it if no prior // matches were accumulated. - let mut failure_response = AttErrorResponseBuilder { - opcode_in_error: AttOpcode::READ_BY_TYPE_REQUEST, - handle_in_error: AttHandle::from(request.get_starting_handle()).into(), + let mut failure_response = att::AttErrorResponse { + opcode_in_error: att::AttOpcode::ReadByTypeRequest, + handle_in_error: request.starting_handle.clone(), // the default error code if we just fail to find anything - error_code: AttErrorCode::ATTRIBUTE_NOT_FOUND, + error_code: AttErrorCode::AttributeNotFound, + }; + + let Ok(request_type): Result<Uuid, _> = request.attribute_type.try_into() else { + failure_response.error_code = AttErrorCode::InvalidPdu; + return failure_response.try_into(); }; let Some(attrs) = filter_to_range( - request.get_starting_handle().into(), - request.get_ending_handle().into(), + request.starting_handle.into(), + request.ending_handle.into(), db.list_attributes().into_iter(), ) else { - failure_response.error_code = AttErrorCode::INVALID_HANDLE; - return Ok(failure_response.into()); + failure_response.error_code = AttErrorCode::InvalidHandle; + return failure_response.try_into(); }; // MTU-2 limit comes from Core Spec 5.3 Vol 3F 3.4.4.1 @@ -52,25 +52,22 @@ pub async fn handle_read_by_type_request( match filter_read_attributes_by_size_type(db, attrs, request_type, mtu - 4).await { Ok(attrs) => { for AttributeWithValue { attr, value } in attrs { - if !out.push(AttReadByTypeDataElementBuilder { - handle: attr.handle.into(), - value: value.into_boxed_slice(), - }) { + if !out.push(att::AttReadByTypeDataElement { handle: attr.handle.into(), value }) { break; } } } Err(err) => { failure_response.error_code = err; - return Ok(failure_response.into()); + return failure_response.try_into(); } } - Ok(if out.is_empty() { - failure_response.into() + if out.is_empty() { + failure_response.try_into() } else { - AttReadByTypeResponseBuilder { data: out.into_boxed_slice() }.into() - }) + att::AttReadByTypeResponse { data: out.into_vec() }.try_into() + } } #[cfg(test)] @@ -86,8 +83,7 @@ mod test { test::test_att_db::TestAttDatabase, }, }, - packets::AttReadByTypeRequestBuilder, - utils::packet::build_view_or_crash, + packets::att, }; const UUID: Uuid = Uuid::new(1234); @@ -106,27 +102,23 @@ mod test { )]); // act - let att_view = build_view_or_crash(AttReadByTypeRequestBuilder { + let att_view = att::AttReadByTypeRequest { starting_handle: AttHandle(2).into(), ending_handle: AttHandle(6).into(), attribute_type: UUID.into(), - }); - let response = - tokio_test::block_on(handle_read_by_type_request(att_view.view(), 31, &db)).unwrap(); + }; + let response = tokio_test::block_on(handle_read_by_type_request(att_view, 31, &db)); // assert - let AttChild::AttReadByTypeResponse(response) = response else { - unreachable!("{:?}", response) - }; assert_eq!( response, - AttReadByTypeResponseBuilder { - data: [AttReadByTypeDataElementBuilder { + att::AttReadByTypeResponse { + data: vec![att::AttReadByTypeDataElement { handle: AttHandle(3).into(), - value: [4, 5].into() - }] - .into() + value: vec![4, 5], + },] } + .try_into() ) } @@ -161,34 +153,30 @@ mod test { ]); // act - let att_view = build_view_or_crash(AttReadByTypeRequestBuilder { + let att_view = att::AttReadByTypeRequest { starting_handle: AttHandle(3).into(), ending_handle: AttHandle(6).into(), attribute_type: UUID.into(), - }); - let response = - tokio_test::block_on(handle_read_by_type_request(att_view.view(), 31, &db)).unwrap(); + }; + let response = tokio_test::block_on(handle_read_by_type_request(att_view, 31, &db)); // assert: we correctly filtered by type (so we are using the filter_by_type // utility) - let AttChild::AttReadByTypeResponse(response) = response else { - unreachable!("{:?}", response) - }; assert_eq!( response, - AttReadByTypeResponseBuilder { - data: [ - AttReadByTypeDataElementBuilder { + att::AttReadByTypeResponse { + data: vec![ + att::AttReadByTypeDataElement { handle: AttHandle(3).into(), - value: [4, 5].into() + value: vec![4, 5], }, - AttReadByTypeDataElementBuilder { + att::AttReadByTypeDataElement { handle: AttHandle(6).into(), - value: [6, 7].into() - } + value: vec![6, 7], + }, ] - .into() } + .try_into() ) } @@ -215,27 +203,23 @@ mod test { ]); // act: read with MTU = 8, so we can only fit the first attribute (untruncated) - let att_view = build_view_or_crash(AttReadByTypeRequestBuilder { + let att_view = att::AttReadByTypeRequest { starting_handle: AttHandle(3).into(), ending_handle: AttHandle(6).into(), attribute_type: UUID.into(), - }); - let response = - tokio_test::block_on(handle_read_by_type_request(att_view.view(), 8, &db)).unwrap(); + }; + let response = tokio_test::block_on(handle_read_by_type_request(att_view, 8, &db)); // assert: we return only the first attribute - let AttChild::AttReadByTypeResponse(response) = response else { - unreachable!("{:?}", response) - }; assert_eq!( response, - AttReadByTypeResponseBuilder { - data: [AttReadByTypeDataElementBuilder { + att::AttReadByTypeResponse { + data: vec![att::AttReadByTypeDataElement { handle: AttHandle(3).into(), - value: [4, 5, 6].into() + value: vec![4, 5, 6], },] - .into() } + .try_into() ) } @@ -262,23 +246,22 @@ mod test { ]); // act - let att_view = build_view_or_crash(AttReadByTypeRequestBuilder { + let att_view = att::AttReadByTypeRequest { starting_handle: AttHandle(4).into(), ending_handle: AttHandle(6).into(), attribute_type: UUID.into(), - }); - let response = - tokio_test::block_on(handle_read_by_type_request(att_view.view(), 31, &db)).unwrap(); + }; + let response = tokio_test::block_on(handle_read_by_type_request(att_view, 31, &db)); // assert: we return ATTRIBUTE_NOT_FOUND - let AttChild::AttErrorResponse(response) = response else { unreachable!("{:?}", response) }; assert_eq!( response, - AttErrorResponseBuilder { + att::AttErrorResponse { handle_in_error: AttHandle(4).into(), - opcode_in_error: AttOpcode::READ_BY_TYPE_REQUEST, - error_code: AttErrorCode::ATTRIBUTE_NOT_FOUND, + opcode_in_error: att::AttOpcode::ReadByTypeRequest, + error_code: AttErrorCode::AttributeNotFound, } + .try_into() ) } @@ -288,23 +271,22 @@ mod test { let db = TestAttDatabase::new(vec![]); // act - let att_view = build_view_or_crash(AttReadByTypeRequestBuilder { + let att_view = att::AttReadByTypeRequest { starting_handle: AttHandle(0).into(), ending_handle: AttHandle(6).into(), attribute_type: UUID.into(), - }); - let response = - tokio_test::block_on(handle_read_by_type_request(att_view.view(), 31, &db)).unwrap(); + }; + let response = tokio_test::block_on(handle_read_by_type_request(att_view, 31, &db)); // assert: we return an INVALID_HANDLE error - let AttChild::AttErrorResponse(response) = response else { unreachable!("{:?}", response) }; assert_eq!( response, - AttErrorResponseBuilder { + att::AttErrorResponse { handle_in_error: AttHandle(0).into(), - opcode_in_error: AttOpcode::READ_BY_TYPE_REQUEST, - error_code: AttErrorCode::INVALID_HANDLE, + opcode_in_error: att::AttOpcode::ReadByTypeRequest, + error_code: AttErrorCode::InvalidHandle, } + .try_into() ) } } diff --git a/system/rust/src/gatt/server/transactions/read_request.rs b/system/rust/src/gatt/server/transactions/read_request.rs index ba4ea3a3fe..b5827deeb5 100644 --- a/system/rust/src/gatt/server/transactions/read_request.rs +++ b/system/rust/src/gatt/server/transactions/read_request.rs @@ -1,29 +1,25 @@ -use crate::{ - gatt::server::att_database::AttDatabase, - packets::{ - AttChild, AttErrorResponseBuilder, AttOpcode, AttReadRequestView, AttReadResponseBuilder, - }, -}; +use crate::{gatt::server::att_database::AttDatabase, packets::att}; +use pdl_runtime::EncodeError; pub async fn handle_read_request<T: AttDatabase>( - request: AttReadRequestView<'_>, + request: att::AttReadRequest, mtu: usize, db: &T, -) -> AttChild { - let handle = request.get_attribute_handle().into(); +) -> Result<att::Att, EncodeError> { + let handle = request.attribute_handle.into(); match db.read_attribute(handle).await { Ok(mut data) => { // as per 5.3 3F 3.4.4.4 ATT_READ_RSP, we truncate to MTU - 1 data.truncate(mtu - 1); - AttReadResponseBuilder { value: data.into_boxed_slice() }.into() + att::AttReadResponse { value: data }.try_into() } - Err(error_code) => AttErrorResponseBuilder { - opcode_in_error: AttOpcode::READ_REQUEST, + Err(error_code) => att::AttErrorResponse { + opcode_in_error: att::AttOpcode::ReadRequest, handle_in_error: handle.into(), error_code, } - .into(), + .try_into(), } } @@ -40,8 +36,7 @@ mod test { test::test_att_db::TestAttDatabase, }, }, - packets::{AttErrorCode, AttReadRequestBuilder, Serializable}, - utils::packet::build_view_or_crash, + packets::att, }; fn make_db_with_handle_and_value(handle: u16, value: Vec<u8>) -> TestAttDatabase { @@ -59,11 +54,9 @@ mod test { handle: u16, mtu: usize, db: &TestAttDatabase, - ) -> AttChild { - let att_view = build_view_or_crash(AttReadRequestBuilder { - attribute_handle: AttHandle(handle).into(), - }); - tokio_test::block_on(handle_read_request(att_view.view(), mtu, db)) + ) -> Result<att::Att, EncodeError> { + let att_view = att::AttReadRequest { attribute_handle: AttHandle(handle).into() }; + tokio_test::block_on(handle_read_request(att_view, mtu, db)) } #[test] @@ -72,11 +65,7 @@ mod test { let response = do_read_request_with_handle_and_mtu(3, 31, &db); - response.to_vec().unwrap(); // check it serializes - assert_eq!( - response, - AttChild::AttReadResponse(AttReadResponseBuilder { value: [4, 5].into() }) - ) + assert_eq!(response, att::AttReadResponse { value: vec![4, 5] }.try_into()); } #[test] @@ -87,7 +76,7 @@ mod test { let response = do_read_request_with_handle_and_mtu(3, 2, &db); // assert - assert_eq!(response.to_vec().unwrap(), vec![4]); + assert_eq!(response, att::AttReadResponse { value: vec![4] }.try_into()); } #[test] @@ -100,11 +89,12 @@ mod test { // assert assert_eq!( response, - AttChild::AttErrorResponse(AttErrorResponseBuilder { - opcode_in_error: AttOpcode::READ_REQUEST, + att::AttErrorResponse { + opcode_in_error: att::AttOpcode::ReadRequest, handle_in_error: AttHandle(4).into(), - error_code: AttErrorCode::INVALID_HANDLE, - }) + error_code: att::AttErrorCode::InvalidHandle, + } + .try_into() ); } @@ -129,11 +119,12 @@ mod test { // assert assert_eq!( response, - AttChild::AttErrorResponse(AttErrorResponseBuilder { - opcode_in_error: AttOpcode::READ_REQUEST, + att::AttErrorResponse { + opcode_in_error: att::AttOpcode::ReadRequest, handle_in_error: AttHandle(3).into(), - error_code: AttErrorCode::READ_NOT_PERMITTED, - }) + error_code: att::AttErrorCode::ReadNotPermitted, + } + .try_into() ); } } diff --git a/system/rust/src/gatt/server/transactions/write_request.rs b/system/rust/src/gatt/server/transactions/write_request.rs index b777c3fd82..226d57fc98 100644 --- a/system/rust/src/gatt/server/transactions/write_request.rs +++ b/system/rust/src/gatt/server/transactions/write_request.rs @@ -1,24 +1,20 @@ -use crate::{ - gatt::server::att_database::AttDatabase, - packets::{ - AttChild, AttErrorResponseBuilder, AttOpcode, AttWriteRequestView, AttWriteResponseBuilder, - }, -}; +use crate::{gatt::server::att_database::AttDatabase, packets::att}; +use pdl_runtime::EncodeError; pub async fn handle_write_request<T: AttDatabase>( - request: AttWriteRequestView<'_>, + request: att::AttWriteRequest, db: &T, -) -> AttChild { - let handle = request.get_handle().into(); - let value = request.get_value_iter().collect::<Vec<_>>(); +) -> Result<att::Att, EncodeError> { + let handle = request.handle.into(); + let value = request.value; match db.write_attribute(handle, &value).await { - Ok(()) => AttWriteResponseBuilder {}.into(), - Err(error_code) => AttErrorResponseBuilder { - opcode_in_error: AttOpcode::WRITE_REQUEST, + Ok(()) => att::AttWriteResponse {}.try_into(), + Err(error_code) => att::AttErrorResponse { + opcode_in_error: att::AttOpcode::WriteRequest, handle_in_error: handle.into(), error_code, } - .into(), + .try_into(), } } @@ -38,11 +34,7 @@ mod test { test::test_att_db::TestAttDatabase, }, }, - packets::{ - AttChild, AttErrorCode, AttErrorResponseBuilder, AttWriteRequestBuilder, - AttWriteResponseBuilder, - }, - utils::packet::build_view_or_crash, + packets::att, }; #[test] @@ -59,14 +51,11 @@ mod test { let data = vec![1, 2]; // act: write to the attribute - let att_view = build_view_or_crash(AttWriteRequestBuilder { - handle: AttHandle(1).into(), - value: data.clone().into_boxed_slice(), - }); - let resp = block_on(handle_write_request(att_view.view(), &db)); + let att_view = att::AttWriteRequest { handle: AttHandle(1).into(), value: data.clone() }; + let resp = block_on(handle_write_request(att_view, &db)); // assert: that the write succeeded - assert_eq!(resp, AttChild::from(AttWriteResponseBuilder {})); + assert_eq!(resp, att::AttWriteResponse {}.try_into()); assert_eq!(block_on(db.read_attribute(AttHandle(1))).unwrap(), data); } @@ -82,20 +71,18 @@ mod test { vec![], )]); // act: write to the attribute - let att_view = build_view_or_crash(AttWriteRequestBuilder { - handle: AttHandle(1).into(), - value: [1, 2].into(), - }); - let resp = block_on(handle_write_request(att_view.view(), &db)); + let att_view = att::AttWriteRequest { handle: AttHandle(1).into(), value: vec![1, 2] }; + let resp = block_on(handle_write_request(att_view, &db)); // assert: that the write failed assert_eq!( resp, - AttChild::from(AttErrorResponseBuilder { - opcode_in_error: AttOpcode::WRITE_REQUEST, + att::AttErrorResponse { + opcode_in_error: att::AttOpcode::WriteRequest, handle_in_error: AttHandle(1).into(), - error_code: AttErrorCode::WRITE_NOT_PERMITTED - }) + error_code: att::AttErrorCode::WriteNotPermitted + } + .try_into() ); } } diff --git a/system/rust/src/packets.pdl b/system/rust/src/packets.pdl index 77fc970322..bb5f3de72e 100644 --- a/system/rust/src/packets.pdl +++ b/system/rust/src/packets.pdl @@ -133,32 +133,28 @@ struct GattCharacteristicProperties { extended_properties: 1, } -struct AttAttributeData { - _payload_ -} - -struct GattCharacteristicDeclarationValue : AttAttributeData { +struct GattCharacteristicDeclarationValue { properties: GattCharacteristicProperties, handle: AttHandle, uuid: Uuid, } -struct GattServiceDeclarationValue : AttAttributeData { +struct GattServiceDeclarationValue { uuid: Uuid, } -struct GattClientCharacteristicConfiguration : AttAttributeData { +struct GattClientCharacteristicConfiguration { notification: 1, indication: 1, _reserved_: 14, } -struct GattServiceChanged : AttAttributeData { +struct GattServiceChanged { start_handle: AttHandle, end_handle: AttHandle, } -struct UuidAsAttData : AttAttributeData { +struct UuidAsAttData { uuid: Uuid, } diff --git a/system/rust/src/packets.rs b/system/rust/src/packets.rs index a14103f1f7..55094c7f44 100644 --- a/system/rust/src/packets.rs +++ b/system/rust/src/packets.rs @@ -5,11 +5,6 @@ #![allow(clippy::all)] // this is now stable #![feature(mixed_integer_ops)] - -include!(concat!(env!("OUT_DIR"), "/_packets.rs")); - -impl std::cmp::PartialEq for SerializeError { - fn eq(&self, rhs: &Self) -> bool { - std::mem::discriminant(self) == std::mem::discriminant(rhs) - } +pub mod att { + include!(concat!(env!("OUT_DIR"), "/_packets.rs")); } diff --git a/system/rust/src/utils.rs b/system/rust/src/utils.rs index 242ff80399..ed6331a7af 100644 --- a/system/rust/src/utils.rs +++ b/system/rust/src/utils.rs @@ -1,7 +1,6 @@ //! Utilities that are not specific to a particular module pub mod owned_handle; -pub mod packet; #[cfg(test)] pub mod task; diff --git a/system/rust/src/utils/packet.rs b/system/rust/src/utils/packet.rs deleted file mode 100644 index 86039636b8..0000000000 --- a/system/rust/src/utils/packet.rs +++ /dev/null @@ -1,46 +0,0 @@ -//! Utility for packet manipulation on top of the codegen from PDL - -use crate::packets::{ - AttBuilder, AttChild, AttOpcode, Builder, OwnedAttView, OwnedPacket, Serializable, -}; - -/// Convert an ATT builder child into an owned AttView, for use in test -pub fn build_att_view_or_crash(child: impl Into<AttChild>) -> OwnedAttView { - let child = child.into(); - let opcode = HACK_child_to_opcode(&child); - let serialized = AttBuilder { _child_: child, opcode }.to_vec().unwrap(); - OwnedAttView::try_parse(serialized.into_boxed_slice()).unwrap() -} - -/// Convert an arbitrary packet builder into an OwnedView, for use in test -pub fn build_view_or_crash<T: Builder>(builder: T) -> T::OwnedPacket { - let buf = builder.to_vec().unwrap(); - T::OwnedPacket::try_parse(buf.into_boxed_slice()).unwrap() -} - -/// Hack to workaround PDL limitations where constraints are ignored in builders -/// TODO(aryarahul) - get rid of this, PDL should deal with it! -#[allow(non_snake_case)] -pub fn HACK_child_to_opcode(child: &AttChild) -> AttOpcode { - match child { - AttChild::RawData(_vec) => unreachable!(), - AttChild::AttFindInformationRequest(_) => AttOpcode::FIND_INFORMATION_REQUEST, - AttChild::AttReadByGroupTypeRequest(_) => AttOpcode::READ_BY_GROUP_TYPE_REQUEST, - AttChild::AttReadByTypeRequest(_) => AttOpcode::READ_BY_TYPE_REQUEST, - AttChild::AttReadRequest(_) => AttOpcode::READ_REQUEST, - AttChild::AttReadResponse(_) => AttOpcode::READ_RESPONSE, - AttChild::AttErrorResponse(_) => AttOpcode::ERROR_RESPONSE, - AttChild::AttReadByGroupTypeResponse(_) => AttOpcode::READ_BY_GROUP_TYPE_RESPONSE, - AttChild::AttReadByTypeResponse(_) => AttOpcode::READ_BY_TYPE_RESPONSE, - AttChild::AttFindInformationResponse(_) => AttOpcode::FIND_INFORMATION_RESPONSE, - AttChild::AttFindByTypeValueRequest(_) => AttOpcode::FIND_BY_TYPE_VALUE_REQUEST, - AttChild::AttFindByTypeValueResponse(_) => AttOpcode::FIND_BY_TYPE_VALUE_RESPONSE, - AttChild::AttWriteRequest(_) => AttOpcode::WRITE_REQUEST, - AttChild::AttWriteResponse(_) => AttOpcode::WRITE_RESPONSE, - AttChild::AttHandleValueIndication(_) => AttOpcode::HANDLE_VALUE_INDICATION, - AttChild::AttHandleValueConfirmation(_) => AttOpcode::HANDLE_VALUE_CONFIRMATION, - AttChild::AttExchangeMtuRequest(_) => AttOpcode::EXCHANGE_MTU_REQUEST, - AttChild::AttExchangeMtuResponse(_) => AttOpcode::EXCHANGE_MTU_RESPONSE, - AttChild::AttWriteCommand(_) => AttOpcode::WRITE_COMMAND, - } -} diff --git a/system/rust/tests/gatt_callbacks_test.rs b/system/rust/tests/gatt_callbacks_test.rs index 1a462da113..84409f376e 100644 --- a/system/rust/tests/gatt_callbacks_test.rs +++ b/system/rust/tests/gatt_callbacks_test.rs @@ -12,7 +12,7 @@ use bluetooth_core::{ ids::{AttHandle, ConnectionId, ServerId, TransactionId, TransportIndex}, mocks::mock_callbacks::{MockCallbackEvents, MockCallbacks}, }, - packets::AttErrorCode, + packets::att::AttErrorCode, }; use tokio::{sync::mpsc::UnboundedReceiver, task::spawn_local, time::Instant}; use utils::start_test; @@ -272,11 +272,11 @@ fn test_write_characteristic_response() { // provide a response with some error code let trans_id = pull_trans_id(&mut callbacks_rx).await; callback_manager - .send_response(CONN_ID, trans_id, Err(AttErrorCode::WRITE_NOT_PERMITTED)) + .send_response(CONN_ID, trans_id, Err(AttErrorCode::WriteNotPermitted)) .unwrap(); // assert: that the error code was received - assert_eq!(pending_write.await.unwrap(), Err(AttErrorCode::WRITE_NOT_PERMITTED)); + assert_eq!(pending_write.await.unwrap(), Err(AttErrorCode::WriteNotPermitted)); }); } @@ -295,7 +295,7 @@ fn test_response_timeout() { ); // assert: that we time-out after 15s - assert_eq!(pending_write.await.unwrap(), Err(AttErrorCode::UNLIKELY_ERROR)); + assert_eq!(pending_write.await.unwrap(), Err(AttErrorCode::UnlikelyError)); let time_slept = Instant::now().duration_since(time_sent); assert!(time_slept > Duration::from_secs(14)); assert!(time_slept < Duration::from_secs(16)); @@ -316,10 +316,10 @@ fn test_transaction_cleanup_after_timeout() { ); let trans_id = pull_trans_id(&mut callbacks_rx).await; // let it time out - assert_eq!(pending.await.unwrap(), Err(AttErrorCode::UNLIKELY_ERROR)); + assert_eq!(pending.await.unwrap(), Err(AttErrorCode::UnlikelyError)); // try responding to it now let resp = - callback_manager.send_response(CONN_ID, trans_id, Err(AttErrorCode::INVALID_HANDLE)); + callback_manager.send_response(CONN_ID, trans_id, Err(AttErrorCode::InvalidHandle)); // assert: the response failed assert_eq!(resp, Err(CallbackResponseError::NonExistentTransaction(trans_id))); @@ -344,7 +344,7 @@ fn test_listener_hang_up() { pending.await.unwrap_err(); // try responding to it now let resp = - callback_manager.send_response(CONN_ID, trans_id, Err(AttErrorCode::INVALID_HANDLE)); + callback_manager.send_response(CONN_ID, trans_id, Err(AttErrorCode::InvalidHandle)); // assert: we get the expected error assert_eq!(resp, Err(CallbackResponseError::ListenerHungUp(trans_id))); @@ -422,10 +422,10 @@ fn test_execute_characteristic_response() { // provide a response with some error code let trans_id = pull_trans_id(&mut callbacks_rx).await; callback_manager - .send_response(CONN_ID, trans_id, Err(AttErrorCode::WRITE_NOT_PERMITTED)) + .send_response(CONN_ID, trans_id, Err(AttErrorCode::WriteNotPermitted)) .unwrap(); // assert: that the error code was received - assert_eq!(pending_execute.await.unwrap(), Err(AttErrorCode::WRITE_NOT_PERMITTED)); + assert_eq!(pending_execute.await.unwrap(), Err(AttErrorCode::WriteNotPermitted)); }); } diff --git a/system/rust/tests/gatt_server_test.rs b/system/rust/tests/gatt_server_test.rs index 9cccd51bc3..cf91d35ad8 100644 --- a/system/rust/tests/gatt_server_test.rs +++ b/system/rust/tests/gatt_server_test.rs @@ -1,3 +1,4 @@ +use pdl_runtime::Packet; use std::{ rc::Rc, sync::{Arc, Mutex}, @@ -29,17 +30,7 @@ use bluetooth_core::{ GattModule, IndicationError, }, }, - packets::{ - AttBuilder, AttChild, AttErrorCode, AttErrorResponseBuilder, - AttFindByTypeValueRequestBuilder, AttFindInformationRequestBuilder, - AttFindInformationResponseChild, AttHandleValueConfirmationBuilder, - AttHandleValueIndicationBuilder, AttOpcode, AttReadByTypeRequestBuilder, - AttReadRequestBuilder, AttReadResponseBuilder, AttWriteRequestBuilder, - AttWriteResponseBuilder, GattCharacteristicDeclarationValueView, - GattClientCharacteristicConfigurationBuilder, GattServiceChangedBuilder, - GattServiceDeclarationValueBuilder, Packet, Serializable, UuidAsAttDataBuilder, - }, - utils::packet::build_att_view_or_crash, + packets::att::{self, AttErrorCode}, }; use tokio::{ @@ -69,7 +60,7 @@ const DESCRIPTOR_TYPE: Uuid = Uuid::new(0x0104); const DATA: [u8; 4] = [1, 2, 3, 4]; const ANOTHER_DATA: [u8; 4] = [5, 6, 7, 8]; -fn start_gatt_module() -> (gatt::server::GattModule, UnboundedReceiver<(TransportIndex, AttBuilder)>) +fn start_gatt_module() -> (gatt::server::GattModule, UnboundedReceiver<(TransportIndex, att::Att)>) { let (transport, transport_rx) = MockAttTransport::new(); let arbiter = IsolationManager::new(); @@ -119,28 +110,20 @@ fn test_service_read() { // act gatt.get_bearer(TCB_IDX).unwrap().handle_packet( - build_att_view_or_crash(AttReadRequestBuilder { - attribute_handle: SERVICE_HANDLE.into(), - }) - .view(), + att::AttReadRequest { attribute_handle: SERVICE_HANDLE.into() }.try_into().unwrap(), ); let (tcb_idx, resp) = transport_rx.recv().await.unwrap(); // assert assert_eq!(tcb_idx, TCB_IDX); assert_eq!( - resp.to_vec(), - AttBuilder { - opcode: AttOpcode::READ_RESPONSE, - _child_: AttReadResponseBuilder { - value: GattServiceDeclarationValueBuilder { uuid: SERVICE_TYPE.into() } - .to_vec() - .unwrap() - .into(), - } - .into() + Ok(resp), + att::AttReadResponse { + value: att::GattServiceDeclarationValue { uuid: SERVICE_TYPE.into() } + .encode_to_vec() + .unwrap(), } - .to_vec() + .try_into() ); }) } @@ -157,23 +140,19 @@ fn test_server_closed_while_connected() { // act: read from the closed server gatt.get_bearer(TCB_IDX).unwrap().handle_packet( - build_att_view_or_crash(AttReadRequestBuilder { - attribute_handle: SERVICE_HANDLE.into(), - }) - .view(), + att::AttReadRequest { attribute_handle: SERVICE_HANDLE.into() }.try_into().unwrap(), ); let (_, resp) = transport_rx.recv().await.unwrap(); // assert that the read failed, but that a response was provided - assert_eq!(resp.opcode, AttOpcode::ERROR_RESPONSE); assert_eq!( - resp._child_, - AttErrorResponseBuilder { - opcode_in_error: AttOpcode::READ_REQUEST, + Ok(resp), + att::AttErrorResponse { + opcode_in_error: att::AttOpcode::ReadRequest, handle_in_error: SERVICE_HANDLE.into(), - error_code: AttErrorCode::INVALID_HANDLE + error_code: AttErrorCode::InvalidHandle } - .into() + .try_into() ) }); } @@ -187,10 +166,9 @@ fn test_characteristic_read() { // act gatt.get_bearer(TCB_IDX).unwrap().handle_packet( - build_att_view_or_crash(AttReadRequestBuilder { - attribute_handle: CHARACTERISTIC_HANDLE.into(), - }) - .view(), + att::AttReadRequest { attribute_handle: CHARACTERISTIC_HANDLE.into() } + .try_into() + .unwrap(), ); let tx = if let MockDatastoreEvents::Read( TCB_IDX, @@ -208,13 +186,7 @@ fn test_characteristic_read() { // assert assert_eq!(tcb_idx, TCB_IDX); - assert_eq!( - resp, - AttBuilder { - opcode: AttOpcode::READ_RESPONSE, - _child_: AttReadResponseBuilder { value: DATA.into() }.into() - } - ); + assert_eq!(Ok(resp), att::AttReadResponse { value: DATA.into() }.try_into()); }) } @@ -227,11 +199,9 @@ fn test_characteristic_write() { // act gatt.get_bearer(TCB_IDX).unwrap().handle_packet( - build_att_view_or_crash(AttWriteRequestBuilder { - handle: CHARACTERISTIC_HANDLE.into(), - value: DATA.into(), - }) - .view(), + att::AttWriteRequest { handle: CHARACTERISTIC_HANDLE.into(), value: DATA.into() } + .try_into() + .unwrap(), ); let (tx, written_data) = if let MockDatastoreEvents::Write( TCB_IDX, @@ -250,13 +220,7 @@ fn test_characteristic_write() { // assert assert_eq!(tcb_idx, TCB_IDX); - assert_eq!( - resp, - AttBuilder { - opcode: AttOpcode::WRITE_RESPONSE, - _child_: AttWriteResponseBuilder {}.into() - } - ); + assert_eq!(Ok(resp), att::AttWriteResponse {}.try_into()); assert_eq!(&DATA, written_data.as_slice()); }) } @@ -277,21 +241,18 @@ fn test_send_indication() { gatt.get_bearer(TCB_IDX) .unwrap() - .handle_packet(build_att_view_or_crash(AttHandleValueConfirmationBuilder {}).view()); + .handle_packet(att::AttHandleValueConfirmation {}.try_into().unwrap()); // assert assert!(matches!(pending_indication.await.unwrap(), Ok(()))); assert_eq!(tcb_idx, TCB_IDX); assert_eq!( - resp, - AttBuilder { - opcode: AttOpcode::HANDLE_VALUE_INDICATION, - _child_: AttHandleValueIndicationBuilder { - handle: CHARACTERISTIC_HANDLE.into(), - value: DATA.into(), - } - .into() + Ok(resp), + att::AttHandleValueIndication { + handle: CHARACTERISTIC_HANDLE.into(), + value: DATA.into(), } + .try_into() ); }) } @@ -330,11 +291,9 @@ fn test_write_to_descriptor() { // act gatt.get_bearer(TCB_IDX).unwrap().handle_packet( - build_att_view_or_crash(AttWriteRequestBuilder { - handle: DESCRIPTOR_HANDLE.into(), - value: DATA.into(), - }) - .view(), + att::AttWriteRequest { handle: DESCRIPTOR_HANDLE.into(), value: DATA.into() } + .try_into() + .unwrap(), ); let (tx, written_data) = if let MockDatastoreEvents::Write( TCB_IDX, @@ -353,13 +312,7 @@ fn test_write_to_descriptor() { // assert assert_eq!(tcb_idx, TCB_IDX); - assert_eq!( - resp, - AttBuilder { - opcode: AttOpcode::WRITE_RESPONSE, - _child_: AttWriteResponseBuilder {}.into() - } - ); + assert_eq!(Ok(resp), att::AttWriteResponse {}.try_into()); assert_eq!(&DATA, written_data.as_slice()); }) } @@ -395,16 +348,14 @@ fn test_multiple_servers() { // act: read from both connections gatt.get_bearer(TCB_IDX).unwrap().handle_packet( - build_att_view_or_crash(AttReadRequestBuilder { - attribute_handle: CHARACTERISTIC_HANDLE.into(), - }) - .view(), + att::AttReadRequest { attribute_handle: CHARACTERISTIC_HANDLE.into() } + .try_into() + .unwrap(), ); gatt.get_bearer(ANOTHER_TCB_IDX).unwrap().handle_packet( - build_att_view_or_crash(AttReadRequestBuilder { - attribute_handle: CHARACTERISTIC_HANDLE.into(), - }) - .view(), + att::AttReadRequest { attribute_handle: CHARACTERISTIC_HANDLE.into() } + .try_into() + .unwrap(), ); // service the first read with `data` let MockDatastoreEvents::Read(TCB_IDX, _, _, tx) = data_rx_1.recv().await.unwrap() else { @@ -424,9 +375,9 @@ fn test_multiple_servers() { // assert: the responses were routed to the correct connections assert_eq!(tcb_idx_1, TCB_IDX); - assert_eq!(resp_1._child_.to_vec().unwrap(), DATA); + assert_eq!(Ok(resp_1), att::AttReadResponse { value: DATA.to_vec() }.try_into()); assert_eq!(tcb_idx_2, ANOTHER_TCB_IDX); - assert_eq!(resp_2._child_.to_vec().unwrap(), ANOTHER_DATA); + assert_eq!(Ok(resp_2), att::AttReadResponse { value: ANOTHER_DATA.to_vec() }.try_into()); }) } @@ -439,21 +390,27 @@ fn test_read_device_name() { // act: try to read the device name gatt.get_bearer(TCB_IDX).unwrap().handle_packet( - build_att_view_or_crash(AttReadByTypeRequestBuilder { + att::AttReadByTypeRequest { starting_handle: AttHandle(1).into(), ending_handle: AttHandle(0xFFFF).into(), attribute_type: DEVICE_NAME_UUID.into(), - }) - .view(), + } + .try_into() + .unwrap(), ); let (tcb_idx, resp) = transport_rx.recv().await.unwrap(); // assert: the name should not be readable assert_eq!(tcb_idx, TCB_IDX); - let AttChild::AttErrorResponse(resp) = resp._child_ else { - unreachable!("{resp:?}"); - }; - assert_eq!(resp.error_code, AttErrorCode::INSUFFICIENT_AUTHENTICATION); + assert_eq!( + Ok(resp), + att::AttErrorResponse { + opcode_in_error: att::AttOpcode::ReadByTypeRequest, + handle_in_error: AttHandle(1).into(), + error_code: AttErrorCode::InsufficientAuthentication, + } + .try_into() + ); }); } @@ -491,19 +448,19 @@ fn test_service_change_indication() { // act: discover the GATT server gatt.get_bearer(TCB_IDX).unwrap().handle_packet( - build_att_view_or_crash(AttFindByTypeValueRequestBuilder { + att::AttFindByTypeValueRequest { starting_handle: AttHandle::MIN.into(), ending_handle: AttHandle::MAX.into(), attribute_type: PRIMARY_SERVICE_DECLARATION_UUID.try_into().unwrap(), - attribute_value: UuidAsAttDataBuilder { uuid: GATT_SERVICE_UUID.into() } - .to_vec() - .unwrap() - .into(), - }) - .view(), + attribute_value: att::UuidAsAttData { uuid: GATT_SERVICE_UUID.into() } + .encode_to_vec() + .unwrap(), + } + .try_into() + .unwrap(), ); - let AttChild::AttFindByTypeValueResponse(resp) = - transport_rx.recv().await.unwrap().1._child_ + let Ok(resp): Result<att::AttFindByTypeValueResponse, _> = + transport_rx.recv().await.unwrap().1.try_into() else { unreachable!() }; @@ -513,29 +470,30 @@ fn test_service_change_indication() { ); // act: discover the service changed characteristic gatt.get_bearer(TCB_IDX).unwrap().handle_packet( - build_att_view_or_crash(AttReadByTypeRequestBuilder { + att::AttReadByTypeRequest { starting_handle, ending_handle, attribute_type: CHARACTERISTIC_UUID.into(), - }) - .view(), + } + .try_into() + .unwrap(), ); - let AttChild::AttReadByTypeResponse(resp) = transport_rx.recv().await.unwrap().1._child_ + + let Ok(resp): Result<att::AttReadByTypeResponse, _> = + transport_rx.recv().await.unwrap().1.try_into() else { unreachable!() }; let service_change_char_handle: AttHandle = resp .data - .into_vec() .into_iter() .find_map(|characteristic| { let value = characteristic.value.to_vec(); let decl = - GattCharacteristicDeclarationValueView::try_parse_from_buffer(value.as_slice()) - .unwrap(); + att::GattCharacteristicDeclarationValue::decode_full(value.as_slice()).unwrap(); - if SERVICE_CHANGE_UUID == decl.get_uuid().try_into().unwrap() { - Some(decl.get_handle().into()) + if SERVICE_CHANGE_UUID == decl.uuid.try_into().unwrap() { + Some(decl.handle.into()) } else { None } @@ -543,24 +501,23 @@ fn test_service_change_indication() { .unwrap(); // act: find the CCC descriptor for the service changed characteristic gatt.get_bearer(TCB_IDX).unwrap().handle_packet( - build_att_view_or_crash(AttFindInformationRequestBuilder { + att::AttFindInformationRequest { starting_handle: service_change_char_handle.into(), ending_handle: AttHandle::MAX.into(), - }) - .view(), + } + .try_into() + .unwrap(), ); - let AttChild::AttFindInformationResponse(resp) = - transport_rx.recv().await.unwrap().1._child_ + let Ok(resp): Result<att::AttFindInformationResponse, _> = + transport_rx.recv().await.unwrap().1.try_into() else { unreachable!() }; - let AttFindInformationResponseChild::AttFindInformationShortResponse(resp) = resp._child_ - else { + let Ok(resp): Result<att::AttFindInformationShortResponse, _> = resp.try_into() else { unreachable!() }; let service_change_descriptor_handle = resp .data - .into_vec() .into_iter() .find_map(|attr| { if attr.uuid == CLIENT_CHARACTERISTIC_CONFIGURATION_UUID.try_into().unwrap() { @@ -572,19 +529,21 @@ fn test_service_change_indication() { .unwrap(); // act: register for indications on this handle gatt.get_bearer(TCB_IDX).unwrap().handle_packet( - build_att_view_or_crash(AttWriteRequestBuilder { + att::AttWriteRequest { handle: service_change_descriptor_handle, - value: GattClientCharacteristicConfigurationBuilder { + value: att::GattClientCharacteristicConfiguration { notification: 0, indication: 1, } - .to_vec() - .unwrap() - .into(), - }) - .view(), + .encode_to_vec() + .unwrap(), + } + .try_into() + .unwrap(), ); - let AttChild::AttWriteResponse(_) = transport_rx.recv().await.unwrap().1._child_ else { + let Ok(_): Result<att::AttWriteResponse, _> = + transport_rx.recv().await.unwrap().1.try_into() + else { unreachable!() }; // act: add a new service @@ -601,19 +560,19 @@ fn test_service_change_indication() { .unwrap(); // assert: we got an indication - let AttChild::AttHandleValueIndication(indication) = - transport_rx.recv().await.unwrap().1._child_ + let Ok(indication): Result<att::AttHandleValueIndication, _> = + transport_rx.recv().await.unwrap().1.try_into() else { unreachable!() }; assert_eq!(indication.handle, service_change_char_handle.into()); assert_eq!( Ok(indication.value.into()), - GattServiceChangedBuilder { + att::GattServiceChanged { start_handle: AttHandle(30).into(), end_handle: AttHandle(30).into(), } - .to_vec() + .encode_to_vec() ); }); } diff --git a/system/stack/Android.bp b/system/stack/Android.bp index 1d6376c90d..2a72a84fe9 100644 --- a/system/stack/Android.bp +++ b/system/stack/Android.bp @@ -38,6 +38,7 @@ cc_library_static { name: "libbt-stack", defaults: ["fluoride_defaults"], local_include_dirs: [ + "ais", "avct", "avdt", "avrc", @@ -161,7 +162,6 @@ cc_library_static { ], host_supported: true, min_sdk_version: "Tiramisu", - cflags: ["-Wno-unused-parameter"], } filegroup { @@ -180,6 +180,7 @@ cc_library_static { name: "libbt-stack-core", defaults: ["fluoride_defaults"], local_include_dirs: [ + "ais", "avct", "avdt", "avrc", @@ -213,6 +214,7 @@ cc_library_static { "acl/ble_acl.cc", "acl/btm_acl.cc", "acl/btm_pm.cc", + "ais/ais_ble.cc", "arbiter/acl_arbiter.cc", "btm/ble_scanner_hci_interface.cc", "btm/btm_ble.cc", @@ -517,6 +519,7 @@ cc_fuzz { ":TestMockStackL2cap", ":TestMockStackMetrics", ":TestMockStackSdp", + "ais/*.cc", "eatt/*.cc", "fuzzers/gatt_fuzzer.cc", "gatt/*.cc", @@ -1973,6 +1976,7 @@ cc_test { ":TestMockStackL2cap", ":TestMockStackSdp", ":TestMockStackSmp", + "ais/ais_ble.cc", "arbiter/acl_arbiter.cc", "eatt/eatt.cc", "gatt/att_protocol.cc", diff --git a/system/stack/BUILD.gn b/system/stack/BUILD.gn index 2581035379..68d5136db0 100644 --- a/system/stack/BUILD.gn +++ b/system/stack/BUILD.gn @@ -53,6 +53,7 @@ source_set("nonstandard_codecs") { source_set("stack") { sources = [ + "ais/ais_ble.cc", "a2dp/a2dp_api.cc", "a2dp/a2dp_codec_config.cc", "a2dp/a2dp_ext.cc", @@ -187,6 +188,7 @@ source_set("stack") { include_dirs = [ ".", "include", + "ais", "avct", "btm", "avrc", diff --git a/system/stack/a2dp/a2dp_aac.cc b/system/stack/a2dp/a2dp_aac.cc index a5253c18ca..1784e824c5 100644 --- a/system/stack/a2dp/a2dp_aac.cc +++ b/system/stack/a2dp/a2dp_aac.cc @@ -565,7 +565,7 @@ int A2DP_ComputeMaxBitRateAac(const uint8_t* p_codec_info, uint16_t mtu) { return (8 * mtu * sampling_freq) / pcm_channel_samples_per_frame; } -bool A2DP_GetPacketTimestampAac(const uint8_t* p_codec_info, const uint8_t* p_data, +bool A2DP_GetPacketTimestampAac(const uint8_t* /* p_codec_info */, const uint8_t* p_data, uint32_t* p_timestamp) { // TODO: Is this function really codec-specific? *p_timestamp = *(const uint32_t*)p_data; diff --git a/system/stack/a2dp/a2dp_api.cc b/system/stack/a2dp/a2dp_api.cc index b0c43ea709..574eb16d07 100644 --- a/system/stack/a2dp/a2dp_api.cc +++ b/system/stack/a2dp/a2dp_api.cc @@ -79,7 +79,7 @@ static void a2dp_sdp_cback(const RawAddress& /* bd_addr */, tSDP_STATUS status) log::info("status: {}", status); - if (status == SDP_SUCCESS) { + if (status == tSDP_STATUS::SDP_SUCCESS) { /* loop through all records we found */ do { /* get next record; if none found, we're done */ diff --git a/system/stack/a2dp/a2dp_codec_config.cc b/system/stack/a2dp/a2dp_codec_config.cc index 45b443a1d4..2a59138d7e 100644 --- a/system/stack/a2dp/a2dp_codec_config.cc +++ b/system/stack/a2dp/a2dp_codec_config.cc @@ -333,7 +333,7 @@ bool A2dpCodecConfig::isCodecConfigEmpty(const btav_a2dp_codec_config_t& codec_c tA2DP_STATUS A2dpCodecConfig::setCodecUserConfig( const btav_a2dp_codec_config_t& codec_user_config, const btav_a2dp_codec_config_t& codec_audio_config, - const tA2DP_ENCODER_INIT_PEER_PARAMS* p_peer_params, const uint8_t* p_peer_codec_info, + const tA2DP_ENCODER_INIT_PEER_PARAMS* /* p_peer_params */, const uint8_t* p_peer_codec_info, bool is_capability, uint8_t* p_result_codec_config, bool* p_restart_input, bool* p_restart_output, bool* p_config_updated) { std::lock_guard<std::recursive_mutex> lock(codec_mutex_); diff --git a/system/stack/a2dp/a2dp_ext.cc b/system/stack/a2dp/a2dp_ext.cc index b5ead0c930..865361d689 100644 --- a/system/stack/a2dp/a2dp_ext.cc +++ b/system/stack/a2dp/a2dp_ext.cc @@ -45,8 +45,8 @@ A2dpCodecConfigExt::A2dpCodecConfigExt(btav_a2dp_codec_index_t codec_index, bool } tA2DP_STATUS A2dpCodecConfigExt::setCodecConfig(const uint8_t* p_peer_codec_info, - bool is_capability, - uint8_t* p_result_codec_config) { + bool /* is_capability */, + uint8_t* /* p_result_codec_config */) { // Call get_a2dp_config to recompute best capabilities. // This method need to update codec_capability_, codec_config_, // and ota_codec_config_ using the local codec_user_config_, and input @@ -72,7 +72,7 @@ tA2DP_STATUS A2dpCodecConfigExt::setCodecConfig(const uint8_t* p_peer_codec_info return A2DP_SUCCESS; } -bool A2dpCodecConfigExt::setPeerCodecCapabilities(const uint8_t* p_peer_codec_capabilities) { +bool A2dpCodecConfigExt::setPeerCodecCapabilities(const uint8_t* /* p_peer_codec_capabilities */) { // setPeerCodecCapabilities updates the selectable // capabilities in the codec config. It can be safely // ignored as providing a superset of the selectable diff --git a/system/stack/a2dp/a2dp_vendor_aptx_encoder.cc b/system/stack/a2dp/a2dp_vendor_aptx_encoder.cc index 2fbc4a07b3..969a06643d 100644 --- a/system/stack/a2dp/a2dp_vendor_aptx_encoder.cc +++ b/system/stack/a2dp/a2dp_vendor_aptx_encoder.cc @@ -288,7 +288,7 @@ int a2dp_vendor_aptx_get_effective_frame_size() { return a2dp_aptx_encoder_cb.peer_params.peer_mtu; } -void a2dp_vendor_aptx_send_frames(uint64_t timestamp_us) { +void a2dp_vendor_aptx_send_frames(uint64_t /* timestamp_us */) { tAPTX_FRAMING_PARAMS* framing_params = &a2dp_aptx_encoder_cb.framing_params; // Prepare the packet to send diff --git a/system/stack/a2dp/a2dp_vendor_aptx_hd.cc b/system/stack/a2dp/a2dp_vendor_aptx_hd.cc index 7c255b3329..f6ed0c6cfa 100644 --- a/system/stack/a2dp/a2dp_vendor_aptx_hd.cc +++ b/system/stack/a2dp/a2dp_vendor_aptx_hd.cc @@ -370,7 +370,7 @@ bool A2DP_VendorAdjustCodecAptxHd(uint8_t* p_codec_info) { return true; } -btav_a2dp_codec_index_t A2DP_VendorSourceCodecIndexAptxHd(const uint8_t* p_codec_info) { +btav_a2dp_codec_index_t A2DP_VendorSourceCodecIndexAptxHd(const uint8_t* /* p_codec_info */) { return BTAV_A2DP_CODEC_INDEX_SOURCE_APTX_HD; } diff --git a/system/stack/a2dp/a2dp_vendor_aptx_hd_encoder.cc b/system/stack/a2dp/a2dp_vendor_aptx_hd_encoder.cc index ea83f0391e..d6daf805a5 100644 --- a/system/stack/a2dp/a2dp_vendor_aptx_hd_encoder.cc +++ b/system/stack/a2dp/a2dp_vendor_aptx_hd_encoder.cc @@ -269,7 +269,7 @@ int a2dp_vendor_aptx_hd_get_effective_frame_size() { return a2dp_aptx_hd_encoder_cb.peer_params.peer_mtu; } -void a2dp_vendor_aptx_hd_send_frames(uint64_t timestamp_us) { +void a2dp_vendor_aptx_hd_send_frames(uint64_t /* timestamp_us */) { tAPTX_HD_FRAMING_PARAMS* framing_params = &a2dp_aptx_hd_encoder_cb.framing_params; // Prepare the packet to send diff --git a/system/stack/a2dp/a2dp_vendor_ldac_encoder.cc b/system/stack/a2dp/a2dp_vendor_ldac_encoder.cc index 342a2f9f40..7a616a038a 100644 --- a/system/stack/a2dp/a2dp_vendor_ldac_encoder.cc +++ b/system/stack/a2dp/a2dp_vendor_ldac_encoder.cc @@ -33,6 +33,7 @@ #include "internal_include/bt_target.h" #include "os/log.h" #include "osi/include/allocator.h" +#include "osi/include/properties.h" #include "stack/include/bt_hdr.h" // @@ -211,7 +212,8 @@ static void a2dp_vendor_ldac_encoder_update(A2dpCodecConfig* a2dp_codec_config, log::info("setting quality mode to {}", quality_mode_index_to_name(p_encoder_params->quality_mode_index)); } else { - p_encoder_params->quality_mode_index = A2DP_LDAC_QUALITY_ABR; + p_encoder_params->quality_mode_index = osi_property_get_int32( + "persist.bluetooth.a2dp_ldac.default_quality_mode", A2DP_LDAC_QUALITY_ABR); log::info("setting quality mode to default {}", quality_mode_index_to_name(p_encoder_params->quality_mode_index)); } diff --git a/system/stack/a2dp/a2dp_vendor_opus_decoder.cc b/system/stack/a2dp/a2dp_vendor_opus_decoder.cc index 479e0fffea..25658e60c0 100644 --- a/system/stack/a2dp/a2dp_vendor_opus_decoder.cc +++ b/system/stack/a2dp/a2dp_vendor_opus_decoder.cc @@ -85,7 +85,7 @@ bool a2dp_vendor_opus_decoder_init(decoded_data_callback_t decode_callback) { return false; } -void a2dp_vendor_opus_decoder_configure(const uint8_t* p_codec_info) { return; } +void a2dp_vendor_opus_decoder_configure(const uint8_t* /* p_codec_info */) { return; } bool a2dp_vendor_opus_decoder_decode_packet(BT_HDR* p_buf) { uint32_t frameSize; diff --git a/system/stack/a2dp/a2dp_vendor_opus_encoder.cc b/system/stack/a2dp/a2dp_vendor_opus_encoder.cc index e04d92750e..b59288c7c6 100644 --- a/system/stack/a2dp/a2dp_vendor_opus_encoder.cc +++ b/system/stack/a2dp/a2dp_vendor_opus_encoder.cc @@ -159,7 +159,7 @@ void a2dp_vendor_opus_encoder_init(const tA2DP_ENCODER_INIT_PEER_PARAMS* p_peer_ } bool A2dpCodecConfigOpusSource::updateEncoderUserConfig( - const tA2DP_ENCODER_INIT_PEER_PARAMS* p_peer_params, bool* p_restart_input, + const tA2DP_ENCODER_INIT_PEER_PARAMS* /* p_peer_params */, bool* p_restart_input, bool* p_restart_output, bool* p_config_updated) { if (a2dp_opus_encoder_cb.peer_mtu == 0) { log::error("Cannot update the codec encoder for {}: invalid peer MTU", name()); diff --git a/system/stack/acl/btm_acl.cc b/system/stack/acl/btm_acl.cc index c33d3313dd..68f0c23e9d 100644 --- a/system/stack/acl/btm_acl.cc +++ b/system/stack/acl/btm_acl.cc @@ -58,6 +58,7 @@ #include "rust/src/core/ffi/types.h" #include "stack/acl/acl.h" #include "stack/acl/peer_packet_types.h" +#include "stack/btm/btm_ble_int.h" #include "stack/btm/btm_dev.h" #include "stack/btm/btm_int_types.h" #include "stack/btm/btm_sco.h" @@ -71,6 +72,7 @@ #include "stack/include/btm_ble_api.h" #include "stack/include/btm_client_interface.h" #include "stack/include/btm_iso_api.h" +#include "stack/include/btm_status.h" #include "stack/include/hci_error_code.h" #include "stack/include/hcimsgs.h" #include "stack/include/l2cap_acl_interface.h" @@ -514,7 +516,7 @@ tBTM_STATUS BTM_GetRole(const RawAddress& remote_bd_addr, tHCI_ROLE* p_role) { return BTM_UNKNOWN_ADDR; } *p_role = p_acl->link_role; - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } /******************************************************************************* @@ -524,14 +526,14 @@ tBTM_STATUS BTM_GetRole(const RawAddress& remote_bd_addr, tHCI_ROLE* p_role) { * Description This function is called to switch role between central and * peripheral. If role is already set it will do nothing. * - * Returns BTM_SUCCESS if already in specified role. - * BTM_CMD_STARTED if command issued to controller. + * Returns tBTM_STATUS::BTM_SUCCESS if already in specified role. + * tBTM_STATUS::BTM_CMD_STARTED if command issued to controller. * BTM_NO_RESOURCES if couldn't allocate memory to issue * command * BTM_UNKNOWN_ADDR if no active link with bd addr specified * BTM_MODE_UNSUPPORTED if local device does not support role * switching - * BTM_BUSY if the previous command is not completed + * tBTM_STATUS::BTM_BUSY if the previous command is not completed * ******************************************************************************/ tBTM_STATUS BTM_SwitchRoleToCentral(const RawAddress& remote_bd_addr) { @@ -548,7 +550,7 @@ tBTM_STATUS BTM_SwitchRoleToCentral(const RawAddress& remote_bd_addr) { if (p_acl->link_role == HCI_ROLE_CENTRAL) { log::info("Requested role is already in effect"); - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } if (interop_match_addr(INTEROP_DISABLE_ROLE_SWITCH, &remote_bd_addr)) { @@ -563,7 +565,7 @@ tBTM_STATUS BTM_SwitchRoleToCentral(const RawAddress& remote_bd_addr) { if (!p_acl->is_switch_role_idle()) { log::info("Role switch is already progress"); - return BTM_BUSY; + return tBTM_STATUS::BTM_BUSY; } if (interop_match_addr(INTEROP_DYNAMIC_ROLE_SWITCH, &remote_bd_addr)) { @@ -597,7 +599,7 @@ tBTM_STATUS BTM_SwitchRoleToCentral(const RawAddress& remote_bd_addr) { } } - return BTM_CMD_STARTED; + return tBTM_STATUS::BTM_CMD_STARTED; } /******************************************************************************* @@ -1002,6 +1004,8 @@ void StackAclBtmAcl::btm_establish_continue(tACL_CONN* p_acl) { default_packet_type_mask, p_acl->RemoteAddress()); } btm_set_link_policy(p_acl, btm_cb.acl_cb_.DefaultLinkPolicy()); + } else if (p_acl->is_transport_ble()) { + btm_ble_connection_established(p_acl->remote_addr); } NotifyAclLinkUp(*p_acl); } @@ -1032,7 +1036,7 @@ tBTM_STATUS BTM_GetLinkSuperTout(const RawAddress& remote_bda, uint16_t* p_timeo return BTM_UNKNOWN_ADDR; } *p_timeout = p_acl->link_super_tout; - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } /******************************************************************************* @@ -1065,13 +1069,13 @@ tBTM_STATUS BTM_SetLinkSuperTout(const RawAddress& remote_bda, uint16_t timeout) btsnd_hcic_write_link_super_tout(p_acl->hci_handle, timeout); log::debug("Set supervision timeout:{:.2f}ms bd_addr:{}", supervision_timeout_to_seconds(timeout), remote_bda); - return BTM_CMD_STARTED; + return tBTM_STATUS::BTM_CMD_STARTED; } else { log::warn( "Role is peripheral so unable to set supervision timeout:{:.2f}ms " "bd_addr:{}", supervision_timeout_to_seconds(timeout), remote_bda); - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } } @@ -1558,7 +1562,7 @@ uint8_t* BTM_ReadRemoteFeatures(const RawAddress& addr) { * callback. * (tBTM_RSSI_RESULT) * - * Returns BTM_CMD_STARTED if successfully initiated or error code + * Returns tBTM_STATUS::BTM_CMD_STARTED if successfully initiated or error code * ******************************************************************************/ tBTM_STATUS BTM_ReadRSSI(const RawAddress& remote_bda, tBTM_CMPL_CB* p_cb) { @@ -1568,7 +1572,7 @@ tBTM_STATUS BTM_ReadRSSI(const RawAddress& remote_bda, tBTM_CMPL_CB* p_cb) { /* If someone already waiting on the version, do not allow another */ if (btm_cb.devcb.p_rssi_cmpl_cb) { - return BTM_BUSY; + return tBTM_STATUS::BTM_BUSY; } get_btm_client_interface().peer.BTM_ReadDevInfo(remote_bda, &dev_type, &addr_type); @@ -1587,7 +1591,7 @@ tBTM_STATUS BTM_ReadRSSI(const RawAddress& remote_bda, tBTM_CMPL_CB* p_cb) { btm_read_rssi_timeout, NULL); btsnd_hcic_read_rssi(p->hci_handle); - return BTM_CMD_STARTED; + return tBTM_STATUS::BTM_CMD_STARTED; } log::warn("Unable to find active acl"); @@ -1603,7 +1607,7 @@ tBTM_STATUS BTM_ReadRSSI(const RawAddress& remote_bda, tBTM_CMPL_CB* p_cb) { * The result is returned in the callback. * (tBTM_FAILED_CONTACT_COUNTER_RESULT) * - * Returns BTM_CMD_STARTED if successfully initiated or error code + * Returns tBTM_STATUS::BTM_CMD_STARTED if successfully initiated or error code * ******************************************************************************/ tBTM_STATUS BTM_ReadFailedContactCounter(const RawAddress& remote_bda, tBTM_CMPL_CB* p_cb) { @@ -1614,7 +1618,7 @@ tBTM_STATUS BTM_ReadFailedContactCounter(const RawAddress& remote_bda, tBTM_CMPL /* If someone already waiting on the result, do not allow another */ if (btm_cb.devcb.p_failed_contact_counter_cmpl_cb) { - return BTM_BUSY; + return tBTM_STATUS::BTM_BUSY; } get_btm_client_interface().peer.BTM_ReadDevInfo(remote_bda, &dev_type, &addr_type); @@ -1629,7 +1633,7 @@ tBTM_STATUS BTM_ReadFailedContactCounter(const RawAddress& remote_bda, tBTM_CMPL btm_read_failed_contact_counter_timeout, NULL); btsnd_hcic_read_failed_contact_counter(p->hci_handle); - return BTM_CMD_STARTED; + return tBTM_STATUS::BTM_CMD_STARTED; } log::warn("Unable to find active acl"); @@ -1646,7 +1650,7 @@ tBTM_STATUS BTM_ReadFailedContactCounter(const RawAddress& remote_bda, tBTM_CMPL * are returned in the callback. * (tBTM_RSSI_RESULT) * - * Returns BTM_CMD_STARTED if successfully initiated or error code + * Returns tBTM_STATUS::BTM_CMD_STARTED if successfully initiated or error code * ******************************************************************************/ tBTM_STATUS BTM_ReadTxPower(const RawAddress& remote_bda, tBT_TRANSPORT transport, @@ -1659,7 +1663,7 @@ tBTM_STATUS BTM_ReadTxPower(const RawAddress& remote_bda, tBT_TRANSPORT transpor /* If someone already waiting on the version, do not allow another */ if (btm_cb.devcb.p_tx_power_cmpl_cb) { - return BTM_BUSY; + return tBTM_STATUS::BTM_BUSY; } p = internal_.btm_bda_to_acl(remote_bda, transport); @@ -1675,7 +1679,7 @@ tBTM_STATUS BTM_ReadTxPower(const RawAddress& remote_bda, tBT_TRANSPORT transpor btsnd_hcic_read_tx_power(p->hci_handle, BTM_READ_RSSI_TYPE_CUR); } - return BTM_CMD_STARTED; + return tBTM_STATUS::BTM_CMD_STARTED; } log::warn("Unable to find active acl"); @@ -1727,7 +1731,7 @@ void btm_read_tx_power_complete(uint8_t* p, uint16_t evt_len, bool is_ble) { STREAM_TO_UINT8(result.hci_status, p); if (result.hci_status == HCI_SUCCESS) { - result.status = BTM_SUCCESS; + result.status = tBTM_STATUS::BTM_SUCCESS; if (!is_ble) { uint16_t handle; @@ -1826,7 +1830,7 @@ void btm_read_rssi_complete(uint8_t* p, uint16_t evt_len) { tACL_CONN* p_acl_cb = internal_.acl_get_connection_from_handle(handle); if (p_acl_cb != nullptr) { result.rem_bda = p_acl_cb->remote_addr; - result.status = BTM_SUCCESS; + result.status = tBTM_STATUS::BTM_SUCCESS; } } (*p_cb)(&result); @@ -1881,7 +1885,7 @@ void btm_read_failed_contact_counter_complete(uint8_t* p) { STREAM_TO_UINT8(result.hci_status, p); if (result.hci_status == HCI_SUCCESS) { - result.status = BTM_SUCCESS; + result.status = tBTM_STATUS::BTM_SUCCESS; STREAM_TO_UINT16(handle, p); @@ -1927,7 +1931,7 @@ void btm_read_automatic_flush_timeout_complete(uint8_t* p) { result.status = BTM_ERR_PROCESSING; if (result.hci_status == HCI_SUCCESS) { - result.status = BTM_SUCCESS; + result.status = tBTM_STATUS::BTM_SUCCESS; STREAM_TO_UINT16(handle, p); STREAM_TO_UINT16(result.automatic_flush_timeout, p); @@ -1950,7 +1954,7 @@ void btm_read_automatic_flush_timeout_complete(uint8_t* p) { * * Description This function is called to disconnect an ACL connection * - * Returns BTM_SUCCESS if successfully initiated, otherwise + * Returns tBTM_STATUS::BTM_SUCCESS if successfully initiated, otherwise * BTM_UNKNOWN_ADDR. * ******************************************************************************/ @@ -1973,11 +1977,11 @@ tBTM_STATUS btm_remove_acl(const RawAddress& bd_addr, tBT_TRANSPORT transport) { "transport:{}", bd_addr, bt_transport_text(transport)); p_acl->rs_disc_pending = BTM_SEC_DISC_PENDING; - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } disconnect_acl(*p_acl, HCI_ERR_PEER_USER, "stack::acl::btm_acl::btm_remove_acl"); - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } void btm_cont_rswitch_from_handle(uint16_t hci_handle) { diff --git a/system/stack/acl/btm_pm.cc b/system/stack/acl/btm_pm.cc index 2d566a0367..318517fc80 100644 --- a/system/stack/acl/btm_pm.cc +++ b/system/stack/acl/btm_pm.cc @@ -120,7 +120,7 @@ static tBTM_STATUS btm_pm_snd_md_req(uint16_t handle, uint8_t pm_id, int link_in * * Description register or deregister with power manager * - * Returns BTM_SUCCESS if successful, + * Returns tBTM_STATUS::BTM_SUCCESS if successful, * BTM_NO_RESOURCES if no room to hold registration * BTM_ILLEGAL_VALUE * @@ -132,7 +132,7 @@ tBTM_STATUS BTM_PmRegister(uint8_t mask, uint8_t* p_pm_id, tBTM_PM_STATUS_CBACK* return BTM_ILLEGAL_VALUE; } pm_reg_db.mask = BTM_PM_REC_NOT_USED; - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } if (pm_reg_db.mask == BTM_PM_REC_NOT_USED) { @@ -143,7 +143,7 @@ tBTM_STATUS BTM_PmRegister(uint8_t mask, uint8_t* p_pm_id, tBTM_PM_STATUS_CBACK* pm_reg_db.cback = p_cb; pm_reg_db.mask = mask; *p_pm_id = 0; - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } return BTM_NO_RESOURCES; @@ -174,7 +174,7 @@ void BTM_PM_OnDisconnected(uint16_t handle) { * Description store the mode in control block or * alter ACL connection behavior. * - * Returns BTM_SUCCESS if successful, + * Returns tBTM_STATUS::BTM_SUCCESS if successful, * BTM_UNKNOWN_ADDR if bd addr is not active or bad * ******************************************************************************/ @@ -231,7 +231,7 @@ tBTM_STATUS BTM_SetPowerMode(uint8_t pm_id, const RawAddress& remote_bda, "Device is already in requested mode {}, interval: {}, max: {}, min: " "{}", p_mode->mode, p_cb->interval, p_mode->max, p_mode->min); - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } } @@ -273,7 +273,7 @@ bool BTM_SetLinkPolicyActiveMode(const RawAddress& remote_bda) { switch (BTM_SetPowerMode(BTM_PM_SET_ONLY_ID, remote_bda, &settings)) { case BTM_CMD_STORED: - case BTM_SUCCESS: + case tBTM_STATUS::BTM_SUCCESS: return true; default: return false; @@ -307,7 +307,7 @@ bool BTM_ReadPowerMode(const RawAddress& remote_bda, tBTM_PM_MODE* p_mode) { * min_loc_to - minimum local timeout * * - * Returns BTM_SUCCESS if the HCI command is issued successful, + * Returns tBTM_STATUS::BTM_SUCCESS if the HCI command is issued successful, * BTM_UNKNOWN_ADDR if bd addr is not active or bad * BTM_CMD_STORED if the command is stored * @@ -322,7 +322,7 @@ tBTM_STATUS BTM_SetSsrParams(const RawAddress& remote_bda, uint16_t max_lat, uin if (!bluetooth::shim::GetController()->SupportsSniffSubrating()) { log::info("No controller support for sniff subrating"); - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } if (p_cb->state == BTM_PM_ST_ACTIVE || p_cb->state == BTM_PM_ST_SNIFF) { @@ -331,7 +331,7 @@ tBTM_STATUS BTM_SetSsrParams(const RawAddress& remote_bda, uint16_t max_lat, uin "min_remote_timeout:0x{:04x} min_local_timeout:0x{:04x}", power_mode_state_text(p_cb->state), p_cb->state, max_lat, min_rmt_to, min_loc_to); send_sniff_subrating(p_cb->handle_, remote_bda, max_lat, min_rmt_to, min_loc_to); - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } log::info("pm_mode_db state: {}", p_cb->state); p_cb->max_lat = max_lat; @@ -600,7 +600,7 @@ static tBTM_STATUS btm_pm_snd_md_req(uint16_t handle, uint8_t pm_id, int link_in return BTM_NO_RESOURCES; } - return BTM_CMD_STARTED; + return tBTM_STATUS::BTM_CMD_STARTED; } static void btm_pm_continue_pending_mode_changes() { diff --git a/system/stack/ais/ais_ble.cc b/system/stack/ais/ais_ble.cc new file mode 100644 index 0000000000..f545fc7981 --- /dev/null +++ b/system/stack/ais/ais_ble.cc @@ -0,0 +1,144 @@ +/****************************************************************************** + * + * Copyright 2024 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + ******************************************************************************/ + +#include <bluetooth/log.h> +#include <com_android_bluetooth_flags.h> +#include <string.h> + +#include <array> + +#include "os/system_properties.h" +#include "stack/include/ais_api.h" +#include "stack/include/bt_types.h" +#include "stack/include/gatt_api.h" +#include "types/bluetooth/uuid.h" + +using bluetooth::Uuid; +using bluetooth::log::error; +using bluetooth::log::warn; + +static const char kPropertyAndroidAPILevel[] = "ro.build.version.sdk"; +static const uint32_t kPropertyAndroidAPILevelDefault = 0; + +const Uuid ANDROID_INFORMATION_SERVICE_UUID = + Uuid::FromString(ANDROID_INFORMATION_SERVICE_UUID_STRING); +const Uuid GATT_UUID_AIS_API_LEVEL = Uuid::FromString(GATT_UUID_AIS_API_LEVEL_STRING); + +/* LE AIS attribute handle */ +static uint16_t attr_api_level_handle; + +static uint32_t api_level; + +void ais_request_cback(uint16_t, uint32_t, tGATTS_REQ_TYPE, tGATTS_DATA*); + +static tGATT_CBACK ais_cback = { + .p_conn_cb = nullptr, + .p_cmpl_cb = nullptr, + .p_disc_res_cb = nullptr, + .p_disc_cmpl_cb = nullptr, + .p_req_cb = ais_request_cback, + .p_enc_cmpl_cb = nullptr, + .p_congestion_cb = nullptr, + .p_phy_update_cb = nullptr, + .p_conn_update_cb = nullptr, + .p_subrate_chg_cb = nullptr, +}; + +/** AIS ATT server attribute access request callback */ +void ais_request_cback(uint16_t conn_id, uint32_t trans_id, tGATTS_REQ_TYPE type, + tGATTS_DATA* p_data) { + tGATT_STATUS status = GATT_INVALID_PDU; + tGATTS_RSP rsp_msg = {}; + uint16_t handle = p_data->read_req.handle; + tGATT_VALUE* p_value = &rsp_msg.attr_value; + uint8_t* p = p_value->value; + + if (type == GATTS_REQ_TYPE_READ_CHARACTERISTIC) { + p_value->handle = handle; + + if (handle == attr_api_level_handle) { + if (p_data->read_req.is_long) { + p_value->offset = p_data->read_req.offset; + status = GATT_NOT_LONG; + } else { + UINT32_TO_STREAM(p, api_level); + p_value->len = 4; + status = GATT_SUCCESS; + } + } else { + status = GATT_NOT_FOUND; + } + } else { + warn("Unknown/unexpected LE AIS ATT request: 0x{:02x}", type); + } + + if (GATTS_SendRsp(conn_id, trans_id, status, &rsp_msg) != GATT_SUCCESS) { + warn("Unable to send GATT server response conn_id:{}", conn_id); + } +} + +/******************************************************************************* + * + * Function ais_attr_db_init + * + * Description AIS ATT database initialization. + * + * Returns void. + * + ******************************************************************************/ +void ais_attr_db_init(void) { + if (!com::android::bluetooth::flags::android_os_identifier()) { + return; + } + api_level = bluetooth::os::GetSystemPropertyUint32(kPropertyAndroidAPILevel, + kPropertyAndroidAPILevelDefault); + // Add Android OS identifier if API level is defined. + if (api_level != kPropertyAndroidAPILevelDefault) { + std::array<uint8_t, Uuid::kNumBytes128> tmp; + tmp.fill(0xc5); // any number is fine here + Uuid app_uuid = Uuid::From128BitBE(tmp); + + tGATT_IF gatt_if = GATT_Register(app_uuid, "Ais", &ais_cback, false); + + GATT_StartIf(gatt_if); + + btgatt_db_element_t android_information_service[] = { + { + .uuid = ANDROID_INFORMATION_SERVICE_UUID, + .type = BTGATT_DB_PRIMARY_SERVICE, + }, + { + .uuid = GATT_UUID_AIS_API_LEVEL, + .type = BTGATT_DB_CHARACTERISTIC, + .properties = GATT_CHAR_PROP_BIT_READ, + .permissions = GATT_PERM_READ_IF_ENCRYPTED_OR_DISCOVERABLE, + }}; + if (GATTS_AddService(gatt_if, android_information_service, + sizeof(android_information_service) / sizeof(btgatt_db_element_t)) != + GATT_SERVICE_STARTED) { + error("Unable to add Android Information Server gatt_if:{}", gatt_if); + } + + attr_api_level_handle = android_information_service[1].attribute_handle; + } +} + +/* + * This routine should not be called except once per stack invocation. + */ +void AIS_Init(void) { ais_attr_db_init(); } diff --git a/system/stack/avct/avct_l2c.cc b/system/stack/avct/avct_l2c.cc index 225572d09f..c77e116bfb 100644 --- a/system/stack/avct/avct_l2c.cc +++ b/system/stack/avct/avct_l2c.cc @@ -104,7 +104,7 @@ static bool avct_l2c_is_passive(tAVCT_LCB* p_lcb) { * ******************************************************************************/ void avct_l2c_connect_ind_cback(const RawAddress& bd_addr, uint16_t lcid, uint16_t /* psm */, - uint8_t id) { + uint8_t /* id */) { tAVCT_LCB* p_lcb; uint16_t result = L2CAP_CONN_OK; @@ -252,7 +252,7 @@ void avct_l2c_connect_cfm_cback(uint16_t lcid, uint16_t result) { * Returns void * ******************************************************************************/ -void avct_l2c_config_cfm_cback(uint16_t lcid, uint16_t initiator, tL2CAP_CFG_INFO* p_cfg) { +void avct_l2c_config_cfm_cback(uint16_t lcid, uint16_t /* initiator */, tL2CAP_CFG_INFO* p_cfg) { avct_l2c_config_ind_cback(lcid, p_cfg); tAVCT_LCB* p_lcb; @@ -306,7 +306,7 @@ void avct_l2c_config_ind_cback(uint16_t lcid, tL2CAP_CFG_INFO* p_cfg) { * Returns void * ******************************************************************************/ -void avct_l2c_disconnect_ind_cback(uint16_t lcid, bool ack_needed) { +void avct_l2c_disconnect_ind_cback(uint16_t lcid, bool /* ack_needed */) { tAVCT_LCB* p_lcb; uint16_t result = AVCT_RESULT_FAIL; diff --git a/system/stack/avct/avct_l2c_br.cc b/system/stack/avct/avct_l2c_br.cc index a4e666e902..e4ff5a3c28 100644 --- a/system/stack/avct/avct_l2c_br.cc +++ b/system/stack/avct/avct_l2c_br.cc @@ -107,7 +107,7 @@ static bool avct_l2c_br_is_passive(tAVCT_BCB* p_bcb) { * ******************************************************************************/ void avct_l2c_br_connect_ind_cback(const RawAddress& bd_addr, uint16_t lcid, uint16_t /* psm */, - uint8_t id) { + uint8_t /* id */) { tAVCT_LCB* p_lcb; uint16_t result = L2CAP_CONN_NO_RESOURCES; tAVCT_BCB* p_bcb; @@ -233,7 +233,7 @@ void avct_l2c_br_connect_cfm_cback(uint16_t lcid, uint16_t result) { * Returns void * ******************************************************************************/ -void avct_l2c_br_config_cfm_cback(uint16_t lcid, uint16_t initiator, tL2CAP_CFG_INFO* p_cfg) { +void avct_l2c_br_config_cfm_cback(uint16_t lcid, uint16_t /* initiator */, tL2CAP_CFG_INFO* p_cfg) { avct_l2c_br_config_ind_cback(lcid, p_cfg); tAVCT_BCB* p_lcb; @@ -291,7 +291,7 @@ void avct_l2c_br_config_ind_cback(uint16_t lcid, tL2CAP_CFG_INFO* p_cfg) { * Returns void * ******************************************************************************/ -void avct_l2c_br_disconnect_ind_cback(uint16_t lcid, bool ack_needed) { +void avct_l2c_br_disconnect_ind_cback(uint16_t lcid, bool /* ack_needed */) { tAVCT_BCB* p_lcb; uint16_t result = AVCT_RESULT_FAIL; diff --git a/system/stack/avdt/avdt_l2c.cc b/system/stack/avdt/avdt_l2c.cc index f4e233477d..001f54eb9a 100644 --- a/system/stack/avdt/avdt_l2c.cc +++ b/system/stack/avdt/avdt_l2c.cc @@ -35,6 +35,7 @@ #include "osi/include/osi.h" #include "stack/include/acl_api.h" #include "stack/include/bt_hdr.h" +#include "stack/include/btm_status.h" #include "types/raw_address.h" using namespace bluetooth; @@ -75,8 +76,8 @@ const tL2CAP_APPL_INFO avdt_l2c_appl = {avdt_l2c_connect_ind_cback, * Returns void * ******************************************************************************/ -static void avdt_sec_check_complete_term(const RawAddress* bd_addr, tBT_TRANSPORT transport, - void* p_ref_data) { +static void avdt_sec_check_complete_term(const RawAddress* bd_addr, tBT_TRANSPORT /* transport */, + void* /* p_ref_data */) { AvdtpCcb* p_ccb = NULL; AvdtpTransportChannel* p_tbl; @@ -105,8 +106,8 @@ static void avdt_sec_check_complete_term(const RawAddress* bd_addr, tBT_TRANSPOR * Returns void * ******************************************************************************/ -static void avdt_sec_check_complete_orig(const RawAddress* bd_addr, tBT_TRANSPORT transport, - void* /* p_ref_data */, uint8_t res) { +static void avdt_sec_check_complete_orig(const RawAddress* bd_addr, tBT_TRANSPORT /* transport */, + void* /* p_ref_data */, tBTM_STATUS res) { AvdtpCcb* p_ccb = NULL; AvdtpTransportChannel* p_tbl; @@ -119,7 +120,7 @@ static void avdt_sec_check_complete_orig(const RawAddress* bd_addr, tBT_TRANSPOR return; } - if (res == BTM_SUCCESS) { + if (res == tBTM_STATUS::BTM_SUCCESS) { /* set channel state */ p_tbl->state = AVDT_AD_ST_CFG; } else { @@ -138,7 +139,7 @@ static void avdt_sec_check_complete_orig(const RawAddress* bd_addr, tBT_TRANSPOR * ******************************************************************************/ void avdt_l2c_connect_ind_cback(const RawAddress& bd_addr, uint16_t lcid, uint16_t /* psm */, - uint8_t id) { + uint8_t /* id */) { AvdtpCcb* p_ccb; AvdtpTransportChannel* p_tbl = NULL; uint16_t result; @@ -223,7 +224,7 @@ void avdt_l2c_connect_ind_cback(const RawAddress& bd_addr, uint16_t lcid, uint16 p_tbl->state = AVDT_AD_ST_CFG; } -static void avdt_on_l2cap_error(uint16_t lcid, uint16_t result) { avdt_l2c_disconnect(lcid); } +static void avdt_on_l2cap_error(uint16_t lcid, uint16_t /* result */) { avdt_l2c_disconnect(lcid); } /******************************************************************************* * @@ -270,7 +271,7 @@ void avdt_l2c_connect_cfm_cback(uint16_t lcid, uint16_t result) { /* Assume security check is complete */ avdt_sec_check_complete_orig(&p_ccb->peer_addr, BT_TRANSPORT_BR_EDR, nullptr, - BTM_SUCCESS); + tBTM_STATUS::BTM_SUCCESS); } } } @@ -293,7 +294,7 @@ void avdt_l2c_connect_cfm_cback(uint16_t lcid, uint16_t result) { * Returns void * ******************************************************************************/ -void avdt_l2c_config_cfm_cback(uint16_t lcid, uint16_t initiator, tL2CAP_CFG_INFO* p_cfg) { +void avdt_l2c_config_cfm_cback(uint16_t lcid, uint16_t /* initiator */, tL2CAP_CFG_INFO* p_cfg) { avdt_l2c_config_ind_cback(lcid, p_cfg); AvdtpTransportChannel* p_tbl; diff --git a/system/stack/avrc/avrc_pars_ct.cc b/system/stack/avrc/avrc_pars_ct.cc index ed65fc45e4..805365cc6f 100644 --- a/system/stack/avrc/avrc_pars_ct.cc +++ b/system/stack/avrc/avrc_pars_ct.cc @@ -537,7 +537,7 @@ browse_length_error: * ******************************************************************************/ static tAVRC_STS avrc_ctrl_pars_vendor_rsp(tAVRC_MSG_VENDOR* p_msg, tAVRC_RESPONSE* p_result, - uint8_t* p_buf, uint16_t* buf_len) { + uint8_t* /* p_buf */, uint16_t* /* buf_len */) { if (p_msg->vendor_len < 4) { log::warn("message length {} too short: must be at least 4", p_msg->vendor_len); return AVRC_STS_INTERNAL_ERR; diff --git a/system/stack/avrc/avrc_sdp.cc b/system/stack/avrc/avrc_sdp.cc index d412a672ad..cb209dde09 100644 --- a/system/stack/avrc/avrc_sdp.cc +++ b/system/stack/avrc/avrc_sdp.cc @@ -154,7 +154,7 @@ uint16_t AVRC_FindService(uint16_t service_uuid, const RawAddress& bd_addr, if (!result) { log::error("Failed to init SDP for peer {}", bd_addr); - avrc_sdp_cback(bd_addr, SDP_GENERIC_ERROR); + avrc_sdp_cback(bd_addr, tSDP_STATUS::SDP_GENERIC_ERROR); } } diff --git a/system/stack/bnep/bnep_api.cc b/system/stack/bnep/bnep_api.cc index af5196f269..34fa9561a5 100644 --- a/system/stack/bnep/bnep_api.cc +++ b/system/stack/bnep/bnep_api.cc @@ -133,7 +133,7 @@ void BNEP_Deregister(void) { * ******************************************************************************/ tBNEP_RESULT BNEP_Connect(const RawAddress& p_rem_bda, const Uuid& src_uuid, const Uuid& dst_uuid, - uint16_t* p_handle, uint32_t mx_chan_id) { + uint16_t* p_handle, uint32_t /* mx_chan_id */) { uint16_t cid; tBNEP_CONN* p_bcb = bnepu_find_bcb_by_bd_addr(p_rem_bda); diff --git a/system/stack/bnep/bnep_main.cc b/system/stack/bnep/bnep_main.cc index f0cac0b4cd..82df754046 100644 --- a/system/stack/bnep/bnep_main.cc +++ b/system/stack/bnep/bnep_main.cc @@ -110,7 +110,7 @@ tBNEP_RESULT bnep_register_with_l2cap(void) { * ******************************************************************************/ static void bnep_connect_ind(const RawAddress& bd_addr, uint16_t l2cap_cid, uint16_t /* psm */, - uint8_t l2cap_id) { + uint8_t /* l2cap_id */) { tBNEP_CONN* p_bcb = bnepu_find_bcb_by_bd_addr(bd_addr); /* If we are not acting as server, or already have a connection, or have */ @@ -134,7 +134,7 @@ static void bnep_connect_ind(const RawAddress& bd_addr, uint16_t l2cap_cid, uint log::debug("BNEP - Rcvd L2CAP conn ind, CID: 0x{:x}", p_bcb->l2cap_cid); } -static void bnep_on_l2cap_error(uint16_t l2cap_cid, uint16_t result) { +static void bnep_on_l2cap_error(uint16_t l2cap_cid, uint16_t /* result */) { tBNEP_CONN* p_bcb = bnepu_find_bcb_by_cid(l2cap_cid); if (p_bcb == nullptr) { return; @@ -197,7 +197,8 @@ static void bnep_connect_cfm(uint16_t l2cap_cid, uint16_t result) { * Returns void * ******************************************************************************/ -static void bnep_config_cfm(uint16_t l2cap_cid, uint16_t initiator, tL2CAP_CFG_INFO* p_cfg) { +static void bnep_config_cfm(uint16_t l2cap_cid, uint16_t /* initiator */, + tL2CAP_CFG_INFO* /* p_cfg */) { tBNEP_CONN* p_bcb; log::debug("BNEP - Rcvd cfg cfm, CID: 0x{:x}", l2cap_cid); @@ -230,7 +231,7 @@ static void bnep_config_cfm(uint16_t l2cap_cid, uint16_t initiator, tL2CAP_CFG_I * Returns void * ******************************************************************************/ -static void bnep_disconnect_ind(uint16_t l2cap_cid, bool ack_needed) { +static void bnep_disconnect_ind(uint16_t l2cap_cid, bool /* ack_needed */) { tBNEP_CONN* p_bcb; /* Find CCB based on CID */ diff --git a/system/stack/bnep/bnep_utils.cc b/system/stack/bnep/bnep_utils.cc index 0dcccf06de..fade195760 100644 --- a/system/stack/bnep/bnep_utils.cc +++ b/system/stack/bnep/bnep_utils.cc @@ -1125,7 +1125,8 @@ void bnepu_send_peer_multicast_filter_rsp(tBNEP_CONN* p_bcb, uint16_t response_c * Returns void * ******************************************************************************/ -void bnep_sec_check_complete(const RawAddress* bd_addr, tBT_TRANSPORT transport, void* p_ref_data) { +void bnep_sec_check_complete(const RawAddress* /* bd_addr */, tBT_TRANSPORT /* transport */, + void* p_ref_data) { tBNEP_CONN* p_bcb = (tBNEP_CONN*)p_ref_data; uint16_t resp_code = BNEP_SETUP_CONN_OK; bool is_role_change; diff --git a/system/stack/btm/btm_ble.cc b/system/stack/btm/btm_ble.cc index 600d852f2b..3a8d15acc6 100644 --- a/system/stack/btm/btm_ble.cc +++ b/system/stack/btm/btm_ble.cc @@ -156,10 +156,7 @@ void read_phy_cb(base::Callback<void(uint8_t tx_phy, uint8_t rx_phy, uint8_t sta * Description To read the current PHYs for specified LE connection * * - * Returns BTM_SUCCESS if command successfully sent to controller, - * BTM_MODE_UNSUPPORTED if local controller doesn't support LE - * 2M or LE Coded PHY, - * BTM_WRONG_MODE if Device in wrong mode for request. + * Returns void * ******************************************************************************/ void BTM_BleReadPhy(const RawAddress& bd_addr, diff --git a/system/stack/btm/btm_ble_adv_filter.cc b/system/stack/btm/btm_ble_adv_filter.cc index afe08ae8ce..1ea86d980c 100644 --- a/system/stack/btm/btm_ble_adv_filter.cc +++ b/system/stack/btm/btm_ble_adv_filter.cc @@ -22,11 +22,11 @@ #include <bluetooth/log.h> #include "btm_ble_api.h" -#include "os/log.h" #include "osi/include/allocator.h" #include "stack/btm/btm_ble_int.h" #include "stack/btm/btm_int_types.h" #include "stack/include/bt_types.h" +#include "stack/include/btm_status.h" #include "stack/include/btu_hcif.h" #include "types/bluetooth/uuid.h" #include "types/raw_address.h" @@ -140,7 +140,7 @@ static void btm_flt_update_cb(uint8_t expected_ocf, tBTM_BLE_PF_CFG_CBACK cb, ui return; } - tBTM_STATUS btm_status = (status == 0) ? BTM_SUCCESS : BTM_ERR_PROCESSING; + tBTM_STATUS btm_status = (status == 0) ? tBTM_STATUS::BTM_SUCCESS : BTM_ERR_PROCESSING; if (op_subcode == BTM_BLE_META_PF_FEAT_SEL) { cb.Run(num_avail, static_cast<tBTM_BLE_SCAN_COND_OP>(action), btm_status); diff --git a/system/stack/btm/btm_ble_cont_energy.cc b/system/stack/btm/btm_ble_cont_energy.cc index fc95f85caa..c726833c0c 100644 --- a/system/stack/btm/btm_ble_cont_energy.cc +++ b/system/stack/btm/btm_ble_cont_energy.cc @@ -98,5 +98,5 @@ tBTM_STATUS BTM_BleGetEnergyInfo(tBTM_BLE_ENERGY_INFO_CBACK* p_ener_cback) { ble_energy_info_cb.p_ener_cback = p_ener_cback; get_btm_client_interface().vendor.BTM_VendorSpecificCommand(HCI_BLE_ENERGY_INFO, 0, NULL, btm_ble_cont_energy_cmpl_cback); - return BTM_CMD_STARTED; + return tBTM_STATUS::BTM_CMD_STARTED; } diff --git a/system/stack/btm/btm_ble_gap.cc b/system/stack/btm/btm_ble_gap.cc index 25d4aeb321..a0f5a9f972 100644 --- a/system/stack/btm/btm_ble_gap.cc +++ b/system/stack/btm/btm_ble_gap.cc @@ -61,6 +61,7 @@ #include "stack/include/btm_ble_addr.h" #include "stack/include/btm_ble_privacy.h" #include "stack/include/btm_log_history.h" +#include "stack/include/btm_status.h" #include "stack/include/gap_api.h" #include "stack/include/gattdefs.h" #include "stack/include/hci_error_code.h" @@ -550,7 +551,7 @@ tBTM_STATUS BTM_BleObserve(bool start, uint8_t duration, tBTM_INQ_RESULTS_CB* p_ btm_cb.ble_ctr_cb.inq_var.scan_window == ll_scan_window; if (is_ongoing_low_latency) { log::warn("Observer was already active, is_low_latency: {}", is_ongoing_low_latency); - return BTM_CMD_STARTED; + return tBTM_STATUS::BTM_CMD_STARTED; } // stop any scan without low latency config btm_ble_stop_observe(); @@ -558,7 +559,7 @@ tBTM_STATUS BTM_BleObserve(bool start, uint8_t duration, tBTM_INQ_RESULTS_CB* p_ btm_cb.ble_ctr_cb.p_obs_results_cb = p_results_cb; btm_cb.ble_ctr_cb.p_obs_cmpl_cb = p_cmpl_cb; - status = BTM_CMD_STARTED; + status = tBTM_STATUS::BTM_CMD_STARTED; /* scan is not started */ if (!btm_cb.ble_ctr_cb.is_ble_scan_active()) { @@ -584,7 +585,7 @@ tBTM_STATUS BTM_BleObserve(bool start, uint8_t duration, tBTM_INQ_RESULTS_CB* p_ BTM_LogHistory(kBtmLogTag, RawAddress::kEmpty, "Le observe started", "low latency scanning enabled"); - if (status == BTM_CMD_STARTED) { + if (status == tBTM_STATUS::BTM_CMD_STARTED) { btm_cb.ble_ctr_cb.set_ble_observe_active(); if (duration != 0) { /* start observer timer */ @@ -600,7 +601,7 @@ tBTM_STATUS BTM_BleObserve(bool start, uint8_t duration, tBTM_INQ_RESULTS_CB* p_ base::StringPrintf("duration_s:%6.3f results:%-3lu", (double)duration_timestamp / 1000.0, btm_cb.neighbor.le_observe.results)); - status = BTM_CMD_STARTED; + status = tBTM_STATUS::BTM_CMD_STARTED; btm_ble_stop_observe(); } else { log::error("Observe not active"); @@ -1005,7 +1006,7 @@ void btm_ble_periodic_adv_sync_established(uint8_t status, uint16_t sync_handle, /*if (param_len != ADV_SYNC_ESTB_EVT_LEN) { log::error("[PSync]Invalid event length"); STREAM_TO_UINT8(status, param); - if (status == BTM_SUCCESS) { + if (status == tBTM_STATUS::BTM_SUCCESS) { STREAM_TO_UINT16(sync_handle, param); //btsnd_hcic_ble_terminate_periodic_sync(sync_handle); if (BleScanningManager::IsInitialized()) { @@ -1303,7 +1304,7 @@ void btm_ble_set_adv_flag(uint16_t connect_mode, uint16_t disc_mode) { * * Parameters: combined_mode: discoverability mode. * - * Returns BTM_SUCCESS is status set successfully; otherwise failure. + * Returns tBTM_STATUS::BTM_SUCCESS is status set successfully; otherwise failure. * ******************************************************************************/ tBTM_STATUS btm_ble_set_discoverability(uint16_t combined_mode) { @@ -1311,7 +1312,7 @@ tBTM_STATUS btm_ble_set_discoverability(uint16_t combined_mode) { uint16_t mode = (combined_mode & BTM_BLE_DISCOVERABLE_MASK); uint8_t new_mode = BTM_BLE_ADV_ENABLE; uint8_t evt_type; - tBTM_STATUS status = BTM_SUCCESS; + tBTM_STATUS status = tBTM_STATUS::BTM_SUCCESS; RawAddress address = RawAddress::kEmpty; tBLE_ADDR_TYPE init_addr_type = BLE_ADDR_PUBLIC, own_addr_type = p_addr_cb->own_addr_type; uint16_t adv_int_min, adv_int_max; @@ -1357,7 +1358,7 @@ tBTM_STATUS btm_ble_set_discoverability(uint16_t combined_mode) { } } - if (status == BTM_SUCCESS && btm_cb.ble_ctr_cb.inq_var.adv_mode != new_mode) { + if (status == tBTM_STATUS::BTM_SUCCESS && btm_cb.ble_ctr_cb.inq_var.adv_mode != new_mode) { if (new_mode == BTM_BLE_ADV_ENABLE) { status = btm_ble_start_adv(); } else { @@ -1373,7 +1374,7 @@ tBTM_STATUS btm_ble_set_discoverability(uint16_t combined_mode) { } /* set up stop advertising timer */ - if (status == BTM_SUCCESS && mode == BTM_BLE_LIMITED_DISCOVERABLE) { + if (status == tBTM_STATUS::BTM_SUCCESS && mode == BTM_BLE_LIMITED_DISCOVERABLE) { log::verbose("start timer for limited disc mode duration={} ms", BTM_BLE_GAP_LIM_TIMEOUT_MS); /* start Tgap(lim_timeout) */ alarm_set_on_mloop(btm_cb.ble_ctr_cb.inq_var.inquiry_timer, BTM_BLE_GAP_LIM_TIMEOUT_MS, @@ -1390,7 +1391,7 @@ tBTM_STATUS btm_ble_set_discoverability(uint16_t combined_mode) { * * Parameters: combined_mode: connectability mode. * - * Returns BTM_SUCCESS is status set successfully; otherwise failure. + * Returns tBTM_STATUS::BTM_SUCCESS is status set successfully; otherwise failure. * ******************************************************************************/ tBTM_STATUS btm_ble_set_connectability(uint16_t combined_mode) { @@ -1398,7 +1399,7 @@ tBTM_STATUS btm_ble_set_connectability(uint16_t combined_mode) { uint16_t mode = (combined_mode & BTM_BLE_CONNECTABLE_MASK); uint8_t new_mode = BTM_BLE_ADV_ENABLE; uint8_t evt_type; - tBTM_STATUS status = BTM_SUCCESS; + tBTM_STATUS status = tBTM_STATUS::BTM_SUCCESS; RawAddress address = RawAddress::kEmpty; tBLE_ADDR_TYPE peer_addr_type = BLE_ADDR_PUBLIC, own_addr_type = p_addr_cb->own_addr_type; uint16_t adv_int_min, adv_int_max; @@ -1439,7 +1440,7 @@ tBTM_STATUS btm_ble_set_connectability(uint16_t combined_mode) { } /* update advertising mode */ - if (status == BTM_SUCCESS && new_mode != btm_cb.ble_ctr_cb.inq_var.adv_mode) { + if (status == tBTM_STATUS::BTM_SUCCESS && new_mode != btm_cb.ble_ctr_cb.inq_var.adv_mode) { if (new_mode == BTM_BLE_ADV_ENABLE) { status = btm_ble_start_adv(); } else { @@ -1489,8 +1490,8 @@ void btm_send_hci_set_scan_params(uint8_t scan_type, uint16_t scan_int, uint16_t static void btm_ble_scan_filt_param_cfg_evt(uint8_t /* avbl_space */, tBTM_BLE_SCAN_COND_OP /* action_type */, tBTM_STATUS btm_status) { - if (btm_status != btm_status_value(BTM_SUCCESS)) { - log::error("{}", btm_status); + if (btm_status != tBTM_STATUS::BTM_SUCCESS) { + log::error("{}", btm_status_text(btm_status)); } else { log::verbose(""); } @@ -1504,10 +1505,12 @@ static void btm_ble_scan_filt_param_cfg_evt(uint8_t /* avbl_space */, * If the duration is zero, the periodic inquiry mode is * cancelled. * - * Parameters: duration - Duration of inquiry in seconds + * Parameters: duration - Duration of inquiry in seconds. With flag + * le_inquiry_duration duration is a multiplier for + * 1.28 seconds. * - * Returns BTM_CMD_STARTED if successfully started - * BTM_BUSY - if an inquiry is already active + * Returns tBTM_STATUS::BTM_CMD_STARTED if successfully started + * tBTM_STATUS::BTM_BUSY - if an inquiry is already active * ******************************************************************************/ tBTM_STATUS btm_ble_start_inquiry(uint8_t duration) { @@ -1517,7 +1520,7 @@ tBTM_STATUS btm_ble_start_inquiry(uint8_t duration) { */ if (btm_cb.ble_ctr_cb.is_ble_inquiry_active()) { log::error("LE Inquiry is active, can not start inquiry"); - return BTM_BUSY; + return tBTM_STATUS::BTM_BUSY; } /* Cleanup anything remaining on index 0 */ @@ -1550,8 +1553,10 @@ tBTM_STATUS btm_ble_start_inquiry(uint8_t duration) { } else if ((btm_cb.ble_ctr_cb.inq_var.scan_interval != scan_interval) || (btm_cb.ble_ctr_cb.inq_var.scan_window != scan_window)) { log::verbose("restart LE scan with low latency scan params"); - btm_cb.ble_ctr_cb.inq_var.scan_interval = scan_interval; - btm_cb.ble_ctr_cb.inq_var.scan_window = scan_window; + if (!com::android::bluetooth::flags::le_inquiry_duration()) { + btm_cb.ble_ctr_cb.inq_var.scan_interval = scan_interval; + btm_cb.ble_ctr_cb.inq_var.scan_window = scan_window; + } btm_send_hci_scan_enable(BTM_BLE_SCAN_DISABLE, BTM_BLE_DUPLICATE_ENABLE); btm_send_hci_set_scan_params(BTM_BLE_SCAN_MODE_ACTI, scan_interval, scan_window, scan_phy, btm_cb.ble_ctr_cb.addr_mgnt_cb.own_addr_type, SP_ADV_ALL); @@ -1565,7 +1570,8 @@ tBTM_STATUS btm_ble_start_inquiry(uint8_t duration) { if (duration != 0) { /* start inquiry timer */ - uint64_t duration_ms = duration * 1000; + uint64_t duration_ms = + duration * (com::android::bluetooth::flags::le_inquiry_duration() ? 1280 : 1000); alarm_set_on_mloop(btm_cb.ble_ctr_cb.inq_var.inquiry_timer, duration_ms, btm_ble_inquiry_timer_timeout, NULL); } @@ -1576,7 +1582,7 @@ tBTM_STATUS btm_ble_start_inquiry(uint8_t duration) { }; BTM_LogHistory(kBtmLogTag, RawAddress::kEmpty, "Le inquiry started"); - return BTM_CMD_STARTED; + return tBTM_STATUS::BTM_CMD_STARTED; } /******************************************************************************* @@ -1629,11 +1635,11 @@ tBTM_STATUS btm_ble_read_remote_name(const RawAddress& remote_bda, tBTM_NAME_CMP if (btm_cb.rnr.remname_active) { log::warn("Unable to start GATT RNR procedure for peer:{} busy with peer:{}", remote_bda, btm_cb.rnr.remname_bda); - return BTM_BUSY; + return tBTM_STATUS::BTM_BUSY; } if (!GAP_BleReadPeerDevName(remote_bda, btm_ble_read_remote_name_cmpl)) { - return BTM_BUSY; + return tBTM_STATUS::BTM_BUSY; } btm_cb.rnr.p_remname_cmpl_cb = p_cb; @@ -1644,7 +1650,7 @@ tBTM_STATUS btm_ble_read_remote_name(const RawAddress& remote_bda, tBTM_NAME_CMP alarm_set_on_mloop(btm_cb.rnr.remote_name_timer, BTM_EXT_BLE_RMT_NAME_TIMEOUT_MS, btm_inq_remote_name_timer_timeout, NULL); - return BTM_CMD_STARTED; + return tBTM_STATUS::BTM_CMD_STARTED; } /******************************************************************************* @@ -2499,7 +2505,7 @@ static tBTM_STATUS btm_ble_start_adv(void) { btm_ble_adv_states_operation(btm_ble_set_topology_mask, btm_cb.ble_ctr_cb.inq_var.evt_type); power_telemetry::GetInstance().LogBleAdvStarted(); - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } /******************************************************************************* @@ -2521,7 +2527,7 @@ static tBTM_STATUS btm_ble_stop_adv(void) { btm_ble_clear_topology_mask(BTM_BLE_STATE_ALL_ADV_MASK); power_telemetry::GetInstance().LogBleAdvStopped(); } - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } static void btm_ble_fast_adv_timer_timeout(void* /* data */) { diff --git a/system/stack/btm/btm_ble_int.h b/system/stack/btm/btm_ble_int.h index 60d19c16eb..fad1f3d377 100644 --- a/system/stack/btm/btm_ble_int.h +++ b/system/stack/btm/btm_ble_int.h @@ -41,6 +41,7 @@ void btm_ble_free(); void btm_ble_connected(const RawAddress& bda, uint16_t handle, uint8_t enc_mode, uint8_t role, tBLE_ADDR_TYPE addr_type, bool addr_matched, bool can_read_discoverable_characteristics); +void btm_ble_connection_established(const RawAddress& bda); /* acceptlist function */ void btm_update_scanner_filter_policy(tBTM_BLE_SFP scan_policy); diff --git a/system/stack/btm/btm_ble_privacy.cc b/system/stack/btm/btm_ble_privacy.cc index 5e807c1ea4..c1f8a5b358 100644 --- a/system/stack/btm/btm_ble_privacy.cc +++ b/system/stack/btm/btm_ble_privacy.cc @@ -458,7 +458,7 @@ static tBTM_STATUS btm_ble_remove_resolving_list_entry(tBTM_SEC_DEV_REC* p_dev_r btm_ble_resolving_list_vsc_op_cmpl); btm_ble_enq_resolving_list_pending(p_dev_rec->bd_addr, BTM_BLE_META_REMOVE_IRK_ENTRY); } - return BTM_CMD_STARTED; + return tBTM_STATUS::BTM_CMD_STARTED; } /******************************************************************************* diff --git a/system/stack/btm/btm_ble_sec.cc b/system/stack/btm/btm_ble_sec.cc index 71fb69b7b4..1265d57f0c 100644 --- a/system/stack/btm/btm_ble_sec.cc +++ b/system/stack/btm/btm_ble_sec.cc @@ -22,6 +22,7 @@ #include <android_bluetooth_sysprop.h> #include <base/strings/stringprintf.h> #include <bluetooth/log.h> +#include <com_android_bluetooth_flags.h> #include <cstddef> #include <cstdint> @@ -65,6 +66,7 @@ using namespace bluetooth; extern tBTM_CB btm_cb; bool btm_ble_init_pseudo_addr(tBTM_SEC_DEV_REC* p_dev_rec, const RawAddress& new_pseudo_addr); +tBTM_STATUS btm_ble_read_remote_name(const RawAddress& remote_bda, tBTM_NAME_CMPL_CB* p_cb); namespace { constexpr char kBtmLogTag[] = "SEC"; @@ -98,9 +100,17 @@ void BTM_SecAddBleDevice(const RawAddress& bd_addr, tBT_DEVICE_TYPE dev_type, log::debug("Device added, handle=0x{:x}, p_dev_rec={}, bd_addr={}", p_dev_rec->ble_hci_handle, fmt::ptr(p_dev_rec), bd_addr); + + if (com::android::bluetooth::flags::name_discovery_for_le_pairing() && + btif_storage_get_stored_remote_name(bd_addr, + reinterpret_cast<char*>(&p_dev_rec->sec_bd_name))) { + p_dev_rec->sec_rec.sec_flags |= BTM_SEC_NAME_KNOWN; + } } - memset(p_dev_rec->sec_bd_name, 0, sizeof(BD_NAME)); + if (!com::android::bluetooth::flags::name_discovery_for_le_pairing()) { + bd_name_clear(p_dev_rec->sec_bd_name); + } p_dev_rec->device_type |= dev_type; if (is_ble_addr_type_known(addr_type)) { @@ -230,15 +240,16 @@ const Octet16& BTM_GetDeviceDHK() { return btm_sec_cb.devcb.id_keys.dhk; } * Description This function is called to grant security process. * * Parameters bd_addr - peer device bd address. - * res - result of the operation BTM_SUCCESS if success. + * res - result of the operation tBTM_STATUS::BTM_SUCCESS if success. * Otherwise, BTM_REPEATED_ATTEMPTS if too many * attempts. * * Returns None * ******************************************************************************/ -void BTM_SecurityGrant(const RawAddress& bd_addr, uint8_t res) { - const tSMP_STATUS res_smp = (res == BTM_SUCCESS) ? SMP_SUCCESS : SMP_REPEATED_ATTEMPTS; +void BTM_SecurityGrant(const RawAddress& bd_addr, tBTM_STATUS res) { + const tSMP_STATUS res_smp = + (res == tBTM_STATUS::BTM_SUCCESS) ? SMP_SUCCESS : SMP_REPEATED_ATTEMPTS; log::verbose("bd_addr:{}, res:{}", bd_addr, smp_status_text(res_smp)); BTM_LogHistory(kBtmLogTag, bd_addr, "Granted", base::StringPrintf("passkey_status:%s", smp_status_text(res_smp).c_str())); @@ -255,12 +266,12 @@ void BTM_SecurityGrant(const RawAddress& bd_addr, uint8_t res) { * * Parameters: bd_addr - Address of the device for which passkey was * requested - * res - result of the operation BTM_SUCCESS if success + * res - result of the operation tBTM_STATUS::BTM_SUCCESS if success * key_len - length in bytes of the Passkey * p_passkey - pointer to array with the passkey * ******************************************************************************/ -void BTM_BlePasskeyReply(const RawAddress& bd_addr, uint8_t res, uint32_t passkey) { +void BTM_BlePasskeyReply(const RawAddress& bd_addr, tBTM_STATUS res, uint32_t passkey) { tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev(bd_addr); log::verbose("bd_addr:{}, res:{}", bd_addr, res); if (p_dev_rec == NULL) { @@ -268,7 +279,8 @@ void BTM_BlePasskeyReply(const RawAddress& bd_addr, uint8_t res, uint32_t passke return; } - const tSMP_STATUS res_smp = (res == BTM_SUCCESS) ? SMP_SUCCESS : SMP_PASSKEY_ENTRY_FAIL; + const tSMP_STATUS res_smp = + (res == tBTM_STATUS::BTM_SUCCESS) ? SMP_SUCCESS : SMP_PASSKEY_ENTRY_FAIL; BTM_LogHistory(kBtmLogTag, bd_addr, "Passkey reply", base::StringPrintf("transport:%s authenticate_status:%s", bt_transport_text(BT_TRANSPORT_LE).c_str(), @@ -287,17 +299,18 @@ void BTM_BlePasskeyReply(const RawAddress& bd_addr, uint8_t res, uint32_t passke * * Parameters: bd_addr - Address of the device with which numeric * comparison was requested - * res - comparison result BTM_SUCCESS if success + * res - comparison result tBTM_STATUS::BTM_SUCCESS if success * ******************************************************************************/ -void BTM_BleConfirmReply(const RawAddress& bd_addr, uint8_t res) { +void BTM_BleConfirmReply(const RawAddress& bd_addr, tBTM_STATUS res) { tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev(bd_addr); log::verbose("bd_addr:{}, res:{}", bd_addr, res); if (p_dev_rec == NULL) { log::error("Unknown device:{}", bd_addr); return; } - const tSMP_STATUS res_smp = (res == BTM_SUCCESS) ? SMP_SUCCESS : SMP_PASSKEY_ENTRY_FAIL; + const tSMP_STATUS res_smp = + (res == tBTM_STATUS::BTM_SUCCESS) ? SMP_SUCCESS : SMP_PASSKEY_ENTRY_FAIL; BTM_LogHistory(kBtmLogTag, bd_addr, "Confirm reply", base::StringPrintf("transport:%s numeric_comparison_authenticate_status:%s", @@ -323,14 +336,14 @@ void BTM_BleConfirmReply(const RawAddress& bd_addr, uint8_t res) { * "Security Manager TK Value". * ******************************************************************************/ -void BTM_BleOobDataReply(const RawAddress& bd_addr, uint8_t res, uint8_t len, uint8_t* p_data) { +void BTM_BleOobDataReply(const RawAddress& bd_addr, tBTM_STATUS res, uint8_t len, uint8_t* p_data) { tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev(bd_addr); if (p_dev_rec == NULL) { log::error("Unknown device:{}", bd_addr); return; } - const tSMP_STATUS res_smp = (res == BTM_SUCCESS) ? SMP_SUCCESS : SMP_OOB_FAIL; + const tSMP_STATUS res_smp = (res == tBTM_STATUS::BTM_SUCCESS) ? SMP_SUCCESS : SMP_OOB_FAIL; BTM_LogHistory(kBtmLogTag, bd_addr, "Oob data reply", base::StringPrintf("transport:%s authenticate_status:%s", bt_transport_text(BT_TRANSPORT_LE).c_str(), @@ -579,7 +592,7 @@ tBTM_STATUS BTM_SetBleDataLength(const RawAddress& bd_addr, uint16_t tx_pdu_leng if (p_dev_rec->get_suggested_tx_octets() >= tx_pdu_length) { log::info("Suggested TX octect already set to controller {} >= {}", p_dev_rec->get_suggested_tx_octets(), tx_pdu_length); - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } uint16_t tx_time = BTM_BLE_DATA_TX_TIME_MAX_LEGACY; @@ -612,7 +625,7 @@ tBTM_STATUS BTM_SetBleDataLength(const RawAddress& bd_addr, uint16_t tx_pdu_leng btsnd_hcic_ble_set_data_length(hci_handle, tx_pdu_length, tx_time); p_dev_rec->set_suggested_tx_octect(tx_pdu_length); - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } /******************************************************************************* @@ -747,7 +760,7 @@ tBTM_STATUS btm_ble_start_sec_check(const RawAddress& bd_addr, uint16_t psm, boo switch (sec_act) { case BTM_SEC_OK: log::debug("Security met"); - p_callback(bd_addr, BT_TRANSPORT_LE, p_ref_data, BTM_SUCCESS); + p_callback(bd_addr, BT_TRANSPORT_LE, p_ref_data, tBTM_STATUS::BTM_SUCCESS); break; case BTM_SEC_ENCRYPT: @@ -771,14 +784,14 @@ tBTM_STATUS btm_ble_start_sec_check(const RawAddress& bd_addr, uint16_t psm, boo } if (ble_sec_act == BTM_BLE_SEC_NONE && sec_act != BTM_SEC_ENC_PENDING) { - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } l2cble_update_sec_act(bd_addr, sec_act); BTM_SetEncryption(bd_addr, BT_TRANSPORT_LE, p_callback, p_ref_data, ble_sec_act); - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } /******************************************************************************* @@ -1134,7 +1147,7 @@ tBTM_STATUS btm_ble_set_encryption(const RawAddress& bd_addr, tBTM_BLE_SEC_ACT s btm_ble_link_sec_check(bd_addr, auth_req, &sec_req_act); if (sec_req_act == BTM_BLE_SEC_REQ_ACT_NONE || sec_req_act == BTM_BLE_SEC_REQ_ACT_DISCARD) { log::verbose("no action needed. Ignore"); - cmd = BTM_SUCCESS; + cmd = tBTM_STATUS::BTM_SUCCESS; break; } if (link_role == HCI_ROLE_CENTRAL) { @@ -1145,7 +1158,7 @@ tBTM_STATUS btm_ble_set_encryption(const RawAddress& bd_addr, tBTM_BLE_SEC_ACT s } if (SMP_Pair(bd_addr) == SMP_STARTED) { - cmd = BTM_CMD_STARTED; + cmd = tBTM_STATUS::BTM_CMD_STARTED; p_rec->sec_rec.le_link = tSECURITY_STATE::AUTHENTICATING; } break; @@ -1186,7 +1199,7 @@ void btm_ble_ltk_request(uint16_t handle, BT_OCTET8 rand, uint16_t ediv) { } /** This function is called to start LE encryption. - * Returns BTM_SUCCESS if encryption was started successfully + * Returns tBTM_STATUS::BTM_SUCCESS if encryption was started successfully */ tBTM_STATUS btm_ble_start_encrypt(const RawAddress& bda, bool use_stk, Octet16* p_stk) { tBTM_SEC_CB* p_cb = &btm_sec_cb; @@ -1202,7 +1215,7 @@ tBTM_STATUS btm_ble_start_encrypt(const RawAddress& bda, bool use_stk, Octet16* if (p_rec->sec_rec.is_security_state_le_encrypting()) { log::warn("LE link encryption is active, Busy!"); - return BTM_BUSY; + return tBTM_STATUS::BTM_BUSY; } // Some controllers may not like encrypting both transports at the same time @@ -1210,7 +1223,7 @@ tBTM_STATUS btm_ble_start_encrypt(const RawAddress& bda, bool use_stk, Octet16* android::sysprop::bluetooth::Ble::allow_enc_with_bredr().value_or(false); if (!allow_le_enc_with_bredr && p_rec->sec_rec.is_security_state_bredr_encrypting()) { log::warn("BR/EDR link encryption is active, Busy!"); - return BTM_BUSY; + return tBTM_STATUS::BTM_BUSY; } p_cb->enc_handle = p_rec->ble_hci_handle; @@ -1229,7 +1242,7 @@ tBTM_STATUS btm_ble_start_encrypt(const RawAddress& bda, bool use_stk, Octet16* p_rec->sec_rec.le_link = tSECURITY_STATE::ENCRYPTING; } - return BTM_CMD_STARTED; + return tBTM_STATUS::BTM_CMD_STARTED; } /******************************************************************************* @@ -1298,7 +1311,7 @@ void btm_ble_link_encrypted(const RawAddress& bd_addr, uint8_t encr_enable) { p_dev_rec->sec_rec.le_link = tSECURITY_STATE::IDLE; if (p_dev_rec->sec_rec.p_callback && enc_cback) { if (encr_enable) { - btm_sec_dev_rec_cback_event(p_dev_rec, BTM_SUCCESS, true); + btm_sec_dev_rec_cback_event(p_dev_rec, tBTM_STATUS::BTM_SUCCESS, true); } /* LTK missing on peripheral */ else if (p_dev_rec->role_central && (p_dev_rec->sec_rec.sec_status == HCI_ERR_KEY_MISSING)) { @@ -1390,15 +1403,16 @@ void btm_ble_ltk_request_reply(const RawAddress& bda, bool use_stk, const Octet1 * Returns void * ******************************************************************************/ -static uint8_t btm_ble_io_capabilities_req(tBTM_SEC_DEV_REC* p_dev_rec, tBTM_LE_IO_REQ* p_data) { - uint8_t callback_rc = BTM_SUCCESS; +static tBTM_STATUS btm_ble_io_capabilities_req(tBTM_SEC_DEV_REC* p_dev_rec, + tBTM_LE_IO_REQ* p_data) { + tBTM_STATUS callback_rc = BTM_SUCCESS; log::verbose("p_dev_rec->bd_addr:{}", p_dev_rec->bd_addr); if (btm_sec_cb.api.p_le_callback) { /* the callback function implementation may change the IO capability... */ callback_rc = (*btm_sec_cb.api.p_le_callback)(BTM_LE_IO_REQ_EVT, p_dev_rec->bd_addr, (tBTM_LE_EVT_DATA*)p_data); } - if ((callback_rc == BTM_SUCCESS) || (BTM_OOB_UNKNOWN != p_data->oob_data)) { + if ((callback_rc == tBTM_STATUS::BTM_SUCCESS) || (BTM_OOB_UNKNOWN != p_data->oob_data)) { p_data->auth_req &= BTM_LE_AUTH_REQ_MASK; log::verbose("1:p_dev_rec->sec_rec.security_required={}, auth_req:{}", @@ -1453,8 +1467,8 @@ static uint8_t btm_ble_io_capabilities_req(tBTM_SEC_DEV_REC* p_dev_rec, tBTM_LE_ * Returns void * ******************************************************************************/ -static uint8_t btm_ble_br_keys_req(tBTM_SEC_DEV_REC* p_dev_rec, tBTM_LE_IO_REQ* p_data) { - uint8_t callback_rc = BTM_SUCCESS; +static tBTM_STATUS btm_ble_br_keys_req(tBTM_SEC_DEV_REC* p_dev_rec, tBTM_LE_IO_REQ* p_data) { + tBTM_STATUS callback_rc = tBTM_STATUS::BTM_SUCCESS; log::verbose("p_dev_rec->bd_addr:{}", p_dev_rec->bd_addr); *p_data = tBTM_LE_IO_REQ{ .io_cap = BTM_IO_CAP_UNKNOWN, @@ -1477,8 +1491,7 @@ static uint8_t btm_ble_br_keys_req(tBTM_SEC_DEV_REC* p_dev_rec, tBTM_LE_IO_REQ* * * Function btm_ble_connected * - * Description This function is when a LE connection to the peer device is - * establsihed + * Description This function is called on LE connection * * Returns void * @@ -1513,6 +1526,27 @@ void btm_ble_connected(const RawAddress& bda, uint16_t handle, uint8_t /* enc_mo btm_cb.ble_ctr_cb.inq_var.directed_conn = BTM_BLE_ADV_IND_EVT; } +/******************************************************************************* + * + * Function btm_ble_connection_established + * + * Description This function when LE connection is established + * + * Returns void + * + ******************************************************************************/ +void btm_ble_connection_established(const RawAddress& bda) { + if (!com::android::bluetooth::flags::name_discovery_for_le_pairing()) { + return; + } + + // Read device name if it is not known already, we may need it for pairing + tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev(bda); + if (p_dev_rec != nullptr && !p_dev_rec->sec_rec.is_name_known()) { + btm_ble_read_remote_name(bda, nullptr); + } +} + /***************************************************************************** * Function btm_proc_smp_cback * @@ -1525,11 +1559,11 @@ tBTM_STATUS btm_proc_smp_cback(tSMP_EVT event, const RawAddress& bd_addr, if (event == SMP_SC_LOC_OOB_DATA_UP_EVT) { btm_sec_cr_loc_oob_data_cback_event(RawAddress{}, p_data->loc_oob_data); - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev(bd_addr); - tBTM_STATUS res = BTM_SUCCESS; + tBTM_STATUS res = tBTM_STATUS::BTM_SUCCESS; if (p_dev_rec != NULL) { switch (event) { @@ -1575,22 +1609,23 @@ tBTM_STATUS btm_proc_smp_cback(tSMP_EVT event, const RawAddress& bd_addr, p_dev_rec = btm_find_dev(bd_addr); if (p_dev_rec == NULL) { log::error("p_dev_rec is NULL"); - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } log::verbose("before update sec_level=0x{:x} sec_flags=0x{:x}", p_data->cmplt.sec_level, p_dev_rec->sec_rec.sec_flags); - res = (p_data->cmplt.reason == SMP_SUCCESS) ? BTM_SUCCESS : BTM_ERR_PROCESSING; + res = (p_data->cmplt.reason == SMP_SUCCESS) ? tBTM_STATUS::BTM_SUCCESS + : BTM_ERR_PROCESSING; log::verbose("after update result={} sec_level=0x{:x} sec_flags=0x{:x}", res, p_data->cmplt.sec_level, p_dev_rec->sec_rec.sec_flags); if (p_data->cmplt.is_pair_cancel && btm_sec_cb.api.p_bond_cancel_cmpl_callback) { log::verbose("Pairing Cancel completed"); - (*btm_sec_cb.api.p_bond_cancel_cmpl_callback)(BTM_SUCCESS); + (*btm_sec_cb.api.p_bond_cancel_cmpl_callback)(tBTM_STATUS::BTM_SUCCESS); } - if (res != BTM_SUCCESS && p_data->cmplt.reason != SMP_CONN_TOUT) { + if (res != tBTM_STATUS::BTM_SUCCESS && p_data->cmplt.reason != SMP_CONN_TOUT) { log::verbose("Pairing failed - prepare to remove ACL"); l2cu_start_post_bond_timer(p_dev_rec->ble_hci_handle); } @@ -1608,7 +1643,7 @@ tBTM_STATUS btm_proc_smp_cback(tSMP_EVT event, const RawAddress& bd_addr, btm_sec_cb.pairing_flags = 0; } - if (res == BTM_SUCCESS) { + if (res == tBTM_STATUS::BTM_SUCCESS) { p_dev_rec->sec_rec.le_link = tSECURITY_STATE::IDLE; if (p_dev_rec->sec_rec.bond_type != BOND_TYPE_TEMPORARY) { @@ -1648,7 +1683,7 @@ tBTM_STATUS btm_proc_smp_cback(tSMP_EVT event, const RawAddress& bd_addr, case SMP_SIRK_VERIFICATION_REQ_EVT: res = (*btm_sec_cb.api.p_sirk_verification_callback)(bd_addr); log::debug("SMP SIRK verification result:{}", btm_status_text(res)); - if (res != BTM_CMD_STARTED) { + if (res != tBTM_STATUS::BTM_CMD_STARTED) { return res; } @@ -1662,7 +1697,7 @@ tBTM_STATUS btm_proc_smp_cback(tSMP_EVT event, const RawAddress& bd_addr, log::warn("Unexpected event '{}' for unknown device.", smp_evt_to_text(event)); } - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } /******************************************************************************* @@ -1763,14 +1798,14 @@ bool BTM_BleVerifySignature(const RawAddress& bd_addr, uint8_t* p_orig, uint16_t * Description This procedure confirms requested to validate set device. * * Parameter bd_addr - BD address of the peer - * res - confirmation result BTM_SUCCESS if success + * res - confirmation result tBTM_STATUS::BTM_SUCCESS if success * * Returns void * ******************************************************************************/ -void BTM_BleSirkConfirmDeviceReply(const RawAddress& bd_addr, uint8_t res) { +void BTM_BleSirkConfirmDeviceReply(const RawAddress& bd_addr, tBTM_STATUS res) { tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev(bd_addr); - tSMP_STATUS res_smp = (res == BTM_SUCCESS) ? SMP_SUCCESS : SMP_FAIL; + tSMP_STATUS res_smp = (res == tBTM_STATUS::BTM_SUCCESS) ? SMP_SUCCESS : SMP_FAIL; log::info("bd_addr:{}, result:{}", bd_addr, smp_status_text(res_smp)); diff --git a/system/stack/btm/btm_client_interface.cc b/system/stack/btm/btm_client_interface.cc index 37969c6d72..2b8736ec1c 100644 --- a/system/stack/btm/btm_client_interface.cc +++ b/system/stack/btm/btm_client_interface.cc @@ -96,6 +96,7 @@ struct btm_client_interface_t btm_client_interface = { .BTM_CreateSco = ::BTM_CreateSco, .BTM_RegForEScoEvts = ::BTM_RegForEScoEvts, .BTM_RemoveSco = ::BTM_RemoveSco, + .BTM_RemoveScoByBdaddr = ::BTM_RemoveScoByBdaddr, .BTM_WriteVoiceSettings = ::BTM_WriteVoiceSettings, .BTM_EScoConnRsp = ::BTM_EScoConnRsp, .BTM_GetNumScoLinks = ::BTM_GetNumScoLinks, diff --git a/system/stack/btm/btm_dev.cc b/system/stack/btm/btm_dev.cc index 0926623272..e8cb624aff 100644 --- a/system/stack/btm/btm_dev.cc +++ b/system/stack/btm/btm_dev.cc @@ -31,6 +31,7 @@ #include <string> +#include "btif/include/btif_storage.h" #include "btm_api.h" #include "btm_int_types.h" #include "btm_sec_api.h" @@ -83,6 +84,7 @@ static void wipe_secrets_and_remove(tBTM_SEC_DEV_REC* p_dev_rec) { void BTM_SecAddDevice(const RawAddress& bd_addr, DEV_CLASS dev_class, LinkKey link_key, uint8_t key_type, uint8_t pin_length) { tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev(bd_addr); + if (!p_dev_rec) { p_dev_rec = btm_sec_allocate_dev_rec(); log::info( @@ -97,6 +99,12 @@ void BTM_SecAddDevice(const RawAddress& bd_addr, DEV_CLASS dev_class, LinkKey li /* use default value for background connection params */ /* update conn params, use default value for background connection params */ memset(&p_dev_rec->conn_params, 0xff, sizeof(tBTM_LE_CONN_PRAMS)); + + if (com::android::bluetooth::flags::name_discovery_for_le_pairing() && + btif_storage_get_stored_remote_name(bd_addr, + reinterpret_cast<char*>(&p_dev_rec->sec_bd_name))) { + p_dev_rec->sec_rec.sec_flags |= BTM_SEC_NAME_KNOWN; + } } else { log::info( "Caching existing record from config file device: {}, dev_class: " @@ -119,7 +127,9 @@ void BTM_SecAddDevice(const RawAddress& bd_addr, DEV_CLASS dev_class, LinkKey li p_dev_rec->dev_class = dev_class; } - memset(p_dev_rec->sec_bd_name, 0, sizeof(BD_NAME)); + if (!com::android::bluetooth::flags::name_discovery_for_le_pairing()) { + bd_name_clear(p_dev_rec->sec_bd_name); + } p_dev_rec->sec_rec.sec_flags |= BTM_SEC_LINK_KEY_KNOWN; p_dev_rec->sec_rec.link_key = link_key; diff --git a/system/stack/btm/btm_devctl.cc b/system/stack/btm/btm_devctl.cc index 034ed48e03..6c162c7435 100644 --- a/system/stack/btm/btm_devctl.cc +++ b/system/stack/btm/btm_devctl.cc @@ -45,6 +45,7 @@ #include "stack/include/btm_api.h" #include "stack/include/btm_ble_privacy.h" #include "stack/include/btm_inq.h" +#include "stack/include/btm_status.h" #include "stack/include/hcidefs.h" #include "stack/include/l2cap_controller_interface.h" #include "types/raw_address.h" @@ -302,11 +303,11 @@ static void decode_controller_support() { if (bluetooth::shim::GetController()->SupportsRssiWithInquiryResults()) { if (bluetooth::shim::GetController()->SupportsExtendedInquiryResponse()) { - if (BTM_SetInquiryMode(BTM_INQ_RESULT_EXTENDED) != BTM_SUCCESS) { + if (BTM_SetInquiryMode(BTM_INQ_RESULT_EXTENDED) != tBTM_STATUS::BTM_SUCCESS) { log::warn("Unable to set inquiry mode BTM_INQ_RESULT_EXTENDED"); } } else { - if (BTM_SetInquiryMode(BTM_INQ_RESULT_WITH_RSSI) != BTM_SUCCESS) { + if (BTM_SetInquiryMode(BTM_INQ_RESULT_WITH_RSSI) != tBTM_STATUS::BTM_SUCCESS) { log::warn("Unable to set inquiry mode BTM_INQ_RESULT_WITH_RSSI"); } } @@ -339,7 +340,7 @@ tBTM_STATUS BTM_SetLocalDeviceName(const char* p_name) { bd_name_from_char_pointer(btm_sec_cb.cfg.bd_name, p_name); bluetooth::shim::GetController()->WriteLocalName(p_name); - return BTM_CMD_STARTED; + return tBTM_STATUS::BTM_CMD_STARTED; } /******************************************************************************* @@ -349,7 +350,7 @@ tBTM_STATUS BTM_SetLocalDeviceName(const char* p_name) { * Description This function is called to read the local device name. * * Returns status of the operation - * If success, BTM_SUCCESS is returned and p_name points stored + * If success, tBTM_STATUS::BTM_SUCCESS is returned and p_name points stored * local device name * If BTM doesn't store local device name, BTM_NO_RESOURCES is * is returned and p_name is set to NULL @@ -357,7 +358,7 @@ tBTM_STATUS BTM_SetLocalDeviceName(const char* p_name) { ******************************************************************************/ tBTM_STATUS BTM_ReadLocalDeviceName(const char** p_name) { *p_name = (const char*)btm_sec_cb.cfg.bd_name; - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } /******************************************************************************* @@ -367,7 +368,7 @@ tBTM_STATUS BTM_ReadLocalDeviceName(const char** p_name) { * Description Get local device name from controller. Do not use cached * name (used to get chip-id prior to btm reset complete). * - * Returns BTM_CMD_STARTED if successful, otherwise an error + * Returns tBTM_STATUS::BTM_CMD_STARTED if successful, otherwise an error * ******************************************************************************/ tBTM_STATUS BTM_ReadLocalDeviceNameFromController(tBTM_CMPL_CB* p_rln_cmpl_cback) { @@ -383,7 +384,7 @@ tBTM_STATUS BTM_ReadLocalDeviceNameFromController(tBTM_CMPL_CB* p_rln_cmpl_cback alarm_set_on_mloop(btm_cb.devcb.read_local_name_timer, BTM_DEV_NAME_REPLY_TIMEOUT_MS, btm_read_local_name_timeout, NULL); - return BTM_CMD_STARTED; + return tBTM_STATUS::BTM_CMD_STARTED; } /******************************************************************************* @@ -427,7 +428,7 @@ void btm_read_local_name_complete(uint8_t* p, uint16_t /* evt_len */) { ******************************************************************************/ tBTM_STATUS BTM_SetDeviceClass(DEV_CLASS dev_class) { if (btm_cb.devcb.dev_class == dev_class) { - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } btm_cb.devcb.dev_class = dev_class; @@ -438,7 +439,7 @@ tBTM_STATUS BTM_SetDeviceClass(DEV_CLASS dev_class) { btsnd_hcic_write_dev_class(dev_class); - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } /******************************************************************************* @@ -509,7 +510,7 @@ void BTM_WriteVoiceSettings(uint16_t settings) { * resetting the controller. * * Returns - * BTM_SUCCESS Command sent. + * tBTM_STATUS::BTM_SUCCESS Command sent. * BTM_NO_RESOURCES If out of resources to send the command. * * @@ -526,12 +527,12 @@ tBTM_STATUS BTM_EnableTestMode(void) { sizeof(cond)); /* put device to connectable mode */ - if (BTM_SetConnectability(BTM_CONNECTABLE) != BTM_SUCCESS) { + if (BTM_SetConnectability(BTM_CONNECTABLE) != tBTM_STATUS::BTM_SUCCESS) { return BTM_NO_RESOURCES; } /* put device to discoverable mode */ - if (BTM_SetDiscoverability(BTM_GENERAL_DISCOVERABLE) != BTM_SUCCESS) { + if (BTM_SetDiscoverability(BTM_GENERAL_DISCOVERABLE) != tBTM_STATUS::BTM_SUCCESS) { return BTM_NO_RESOURCES; } @@ -540,7 +541,7 @@ tBTM_STATUS BTM_EnableTestMode(void) { /* Send the HCI command */ btsnd_hcic_enable_test_mode(); - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } /******************************************************************************* @@ -564,7 +565,7 @@ tBTM_STATUS BTM_DeleteStoredLinkKey(const RawAddress* bd_addr, tBTM_CMPL_CB* p_c #if !defined(TARGET_FLOSS) /* Check if the previous command is completed */ if (btm_sec_cb.devcb.p_stored_link_key_cmpl_cb) { - return BTM_BUSY; + return tBTM_STATUS::BTM_BUSY; } bool delete_all_flag = !bd_addr; @@ -582,7 +583,7 @@ tBTM_STATUS BTM_DeleteStoredLinkKey(const RawAddress* bd_addr, tBTM_CMPL_CB* p_c } #endif - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } /******************************************************************************* diff --git a/system/stack/btm/btm_inq.cc b/system/stack/btm/btm_inq.cc index dc2556df83..5d6369a5cd 100644 --- a/system/stack/btm/btm_inq.cc +++ b/system/stack/btm/btm_inq.cc @@ -36,13 +36,11 @@ #include <mutex> #include "btif/include/btif_acl.h" -#include "btif/include/btif_config.h" #include "common/time_util.h" #include "hci/controller_interface.h" #include "hci/event_checkers.h" #include "hci/hci_interface.h" #include "internal_include/bt_target.h" -#include "main/shim/acl_api.h" #include "main/shim/entry.h" #include "main/shim/helpers.h" #include "main/shim/shim.h" @@ -52,18 +50,17 @@ #include "packet/bit_inserter.h" #include "stack/btm/btm_eir.h" #include "stack/btm/btm_int_types.h" -#include "stack/btm/btm_sec.h" #include "stack/btm/neighbor_inquiry.h" +#include "stack/btm/security_device_record.h" #include "stack/include/acl_api_types.h" #include "stack/include/advertise_data_parser.h" #include "stack/include/bt_hdr.h" #include "stack/include/bt_lap.h" -#include "stack/include/bt_name.h" #include "stack/include/bt_types.h" #include "stack/include/bt_uuid16.h" -#include "stack/include/btm_ble_api.h" #include "stack/include/btm_client_interface.h" #include "stack/include/btm_log_history.h" +#include "stack/include/btm_status.h" #include "stack/include/hci_error_code.h" #include "stack/include/hcidefs.h" #include "stack/include/hcimsgs.h" @@ -119,9 +116,6 @@ uint16_t max_bd_entries_; /* Maximum number of entries that can be stored */ extern tBTM_CB btm_cb; void btm_inq_db_set_inq_by_rssi(void); -void btm_inq_remote_name_timer_timeout(void* data); -tBTM_STATUS btm_ble_read_remote_name(const RawAddress& remote_bda, tBTM_NAME_CMPL_CB* p_cb); -bool btm_ble_cancel_remote_name(const RawAddress& remote_bda); tBTM_STATUS btm_ble_set_discoverability(uint16_t combined_mode); tBTM_STATUS btm_ble_set_connectability(uint16_t combined_mode); @@ -245,9 +239,6 @@ const uint16_t BTM_EIR_UUID_LKUP_TBL[BTM_EIR_MAX_SERVICES] = { static void btm_clr_inq_db(const RawAddress* p_bda); static void btm_init_inq_result_flt(void); void btm_clr_inq_result_flt(void); -static void btm_inq_rmt_name_failed_cancelled(void); -static tBTM_STATUS btm_initiate_rem_name(const RawAddress& remote_bda, uint64_t timeout_ms, - tBTM_NAME_CMPL_CB* p_cb); static uint8_t btm_convert_uuid_to_eir_service(uint16_t uuid16); void btm_set_eir_uuid(const uint8_t* p_eir, tBTM_INQ_RESULTS* p_results); @@ -266,8 +257,8 @@ static bool is_inquery_by_rssi() { return osi_property_get_bool(PROPERTY_INQ_BY_ * scans are enabled. If a value of '0' is entered for window * or interval, the default values are used. * - * Returns BTM_SUCCESS if successful - * BTM_BUSY if a setting of the filter is already in progress + * Returns tBTM_STATUS::BTM_SUCCESS if successful + * tBTM_STATUS::BTM_BUSY if a setting of the filter is already in progress * BTM_NO_RESOURCES if couldn't get a memory pool buffer * BTM_ILLEGAL_VALUE if a bad parameter was detected * BTM_WRONG_MODE if the device is not up. @@ -284,7 +275,7 @@ tBTM_STATUS BTM_SetDiscoverability(uint16_t inq_mode) { log::verbose(""); if (bluetooth::shim::GetController()->SupportsBle()) { - if (btm_ble_set_discoverability((uint16_t)(inq_mode)) == BTM_SUCCESS) { + if (btm_ble_set_discoverability((uint16_t)(inq_mode)) == tBTM_STATUS::BTM_SUCCESS) { btm_cb.btm_inq_vars.discoverable_mode &= (~BTM_BLE_DISCOVERABLE_MASK); btm_cb.btm_inq_vars.discoverable_mode |= (inq_mode & BTM_BLE_DISCOVERABLE_MASK); } @@ -352,10 +343,10 @@ tBTM_STATUS BTM_SetDiscoverability(uint16_t inq_mode) { } FIELDS_TO_COD(cod, minor, major, service_class); - (void)BTM_SetDeviceClass(cod); + (void)get_btm_client_interface().local.BTM_SetDeviceClass(cod); } - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } void BTM_EnableInterlacedInquiryScan() { @@ -410,7 +401,7 @@ void BTM_EnableInterlacedPageScan() { * * Output Params: mode - standard, with RSSI, extended * - * Returns BTM_SUCCESS if successful + * Returns tBTM_STATUS::BTM_SUCCESS if successful * BTM_NO_RESOURCES if couldn't get a memory pool buffer * BTM_ILLEGAL_VALUE if a bad parameter was detected * BTM_WRONG_MODE if the device is not up. @@ -438,7 +429,7 @@ tBTM_STATUS BTM_SetInquiryMode(uint8_t mode) { btsnd_hcic_write_inquiry_mode(mode); - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } /******************************************************************************* @@ -449,7 +440,7 @@ tBTM_STATUS BTM_SetInquiryMode(uint8_t mode) { * connectable mode. Discoverable mode means page scans are * enabled. * - * Returns BTM_SUCCESS if successful + * Returns tBTM_STATUS::BTM_SUCCESS if successful * BTM_ILLEGAL_VALUE if a bad parameter is detected * BTM_NO_RESOURCES if could not allocate a message buffer * BTM_WRONG_MODE if the device is not up. @@ -459,7 +450,7 @@ tBTM_STATUS BTM_SetConnectability(uint16_t page_mode) { uint8_t scan_mode = 0; if (bluetooth::shim::GetController()->SupportsBle()) { - if (btm_ble_set_connectability(page_mode) != BTM_SUCCESS) { + if (btm_ble_set_connectability(page_mode) != tBTM_STATUS::BTM_SUCCESS) { return BTM_NO_RESOURCES; } btm_cb.btm_inq_vars.connectable_mode &= (~BTM_BLE_CONNECTABLE_MASK); @@ -501,7 +492,7 @@ tBTM_STATUS BTM_SetConnectability(uint16_t page_mode) { btsnd_hcic_write_scan_enable(scan_mode); btm_cb.btm_inq_vars.connectable_mode &= (~BTM_CONNECTABLE_MASK); btm_cb.btm_inq_vars.connectable_mode |= page_mode; - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } /******************************************************************************* @@ -529,17 +520,16 @@ uint16_t BTM_IsInquiryActive(void) { * ******************************************************************************/ static void BTM_CancelLeScan() { - if (!bluetooth::shim::is_classic_discovery_only_enabled()) { - log::assert_that(get_btm_client_interface().local.BTM_IsDeviceUp(), - "assert failed: BTM_IsDeviceUp()"); - if ((btm_cb.btm_inq_vars.inqparms.mode & BTM_BLE_GENERAL_INQUIRY) != 0) { - btm_ble_stop_inquiry(); - } - } else { - log::info( - "Unable to cancel le scan as `is_classic_discovery_only_enabled` is " - "true"); +#if TARGET_FLOSS + log::info("Skipping because FLOSS doesn't use this API for LE scans"); + return; +#else + log::assert_that(get_btm_client_interface().local.BTM_IsDeviceUp(), + "assert failed: BTM_IsDeviceUp()"); + if ((btm_cb.btm_inq_vars.inqparms.mode & BTM_BLE_GENERAL_INQUIRY) != 0) { + btm_ble_stop_inquiry(); } +#endif } /******************************************************************************* @@ -601,6 +591,7 @@ void BTM_CancelInquiry(void) { } } +#if TARGET_FLOSS static void btm_classic_inquiry_timeout(void* /* data */) { // When the Inquiry Complete event is received, the classic inquiry // will be marked as completed. Therefore, we only need to mark @@ -608,6 +599,7 @@ static void btm_classic_inquiry_timeout(void* /* data */) { // as inquiry results. btm_process_inq_complete(HCI_SUCCESS, BTM_BLE_GENERAL_INQUIRY); } +#endif /******************************************************************************* * @@ -618,23 +610,22 @@ static void btm_classic_inquiry_timeout(void* /* data */) { * * Returns tBTM_STATUS * BTM_CMD_STARTED if le scan successfully initiated - * BTM_WRONG_MODE if controller does not support ble or the - * is_classic_discovery_only_enabled flag is set + * BTM_WRONG_MODE if controller does not support ble * ******************************************************************************/ static tBTM_STATUS BTM_StartLeScan() { - if (!bluetooth::shim::is_classic_discovery_only_enabled()) { - if (shim::GetController()->SupportsBle()) { - btm_ble_start_inquiry(btm_cb.btm_inq_vars.inqparms.duration); - return BTM_CMD_STARTED; - } else { - log::warn("Trying to do LE scan on a non-LE adapter"); - btm_cb.btm_inq_vars.inqparms.mode &= ~BTM_BLE_GENERAL_INQUIRY; - } - } else { - log::info("init_flag: Skip le scan as classic inquiry only flag is set enabled"); +#if TARGET_FLOSS + log::info("Skipping because FLOSS doesn't use this API for LE scans"); + return BTM_WRONG_MODE; +#else + if (shim::GetController()->SupportsBle()) { + btm_ble_start_inquiry(btm_cb.btm_inq_vars.inqparms.duration); + return tBTM_STATUS::BTM_CMD_STARTED; } + log::warn("Trying to do LE scan on a non-LE adapter"); + btm_cb.btm_inq_vars.inqparms.mode &= ~BTM_BLE_GENERAL_INQUIRY; return BTM_WRONG_MODE; +#endif } /******************************************************************************* @@ -647,7 +638,7 @@ static tBTM_STATUS BTM_StartLeScan() { * * Parameters: p_inqparms - pointer to the inquiry information * mode - GENERAL or LIMITED inquiry, BR/LE bit mask - * seperately + * separately * duration - length in 1.28 sec intervals (If '0', the * inquiry is CANCELLED) * filter_cond_type - BTM_CLR_INQUIRY_FILTER, @@ -666,8 +657,8 @@ static tBTM_STATUS BTM_StartLeScan() { * NULL, the application is not notified when * completed. * Returns tBTM_STATUS - * BTM_CMD_STARTED if successfully initiated - * BTM_BUSY if already in progress + * tBTM_STATUS::BTM_CMD_STARTED if successfully initiated + * tBTM_STATUS::BTM_BUSY if already in progress * BTM_ILLEGAL_VALUE if parameter(s) are out of range * BTM_NO_RESOURCES if could not allocate resources to start * the command @@ -686,7 +677,7 @@ tBTM_STATUS BTM_StartInquiry(tBTM_INQ_RESULTS_CB* p_results_cb, tBTM_CMPL_CB* p_ btm_cb.neighbor.inquiry_history_->Push({ .status = tBTM_INQUIRY_CMPL::NOT_STARTED, }); - return BTM_BUSY; + return tBTM_STATUS::BTM_BUSY; } if (btm_cb.btm_inq_vars.registered_for_hci_events == false) { @@ -769,99 +760,18 @@ tBTM_STATUS BTM_StartInquiry(tBTM_INQ_RESULTS_CB* p_results_cb, tBTM_CMPL_CB* p_ } })); +#if TARGET_FLOSS // If we are only doing classic discovery, we should also set a timeout for // the inquiry if a duration is set. - if (bluetooth::shim::is_classic_discovery_only_enabled() && - btm_cb.btm_inq_vars.inqparms.duration != 0) { + if (btm_cb.btm_inq_vars.inqparms.duration != 0) { /* start inquiry timer */ uint64_t duration_ms = btm_cb.btm_inq_vars.inqparms.duration * 1280; alarm_set_on_mloop(btm_cb.btm_inq_vars.classic_inquiry_timer, duration_ms, btm_classic_inquiry_timeout, NULL); } +#endif - return BTM_CMD_STARTED; -} - -/******************************************************************************* - * - * Function BTM_ReadRemoteDeviceName - * - * Description This function initiates a remote device HCI command to the - * controller and calls the callback when the process has - * completed. - * - * Input Params: remote_bda - device address of name to retrieve - * p_cb - callback function called when - * BTM_CMD_STARTED is returned. - * A pointer to tBTM_REMOTE_DEV_NAME is - * passed to the callback. - * - * Returns - * BTM_CMD_STARTED is returned if the request was successfully - * sent to HCI. - * BTM_BUSY if already in progress - * BTM_UNKNOWN_ADDR if device address is bad - * BTM_NO_RESOURCES if could not allocate resources to start - * the command - * BTM_WRONG_MODE if the device is not up. - * - ******************************************************************************/ -#define BTM_EXT_RMT_NAME_TIMEOUT_MS (40 * 1000) /* 40 seconds */ -tBTM_STATUS BTM_ReadRemoteDeviceName(const RawAddress& remote_bda, tBTM_NAME_CMPL_CB* p_cb, - tBT_TRANSPORT transport) { - log::verbose("bd addr {}", remote_bda); - /* Use LE transport when LE is the only available option */ - if (transport == BT_TRANSPORT_LE) { - return btm_ble_read_remote_name(remote_bda, p_cb); - } - /* Use classic transport for BR/EDR and Dual Mode devices */ - return btm_initiate_rem_name(remote_bda, BTM_EXT_RMT_NAME_TIMEOUT_MS, p_cb); -} - -/******************************************************************************* - * - * Function BTM_CancelRemoteDeviceName - * - * Description This function initiates the cancel request for the specified - * remote device. - * - * Input Params: None - * - * Returns - * BTM_CMD_STARTED is returned if the request was successfully - * sent to HCI. - * BTM_NO_RESOURCES if could not allocate resources to start - * the command - * BTM_WRONG_MODE if there is not an active remote name - * request. - * - ******************************************************************************/ -tBTM_STATUS BTM_CancelRemoteDeviceName(void) { - log::verbose(""); - bool is_le; - - /* Make sure there is not already one in progress */ - if (!btm_cb.rnr.remname_active) { - return BTM_WRONG_MODE; - } - - if (com::android::bluetooth::flags::rnr_store_device_type()) { - is_le = (btm_cb.rnr.remname_dev_type == BT_DEVICE_TYPE_BLE); - } else { - is_le = BTM_UseLeLink(btm_cb.rnr.remname_bda); - } - - if (is_le) { - /* Cancel remote name request for LE device, and process remote name - * callback. */ - btm_inq_rmt_name_failed_cancelled(); - } else { - bluetooth::shim::ACL_CancelRemoteNameRequest(btm_cb.rnr.remname_bda); - if (com::android::bluetooth::flags::rnr_reset_state_at_cancel()) { - btm_process_remote_name(&btm_cb.rnr.remname_bda, nullptr, 0, HCI_ERR_UNSPECIFIED); - } - } - return BTM_CMD_STARTED; + return tBTM_STATUS::BTM_CMD_STARTED; } /******************************************************************************* @@ -952,19 +862,19 @@ tBTM_INQ_INFO* BTM_InqDbNext(tBTM_INQ_INFO* p_cur) { * Parameter p_bda - (input) BD_ADDR -> Address of device to clear * (NULL clears all entries) * - * Returns BTM_BUSY if an inquiry, get remote name, or event filter - * is active, otherwise BTM_SUCCESS + * Returns tBTM_STATUS::BTM_BUSY if an inquiry, get remote name, or event filter + * is active, otherwise tBTM_STATUS::BTM_SUCCESS * ******************************************************************************/ tBTM_STATUS BTM_ClearInqDb(const RawAddress* p_bda) { /* If an inquiry or remote name is in progress return busy */ if (btm_cb.btm_inq_vars.inq_active != BTM_INQUIRY_INACTIVE) { - return BTM_BUSY; + return tBTM_STATUS::BTM_BUSY; } btm_clr_inq_db(p_bda); - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } /******************************************************************************* @@ -1041,7 +951,7 @@ void btm_inq_db_reset(void) { btm_cb.rnr.remname_dev_type = BT_DEVICE_TYPE_UNKNOWN; if (btm_cb.rnr.p_remname_cmpl_cb) { - rem_name.status = BTM_DEV_RESET; + rem_name.btm_status = BTM_DEV_RESET; rem_name.hci_status = HCI_SUCCESS; (*btm_cb.rnr.p_remname_cmpl_cb)(&rem_name); @@ -1819,187 +1729,6 @@ static void btm_process_cancel_complete(tHCI_STATUS status, uint8_t mode) { BTIF_dm_report_inquiry_status_change(tBTM_INQUIRY_STATE::BTM_INQUIRY_CANCELLED); btm_process_inq_complete(status, mode); } -/******************************************************************************* - * - * Function btm_initiate_rem_name - * - * Description This function looks initiates a remote name request. It is - * called either by GAP or by the API call - * BTM_ReadRemoteDeviceName. - * - * Input Params: remote_bda: Remote address to execute RNR - * timeout_ms: Internal timeout to await response - * * p_cb: Callback function called when - * BTM_CMD_STARTED is returned. - * A pointer to tBTM_REMOTE_DEV_NAME is - * passed to the callback. - * - * Returns - * BTM_CMD_STARTED is returned if the request was sent to HCI. - * and the callback will be called. - * BTM_BUSY if already in progress - * BTM_NO_RESOURCES if could not allocate resources to start - * the command - * BTM_WRONG_MODE if the device is not up. - * - ******************************************************************************/ -static uint16_t get_clock_offset_from_storage(const RawAddress& remote_bda) { - int clock_offset_in_cfg = 0; - return btif_get_device_clockoffset(remote_bda, &clock_offset_in_cfg) - ? static_cast<uint16_t>(clock_offset_in_cfg) - : 0; -} - -tBTM_STATUS btm_initiate_rem_name(const RawAddress& remote_bda, uint64_t timeout_ms, - tBTM_NAME_CMPL_CB* p_cb) { - /*** Make sure the device is ready ***/ - if (!get_btm_client_interface().local.BTM_IsDeviceUp()) { - return BTM_WRONG_MODE; - } - if (btm_cb.rnr.remname_active) { - return BTM_BUSY; - } - - uint16_t clock_offset = get_clock_offset_from_storage(remote_bda); - uint8_t page_scan_rep_mode = HCI_PAGE_SCAN_REP_MODE_R1; - uint8_t page_scan_mode = HCI_MANDATARY_PAGE_SCAN_MODE; - - /* If the database entry exists for the device, use its clock offset */ - tINQ_DB_ENT* p_i = btm_inq_db_find(remote_bda); - if (p_i && (p_i->inq_info.results.inq_result_type & BT_DEVICE_TYPE_BREDR)) { - tBTM_INQ_INFO* p_cur = &p_i->inq_info; - clock_offset = p_cur->results.clock_offset | BTM_CLOCK_OFFSET_VALID; - if (0 == (p_cur->results.clock_offset & BTM_CLOCK_OFFSET_VALID)) { - clock_offset = get_clock_offset_from_storage(remote_bda); - } - page_scan_rep_mode = p_cur->results.page_scan_rep_mode; - if (com::android::bluetooth::flags::rnr_validate_page_scan_repetition_mode() && - page_scan_rep_mode >= HCI_PAGE_SCAN_REP_MODE_RESERVED_START) { - log::info( - "Invalid page scan repetition mode {} from remote_bda:{}, " - "fallback to R1", - page_scan_rep_mode, remote_bda); - page_scan_rep_mode = HCI_PAGE_SCAN_REP_MODE_R1; - } - page_scan_mode = p_cur->results.page_scan_mode; - } - - bluetooth::shim::ACL_RemoteNameRequest(remote_bda, page_scan_rep_mode, page_scan_mode, - clock_offset); - - btm_cb.rnr.p_remname_cmpl_cb = p_cb; - btm_cb.rnr.remname_bda = remote_bda; - btm_cb.rnr.remname_dev_type = BT_DEVICE_TYPE_BREDR; - btm_cb.rnr.remname_active = true; - - alarm_set_on_mloop(btm_cb.rnr.remote_name_timer, timeout_ms, btm_inq_remote_name_timer_timeout, - NULL); - - return BTM_CMD_STARTED; -} - -/******************************************************************************* - * - * Function btm_process_remote_name - * - * Description This function is called when a remote name is received from - * the device. If remote names are cached, it updates the - * inquiry database. - * - * Returns void - * - ******************************************************************************/ -void btm_process_remote_name(const RawAddress* bda, const BD_NAME bdn, uint16_t /* evt_len */, - tHCI_STATUS hci_status) { - tBTM_REMOTE_DEV_NAME rem_name = { - .status = BTM_BAD_VALUE_RET, - .bd_addr = bda ? *bda : RawAddress::kEmpty, - .remote_bd_name = {}, - .hci_status = hci_status, - }; - - bool on_le_link; - if (com::android::bluetooth::flags::rnr_store_device_type()) { - on_le_link = (btm_cb.rnr.remname_dev_type == BT_DEVICE_TYPE_BLE); - } else { - on_le_link = BTM_UseLeLink(btm_cb.rnr.remname_bda); - } - - /* If the inquire BDA and remote DBA are the same, then stop the timer and set - * the active to false */ - if (btm_cb.rnr.remname_active) { - if (rem_name.bd_addr == RawAddress::kEmpty || rem_name.bd_addr == btm_cb.rnr.remname_bda) { - log::info("RNR received expected name bd_addr:{} hci_status:{} le_link:{}", - rem_name.bd_addr.ToRedactedStringForLogging(), hci_status_code_text(hci_status), - on_le_link); - - if (on_le_link && hci_status == HCI_ERR_UNSPECIFIED) { - btm_ble_cancel_remote_name(btm_cb.rnr.remname_bda); - } - alarm_cancel(btm_cb.rnr.remote_name_timer); - /* Clean up and return the status if the command was not successful */ - /* Note: If part of the inquiry, the name is not stored, and the */ - /* inquiry complete callback is called. */ - - if (hci_status == HCI_SUCCESS) { - /* Copy the name from the data stream into the return structure */ - /* Note that even if it is not being returned, it is used as a */ - /* temporary buffer. */ - rem_name.status = BTM_SUCCESS; - if (bdn) { - bd_name_copy(rem_name.remote_bd_name, bdn); - } else { - log::warn("Received null name from remote device bd_addr:{}", - rem_name.bd_addr.ToRedactedStringForLogging()); - } - } - /* Reset the remote BDA and call callback if possible */ - btm_cb.rnr.remname_active = false; - btm_cb.rnr.remname_bda = RawAddress::kEmpty; - btm_cb.rnr.remname_dev_type = BT_DEVICE_TYPE_UNKNOWN; - - tBTM_NAME_CMPL_CB* p_cb = btm_cb.rnr.p_remname_cmpl_cb; - btm_cb.rnr.p_remname_cmpl_cb = nullptr; - if (p_cb) { - (p_cb)(&rem_name); - } - } else { - log::warn("RNR received UNKNOWN name bd_addr:{} hci_status:{} le_link:{}", - rem_name.bd_addr.ToRedactedStringForLogging(), hci_status_code_text(hci_status), - on_le_link); - } - } else { - log::info( - "RNR received UNEXPECTED name bd_addr:{} inq_addr:{} hci_status:{} " - "le_link:{} rnr_active:{}", - rem_name.bd_addr.ToRedactedStringForLogging(), - btm_cb.rnr.remname_bda.ToRedactedStringForLogging(), hci_status_code_text(hci_status), - on_le_link, btm_cb.rnr.remname_active); - } -} - -void btm_inq_remote_name_timer_timeout(void* /* data */) { btm_inq_rmt_name_failed_cancelled(); } - -/******************************************************************************* - * - * Function btm_inq_rmt_name_failed_cancelled - * - * Description This function is if timeout expires or request is cancelled - * while getting remote name. This is done for devices that - * incorrectly do not report operation failure - * - * Returns void - * - ******************************************************************************/ -void btm_inq_rmt_name_failed_cancelled(void) { - log::error("remname_active={}", btm_cb.rnr.remname_active); - - if (btm_cb.rnr.remname_active) { - btm_process_remote_name(&btm_cb.rnr.remname_bda, NULL, 0, HCI_ERR_UNSPECIFIED); - } - - btm_sec_rmt_name_request_complete(NULL, NULL, HCI_ERR_UNSPECIFIED); -} /******************************************************************************* * @@ -2010,7 +1739,7 @@ void btm_inq_rmt_name_failed_cancelled(void) { * Parameters p_buff - allocated HCI command buffer including extended * inquriry response * - * Returns BTM_SUCCESS - if successful + * Returns tBTM_STATUS::BTM_SUCCESS - if successful * BTM_MODE_UNSUPPORTED - if local device cannot support it * ******************************************************************************/ @@ -2018,7 +1747,7 @@ tBTM_STATUS BTM_WriteEIR(BT_HDR* p_buff) { if (bluetooth::shim::GetController()->SupportsExtendedInquiryResponse()) { log::verbose("Write Extended Inquiry Response to controller"); btsnd_hcic_write_ext_inquiry_response(p_buff, TRUE); - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } else { osi_free(p_buff); return BTM_MODE_UNSUPPORTED; diff --git a/system/stack/btm/btm_sco.cc b/system/stack/btm/btm_sco.cc index e871fb67a2..33aaa80738 100644 --- a/system/stack/btm/btm_sco.cc +++ b/system/stack/btm/btm_sco.cc @@ -56,6 +56,7 @@ #include "stack/include/btm_api_types.h" #include "stack/include/btm_client_interface.h" #include "stack/include/btm_log_history.h" +#include "stack/include/btm_status.h" #include "stack/include/hci_error_code.h" #include "stack/include/hcimsgs.h" #include "stack/include/main_thread.h" @@ -668,7 +669,7 @@ static tBTM_STATUS btm_send_connect_request(uint16_t acl_handle, enh_esco_params } } - return BTM_CMD_STARTED; + return tBTM_STATUS::BTM_CMD_STARTED; } /******************************************************************************* @@ -683,10 +684,10 @@ static tBTM_STATUS btm_send_connect_request(uint16_t acl_handle, enh_esco_params * parameter the default packet types is used. * * Returns BTM_UNKNOWN_ADDR if the ACL connection is not up - * BTM_BUSY if another SCO being set up to + * tBTM_STATUS::BTM_BUSY if another SCO being set up to * the same BD address * BTM_NO_RESOURCES if the max SCO limit has been reached - * BTM_CMD_STARTED if the connection establishment is started. + * tBTM_STATUS::BTM_CMD_STARTED if the connection establishment is started. * In this case, "*p_sco_inx" is filled in * with the sco index used for the connection. * @@ -726,7 +727,7 @@ tBTM_STATUS BTM_CreateSco(const RawAddress* remote_bda, bool is_orig, uint16_t p (p->esco.data.bd_addr == *remote_bda)) { log::error("a sco connection is already going on for {}, at state {}", *remote_bda, unsigned(p->state)); - return BTM_BUSY; + return tBTM_STATUS::BTM_BUSY; } } } else { @@ -734,7 +735,7 @@ tBTM_STATUS BTM_CreateSco(const RawAddress* remote_bda, bool is_orig, uint16_t p for (xx = 0; xx < BTM_MAX_SCO_LINKS; xx++, p++) { if ((p->state == SCO_ST_LISTENING) && (!p->rem_bd_known)) { log::error("remote_bda is null and not known and we are still listening"); - return BTM_BUSY; + return tBTM_STATUS::BTM_BUSY; } } } @@ -797,7 +798,7 @@ tBTM_STATUS BTM_CreateSco(const RawAddress* remote_bda, bool is_orig, uint16_t p if (is_orig) { log::debug("Initiating (e)SCO link for ACL handle:0x{:04x}", acl_handle); - if ((btm_send_connect_request(acl_handle, p_setup)) != BTM_CMD_STARTED) { + if ((btm_send_connect_request(acl_handle, p_setup)) != tBTM_STATUS::BTM_CMD_STARTED) { log::error("failed to send connect request for {}", *remote_bda); return BTM_NO_RESOURCES; } @@ -815,7 +816,7 @@ tBTM_STATUS BTM_CreateSco(const RawAddress* remote_bda, bool is_orig, uint16_t p BTM_LogHistory(kBtmLogTag, *remote_bda, "Connecting", base::StringPrintf("local initiated acl:0x%04x", acl_handle)); } - return BTM_CMD_STARTED; + return tBTM_STATUS::BTM_CMD_STARTED; } } @@ -845,7 +846,7 @@ void btm_sco_chk_pend_unpark(tHCI_STATUS hci_status, uint16_t hci_handle) { "{} unparked, sending connection request, acl_handle={}, " "hci_status={}", p->esco.data.bd_addr, unsigned(acl_handle), unsigned(hci_status)); - if (btm_send_connect_request(acl_handle, &p->esco.setup) == BTM_CMD_STARTED) { + if (btm_send_connect_request(acl_handle, &p->esco.setup) == tBTM_STATUS::BTM_CMD_STARTED) { p->state = SCO_ST_CONNECTING; } else { log::error("failed to send connection request for {}", p->esco.data.bd_addr); @@ -879,7 +880,7 @@ void btm_sco_chk_pend_rolechange(uint16_t hci_handle) { log::verbose("btm_sco_chk_pend_rolechange -> (e)SCO Link for ACL handle 0x{:04x}", acl_handle); - if ((btm_send_connect_request(acl_handle, &p->esco.setup)) == BTM_CMD_STARTED) { + if ((btm_send_connect_request(acl_handle, &p->esco.setup)) == tBTM_STATUS::BTM_CMD_STARTED) { p->state = SCO_ST_CONNECTING; } } @@ -912,7 +913,7 @@ void btm_sco_disc_chk_pend_for_modechange(uint16_t hci_handle) { { log::debug("Removing SCO Link handle 0x{:04x}", p->hci_handle); - if (get_btm_client_interface().sco.BTM_RemoveSco(xx) != BTM_SUCCESS) { + if (get_btm_client_interface().sco.BTM_RemoveSco(xx) != tBTM_STATUS::BTM_SUCCESS) { log::warn("Unable to remove SCO link:{}", xx); } } @@ -1156,13 +1157,13 @@ tBTM_STATUS BTM_RemoveSco(uint16_t sco_inx) { p->hci_handle = HCI_INVALID_HANDLE; p->state = SCO_ST_UNUSED; p->esco.p_esco_cback = NULL; /* Deregister the eSCO event callback */ - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } if (BTM_ReadPowerMode(p->esco.data.bd_addr, &state) && (state == BTM_PM_ST_PENDING)) { log::verbose("BTM_PM_ST_PENDING for ACL mapped with SCO Link 0x{:04x}", p->hci_handle); p->state = SCO_ST_PEND_MODECHANGE; - return BTM_CMD_STARTED; + return tBTM_STATUS::BTM_CMD_STARTED; } tSCO_STATE old_state = p->state; @@ -1174,16 +1175,16 @@ tBTM_STATUS BTM_RemoveSco(uint16_t sco_inx) { BTM_LogHistory(kBtmLogTag, p->esco.data.bd_addr, "Disconnecting", base::StringPrintf("local initiated handle:0x%04x previous_state:%s", p->Handle(), sco_state_text(old_state).c_str())); - return BTM_CMD_STARTED; + return tBTM_STATUS::BTM_CMD_STARTED; } -void BTM_RemoveSco(const RawAddress& bda) { +void BTM_RemoveScoByBdaddr(const RawAddress& bda) { tSCO_CONN* p = &btm_cb.sco_cb.sco_db[0]; uint16_t xx; for (xx = 0; xx < BTM_MAX_SCO_LINKS; xx++, p++) { if (p->rem_bd_known && p->esco.data.bd_addr == bda) { - if (get_btm_client_interface().sco.BTM_RemoveSco(xx) != BTM_SUCCESS) { + if (get_btm_client_interface().sco.BTM_RemoveSco(xx) != tBTM_STATUS::BTM_SUCCESS) { log::warn("Unable to remove SCO link:{}", xx); } } @@ -1358,8 +1359,8 @@ const RawAddress* BTM_ReadScoBdAddr(uint16_t sco_inx) { * desired the feature should be disabled in the * controller's feature mask. * - * Returns BTM_SUCCESS if the successful. - * BTM_BUSY if there are one or more active (e)SCO links. + * Returns tBTM_STATUS::BTM_SUCCESS if the successful. + * tBTM_STATUS::BTM_BUSY if there are one or more active (e)SCO links. * ******************************************************************************/ tBTM_STATUS BTM_SetEScoMode(enh_esco_params_t* p_parms) { @@ -1383,7 +1384,7 @@ tBTM_STATUS BTM_SetEScoMode(enh_esco_params_t* p_parms) { p_def->transmit_bandwidth, p_def->receive_bandwidth, p_def->max_latency_ms, p_def->packet_types, p_def->retransmission_effort); } - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } /******************************************************************************* @@ -1395,7 +1396,7 @@ tBTM_STATUS BTM_SetEScoMode(enh_esco_params_t* p_parms) { * connection indication events and change of link parameter * events. * - * Returns BTM_SUCCESS if the successful. + * Returns tBTM_STATUS::BTM_SUCCESS if the successful. * BTM_ILLEGAL_VALUE if there is an illegal sco_inx * BTM_MODE_UNSUPPORTED if controller version is not BT1.2 or * later or does not support eSCO. @@ -1413,7 +1414,7 @@ tBTM_STATUS BTM_RegForEScoEvts(uint16_t sco_inx, tBTM_ESCO_CBACK* p_esco_cback) if (sco_inx < BTM_MAX_SCO_LINKS && btm_cb.sco_cb.sco_db[sco_inx].state != SCO_ST_UNUSED) { btm_cb.sco_cb.sco_db[sco_inx].esco.p_esco_cback = p_esco_cback; - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } return BTM_ILLEGAL_VALUE; } @@ -1432,7 +1433,7 @@ tBTM_STATUS BTM_RegForEScoEvts(uint16_t sco_inx, tBTM_ESCO_CBACK* p_esco_cback) * Note: If called over a SCO link (including 1.1 controller), * a change packet type request is sent out instead. * - * Returns BTM_CMD_STARTED if command is successfully initiated. + * Returns tBTM_STATUS::BTM_CMD_STARTED if command is successfully initiated. * BTM_NO_RESOURCES - not enough resources to initiate command. * BTM_WRONG_MODE if no connection with a peer device or bad * sco_inx. @@ -1500,7 +1501,7 @@ static tBTM_STATUS BTM_ChangeEScoLinkParms(uint16_t sco_inx, tBTM_CHG_ESCO_PARAM p_parms->retransmission_effort, temp_packet_types); } - return BTM_CMD_STARTED; + return tBTM_STATUS::BTM_CMD_STARTED; } /******************************************************************************* diff --git a/system/stack/btm/btm_sco_hfp_hal_linux.cc b/system/stack/btm/btm_sco_hfp_hal_linux.cc index 75fd5e13ce..ba1fcfdb59 100644 --- a/system/stack/btm/btm_sco_hfp_hal_linux.cc +++ b/system/stack/btm/btm_sco_hfp_hal_linux.cc @@ -21,16 +21,15 @@ #include <vector> -#include "btm_sco_hfp_hal.h" #include "common/init_flags.h" #include "hci/controller_interface.h" #include "main/shim/entry.h" #include "os/log.h" #include "osi/include/properties.h" +#include "stack/btm/btm_sco_hfp_hal.h" #include "stack/include/hcimsgs.h" #include "stack/include/sdpdefs.h" -using namespace bluetooth; using bluetooth::legacy::hci::GetInterface; namespace hfp_hal_interface { @@ -116,15 +115,16 @@ void cache_codec_capabilities(struct mgmt_rp_get_codec_capabilities* rp) { } for (const auto& c : cached_codecs) { - log::info("Caching HFP codec {}, data path {}, data len {}, pkt_size {}", - (uint64_t)c.inner.codec, c.inner.data_path, c.inner.data.size(), c.pkt_size); + bluetooth::log::info("Caching HFP codec {}, data path {}, data len {}, pkt_size {}", + (uint64_t)c.inner.codec, c.inner.data_path, c.inner.data.size(), + c.pkt_size); } } struct sockaddr_hci { sa_family_t hci_family; - unsigned short hci_dev; - unsigned short hci_channel; + uint16_t hci_dev; + uint16_t hci_channel; }; constexpr uint8_t BTPROTO_HCI = 1; @@ -134,7 +134,7 @@ constexpr uint16_t HCI_DEV_NONE = 0xffff; int btsocket_open_mgmt(uint16_t hci) { int fd = socket(PF_BLUETOOTH, SOCK_RAW | SOCK_NONBLOCK, BTPROTO_HCI); if (fd < 0) { - log::debug("Failed to open BT socket, hci: %u", hci); + bluetooth::log::debug("Failed to open BT socket, hci: %u", hci); return -errno; } @@ -146,7 +146,7 @@ int btsocket_open_mgmt(uint16_t hci) { int ret = bind(fd, (struct sockaddr*)&addr, sizeof(addr)); if (ret < 0) { - log::debug("Failed to bind BT socket."); + bluetooth::log::debug("Failed to bind BT socket."); close(fd); return -errno; } @@ -175,15 +175,15 @@ int mgmt_get_codec_capabilities(int fd, uint16_t hci) { if (ret > 0) { RETRY_ON_INTR(ret = write(fd, &ev, MGMT_PKT_HDR_SIZE + ev.len)); if (ret < 0) { - log::debug("Failed to call MGMT_OP_GET_SCO_CODEC_CAPABILITIES: {}", -errno); + bluetooth::log::debug("Failed to call MGMT_OP_GET_SCO_CODEC_CAPABILITIES: {}", -errno); return -errno; - }; + } break; } } while (ret > 0); if (ret <= 0) { - log::debug("Failed waiting for mgmt socket to be writable."); + bluetooth::log::debug("Failed waiting for mgmt socket to be writable."); return -1; } @@ -198,8 +198,11 @@ int mgmt_get_codec_capabilities(int fd, uint16_t hci) { if (fds[0].revents & POLLIN) { RETRY_ON_INTR(ret = read(fd, &ev, sizeof(ev))); if (ret < 0) { - log::debug("Failed to read mgmt socket: {}", -errno); + bluetooth::log::debug("Failed to read mgmt socket: {}", -errno); return -errno; + } else if (ret == 0) { // unlikely to happen, just a safeguard. + bluetooth::log::debug("Failed to read mgmt socket: EOF"); + return -1; } if (ev.opcode == MGMT_EV_COMMAND_COMPLETE) { @@ -215,7 +218,7 @@ int mgmt_get_codec_capabilities(int fd, uint16_t hci) { } } } else if (ret == 0) { - log::debug("Timeout while waiting for codec capabilities response."); + bluetooth::log::debug("Timeout while waiting for codec capabilities response."); ret = -1; } } while (ret > 0); @@ -259,15 +262,15 @@ int mgmt_notify_sco_connection_change(int fd, int hci, RawAddress device, bool i if (ret > 0) { RETRY_ON_INTR(ret = write(fd, &ev, MGMT_PKT_HDR_SIZE + ev.len)); if (ret < 0) { - log::error("Failed to call MGMT_OP_NOTIFY_SCO_CONNECTION_CHANGE: {}", -errno); + bluetooth::log::error("Failed to call MGMT_OP_NOTIFY_SCO_CONNECTION_CHANGE: {}", -errno); return -errno; - }; + } break; } } while (ret > 0); if (ret <= 0) { - log::debug("Failed waiting for mgmt socket to be writable."); + bluetooth::log::debug("Failed waiting for mgmt socket to be writable."); return -1; } @@ -279,15 +282,15 @@ void init() { int hci = bluetooth::common::InitFlags::GetAdapterIndex(); int fd = btsocket_open_mgmt(hci); if (fd < 0) { - log::error("Failed to open mgmt channel, error= {}.", fd); + bluetooth::log::error("Failed to open mgmt channel, error= {}.", fd); return; } int ret = mgmt_get_codec_capabilities(fd, hci); if (ret) { - log::error("Failed to get codec capabilities with error = {}.", ret); + bluetooth::log::error("Failed to get codec capabilities with error = {}.", ret); } else { - log::info("Successfully queried SCO codec capabilities."); + bluetooth::log::info("Successfully queried SCO codec capabilities."); } close(fd); @@ -296,7 +299,7 @@ void init() { // Check if the specified coding format is supported by the adapter. bool is_coding_format_supported(esco_coding_format_t coding_format) { if (coding_format != ESCO_CODING_FORMAT_TRANSPNT && coding_format != ESCO_CODING_FORMAT_MSBC) { - log::warn("Unsupported coding format to query: {}", coding_format); + bluetooth::log::warn("Unsupported coding format to query: {}", coding_format); return false; } @@ -346,7 +349,7 @@ bool get_offload_enabled() { return offload_supported && offload_enabled; } // Set offload enable/disable bool enable_offload(bool enable) { if (!offload_supported && enable) { - log::error("Cannot enable SCO-offload since it is not supported."); + bluetooth::log::error("Cannot enable SCO-offload since it is not supported."); return false; } offload_enabled = enable; @@ -373,7 +376,7 @@ void set_codec_datapath(tBTA_AG_UUID_CODEC codec_uuid) { uint8_t codec_id; if (codec_uuid == tBTA_AG_UUID_CODEC::UUID_CODEC_LC3 && get_offload_enabled()) { - log::error("Offload path for LC3 is not implemented."); + bluetooth::log::error("Offload path for LC3 is not implemented."); return; } @@ -388,20 +391,21 @@ void set_codec_datapath(tBTA_AG_UUID_CODEC codec_uuid) { codec_id = get_offload_enabled() ? codec::LC3 : codec::MSBC_TRANSPARENT; break; default: - log::warn("Unsupported codec ({}). Won't set datapath.", bta_ag_uuid_codec_text(codec_uuid)); + bluetooth::log::warn("Unsupported codec ({}). Won't set datapath.", + bta_ag_uuid_codec_text(codec_uuid)); return; } found = get_single_codec(codec_id, &codec); if (!found) { - log::error("Failed to find codec config for codec ({}). Won't set datapath.", - bta_ag_uuid_codec_text(codec_uuid)); + bluetooth::log::error("Failed to find codec config for codec ({}). Won't set datapath.", + bta_ag_uuid_codec_text(codec_uuid)); return; } - log::info("Configuring datapath for codec ({})", bta_ag_uuid_codec_text(codec_uuid)); + bluetooth::log::info("Configuring datapath for codec ({})", bta_ag_uuid_codec_text(codec_uuid)); if (codec->codec == codec::MSBC && !get_offload_enabled()) { - log::error( + bluetooth::log::error( "Tried to configure offload data path for format ({}) with offload " "disabled. Won't set datapath.", bta_ag_uuid_codec_text(codec_uuid)); @@ -442,12 +446,12 @@ void notify_sco_connection_change(RawAddress device, bool is_connected, int code int hci = bluetooth::common::InitFlags::GetAdapterIndex(); int fd = btsocket_open_mgmt(hci); if (fd < 0) { - log::error("Failed to open mgmt channel, error= {}.", fd); + bluetooth::log::error("Failed to open mgmt channel, error= {}.", fd); return; } if (codec == codec::LC3) { - log::error("Offload path for LC3 is not implemented."); + bluetooth::log::error("Offload path for LC3 is not implemented."); return; } @@ -466,12 +470,12 @@ void notify_sco_connection_change(RawAddress device, bool is_connected, int code int ret = mgmt_notify_sco_connection_change(fd, hci, device, is_connected, converted_codec); if (ret) { - log::error( + bluetooth::log::error( "Failed to notify HAL of connection change: hci {}, device {}, " "connected {}, codec {}", hci, device, is_connected, codec); } else { - log::info( + bluetooth::log::info( "Notified HAL of connection change: hci {}, device {}, connected {}, " "codec {}", hci, device, is_connected, codec); diff --git a/system/stack/btm/btm_sec.cc b/system/stack/btm/btm_sec.cc index 99b49dba58..17093870b5 100644 --- a/system/stack/btm/btm_sec.cc +++ b/system/stack/btm/btm_sec.cc @@ -45,6 +45,7 @@ #include "main/shim/acl_api.h" #include "main/shim/entry.h" #include "main/shim/helpers.h" +#include "metrics/bluetooth_event.h" #include "osi/include/allocator.h" #include "osi/include/properties.h" #include "stack/btm/btm_ble_int.h" @@ -175,7 +176,7 @@ static bool handleUnexpectedEncryptionChange() { void NotifyBondingCanceled(tBTM_STATUS /* btm_status */) { if (btm_sec_cb.api.p_bond_cancel_cmpl_callback) { - btm_sec_cb.api.p_bond_cancel_cmpl_callback(BTM_SUCCESS); + btm_sec_cb.api.p_bond_cancel_cmpl_callback(tBTM_STATUS::BTM_SUCCESS); } } @@ -534,7 +535,7 @@ uint8_t BTM_SecClrServiceByPsm(uint16_t psm) { return btm_sec_cb.RemoveServiceBy * * Parameters: bd_addr - Address of the device for which PIN was * requested - * res - result of the operation BTM_SUCCESS + * res - result of the operation tBTM_STATUS::BTM_SUCCESS * if success * pin_len - length in bytes of the PIN Code * p_pin - pointer to array with the PIN Code @@ -570,7 +571,7 @@ void BTM_PINCodeReply(const RawAddress& bd_addr, tBTM_STATUS res, uint8_t pin_le res = BTM_ILLEGAL_VALUE; } - if (res != BTM_SUCCESS) { + if (res != tBTM_STATUS::BTM_SUCCESS) { /* if peer started dd OR we started dd and pre-fetch pin was not used send * negative reply */ if ((btm_sec_cb.pairing_flags & BTM_PAIR_FLAGS_PEER_STARTED_DD) || @@ -623,7 +624,7 @@ void BTM_PINCodeReply(const RawAddress& bd_addr, tBTM_STATUS res, uint8_t pin_le "BTM_PINCodeReply(): link is connecting so wait pin code request " "from peer"); btm_sec_cb.change_pairing_state(BTM_PAIR_STATE_WAIT_PIN_REQ); - } else if (btm_sec_dd_create_conn(p_dev_rec) != BTM_CMD_STARTED) { + } else if (btm_sec_dd_create_conn(p_dev_rec) != tBTM_STATUS::BTM_CMD_STARTED) { btm_sec_cb.change_pairing_state(BTM_PAIR_STATE_IDLE); p_dev_rec->sec_rec.sec_flags &= ~BTM_SEC_LINK_KEY_AUTHED; @@ -682,11 +683,11 @@ tBTM_STATUS btm_sec_bond_by_transport(const RawAddress& bd_addr, tBLE_ADDR_TYPE ((p_dev_rec->ble_hci_handle != HCI_INVALID_HANDLE) && transport == BT_TRANSPORT_LE && (p_dev_rec->sec_rec.sec_flags & BTM_SEC_LE_AUTHENTICATED))) { log::warn("BTM_SecBond -> Already Paired"); - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } /* Tell controller to get rid of the link key if it has one stored */ - if ((BTM_DeleteStoredLinkKey(&bd_addr, NULL)) != BTM_SUCCESS) { + if ((BTM_DeleteStoredLinkKey(&bd_addr, NULL)) != tBTM_STATUS::BTM_SUCCESS) { log::error("Failed to delete stored link keys"); return BTM_NO_RESOURCES; } @@ -708,7 +709,7 @@ tBTM_STATUS btm_sec_bond_by_transport(const RawAddress& bd_addr, tBLE_ADDR_TYPE btm_sec_cb.pairing_flags |= BTM_PAIR_FLAGS_LE_ACTIVE; p_dev_rec->sec_rec.le_link = tSECURITY_STATE::AUTHENTICATING; btm_sec_cb.change_pairing_state(BTM_PAIR_STATE_WAIT_AUTH_COMPLETE); - return BTM_CMD_STARTED; + return tBTM_STATUS::BTM_CMD_STARTED; } btm_sec_cb.pairing_flags = 0; @@ -745,7 +746,7 @@ tBTM_STATUS btm_sec_bond_by_transport(const RawAddress& bd_addr, tBLE_ADDR_TYPE /* Mark lcb as bonding */ l2cu_update_lcb_4_bonding(bd_addr, true); - return BTM_CMD_STARTED; + return tBTM_STATUS::BTM_CMD_STARTED; } log::debug("An ACL connection does not currently exist peer:{} transport:{}", bd_addr, bt_transport_text(transport)); @@ -756,7 +757,7 @@ tBTM_STATUS btm_sec_bond_by_transport(const RawAddress& bd_addr, tBLE_ADDR_TYPE if (btm_sec_check_prefetch_pin(p_dev_rec)) { log::debug("Class of device used to check for pin peer:{} transport:{}", bd_addr, bt_transport_text(transport)); - return BTM_CMD_STARTED; + return tBTM_STATUS::BTM_CMD_STARTED; } } if ((btm_sec_cb.security_mode == BTM_SEC_MODE_SP || @@ -773,7 +774,7 @@ tBTM_STATUS btm_sec_bond_by_transport(const RawAddress& bd_addr, tBLE_ADDR_TYPE } else { /* We are accepting connection request from peer */ btm_sec_cb.change_pairing_state(BTM_PAIR_STATE_WAIT_PIN_REQ); - status = BTM_CMD_STARTED; + status = tBTM_STATUS::BTM_CMD_STARTED; } log::verbose("State:{} sm4: 0x{:x} le_link_state:{} classic_link_state:{}", tBTM_SEC_CB::btm_pair_state_descr(btm_sec_cb.pairing_state), p_dev_rec->sm4, @@ -783,7 +784,7 @@ tBTM_STATUS btm_sec_bond_by_transport(const RawAddress& bd_addr, tBLE_ADDR_TYPE status = btm_sec_dd_create_conn(p_dev_rec); } - if (status != BTM_CMD_STARTED) { + if (status != tBTM_STATUS::BTM_CMD_STARTED) { log::error("BTM_ReadRemoteDeviceName or btm_sec_dd_create_conn error: 0x{:x}", (int)status); btm_sec_cb.change_pairing_state(BTM_PAIR_STATE_IDLE); } @@ -797,7 +798,7 @@ tBTM_STATUS btm_sec_bond_by_transport(const RawAddress& bd_addr, tBLE_ADDR_TYPE * * Description This function is called to perform bonding with peer device. * If the connection is already up, but not secure, pairing - * is attempted. If already paired BTM_SUCCESS is returned. + * is attempted. If already paired tBTM_STATUS::BTM_SUCCESS is returned. * * Parameters: bd_addr - Address of the device to bond * transport - doing SSP over BR/EDR or SMP over LE @@ -808,7 +809,8 @@ tBTM_STATUS BTM_SecBond(const RawAddress& bd_addr, tBLE_ADDR_TYPE addr_type, tBT_TRANSPORT transport, tBT_DEVICE_TYPE /* device_type */) { if (transport == BT_TRANSPORT_AUTO) { if (addr_type == BLE_ADDR_PUBLIC) { - transport = BTM_UseLeLink(bd_addr) ? BT_TRANSPORT_LE : BT_TRANSPORT_BR_EDR; + transport = get_btm_client_interface().ble.BTM_UseLeLink(bd_addr) ? BT_TRANSPORT_LE + : BT_TRANSPORT_BR_EDR; } else { log::info("Forcing transport LE (was auto) because of the address type"); transport = BT_TRANSPORT_LE; @@ -854,7 +856,7 @@ tBTM_STATUS BTM_SecBondCancel(const RawAddress& bd_addr) { if (p_dev_rec->sec_rec.le_link == tSECURITY_STATE::AUTHENTICATING) { log::verbose("Cancel LE pairing"); if (SMP_PairCancel(bd_addr)) { - return BTM_CMD_STARTED; + return tBTM_STATUS::BTM_CMD_STARTED; } } return BTM_WRONG_MODE; @@ -866,7 +868,7 @@ tBTM_STATUS BTM_SecBondCancel(const RawAddress& bd_addr) { BTM_PAIR_FLAGS_WE_STARTED_DD & btm_sec_cb.pairing_flags) { /* pre-fetching pin for dedicated bonding */ btm_sec_bond_cancel_complete(); - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } /* If this BDA is in a bonding procedure */ @@ -876,7 +878,7 @@ tBTM_STATUS BTM_SecBondCancel(const RawAddress& bd_addr) { if (p_dev_rec->hci_handle != HCI_INVALID_HANDLE) { /* If some other thread disconnecting, we do not send second command */ if (p_dev_rec->sec_rec.classic_link == tSECURITY_STATE::DISCONNECTING) { - return BTM_CMD_STARTED; + return tBTM_STATUS::BTM_CMD_STARTED; } /* If the HCI link was set up by Bonding process */ @@ -893,14 +895,15 @@ tBTM_STATUS BTM_SecBondCancel(const RawAddress& bd_addr) { /* If the HCI link creation was started by Bonding process */ if (btm_sec_cb.pairing_flags & BTM_PAIR_FLAGS_DISC_WHEN_DONE) { btsnd_hcic_create_conn_cancel(bd_addr); - return BTM_CMD_STARTED; + return tBTM_STATUS::BTM_CMD_STARTED; } if (btm_sec_cb.pairing_state == BTM_PAIR_STATE_GET_REM_NAME) { - if (get_btm_client_interface().peer.BTM_CancelRemoteDeviceName() != BTM_SUCCESS) { + if (get_btm_client_interface().peer.BTM_CancelRemoteDeviceName() != + tBTM_STATUS::BTM_SUCCESS) { log::warn("Unable to cancel RNR"); } btm_sec_cb.pairing_flags |= BTM_PAIR_FLAGS_WE_CANCEL_DD; - return BTM_CMD_STARTED; + return tBTM_STATUS::BTM_CMD_STARTED; } return BTM_NOT_AUTHORIZED; } @@ -915,7 +918,7 @@ tBTM_STATUS BTM_SecBondCancel(const RawAddress& bd_addr) { * * Description This function is called to obtain link key type for the * device. - * it returns BTM_SUCCESS if link key is available, or + * it returns tBTM_STATUS::BTM_SUCCESS if link key is available, or * BTM_UNKNOWN_ADDR if Security Manager does not know about * the device or device record does not contain link key info * @@ -951,11 +954,11 @@ tBTM_LINK_KEY_TYPE BTM_SecGetDeviceLinkKeyType(const RawAddress& bd_addr) { * completion. can be set to NULL if not used. * sec_act - LE security action, unused for BR/EDR * - * Returns BTM_SUCCESS - already encrypted + * Returns tBTM_STATUS::BTM_SUCCESS - already encrypted * BTM_PENDING - command will be returned in the callback * BTM_WRONG_MODE- connection not up. - * BTM_BUSY - security procedures are currently active - * BTM_MODE_UNSUPPORTED - if security manager not linked in. + * tBTM_STATUS::BTM_BUSY - security procedures are currently active + * tBTM_STATUS::BTM_MODE_UNSUPPORTED - if security manager not linked in. * ******************************************************************************/ tBTM_STATUS BTM_SetEncryption(const RawAddress& bd_addr, tBT_TRANSPORT transport, @@ -986,10 +989,10 @@ tBTM_STATUS BTM_SetEncryption(const RawAddress& bd_addr, tBT_TRANSPORT transport "transport:{}", bd_addr, bt_transport_text(transport)); if (p_callback) { - do_in_main_thread( - base::BindOnce(p_callback, bd_addr, transport, p_ref_data, BTM_SUCCESS)); + do_in_main_thread(base::BindOnce(p_callback, bd_addr, transport, p_ref_data, + tBTM_STATUS::BTM_SUCCESS)); } - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } break; @@ -1011,10 +1014,10 @@ tBTM_STATUS BTM_SetEncryption(const RawAddress& bd_addr, tBT_TRANSPORT transport "transport:{}", bd_addr, bt_transport_text(transport)); if (p_callback) { - do_in_main_thread( - base::BindOnce(p_callback, bd_addr, transport, p_ref_data, BTM_SUCCESS)); + do_in_main_thread(base::BindOnce(p_callback, bd_addr, transport, p_ref_data, + tBTM_STATUS::BTM_SUCCESS)); } - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } break; @@ -1032,7 +1035,7 @@ tBTM_STATUS BTM_SetEncryption(const RawAddress& bd_addr, tBT_TRANSPORT transport log::warn("Security Manager: BTM_SetEncryption busy, enqueue request"); btm_sec_queue_encrypt_request(bd_addr, transport, p_callback, p_ref_data, sec_act); log::info("Queued start encryption"); - return BTM_CMD_STARTED; + return tBTM_STATUS::BTM_CMD_STARTED; } p_dev_rec->sec_rec.p_callback = p_callback; @@ -1048,7 +1051,7 @@ tBTM_STATUS BTM_SetEncryption(const RawAddress& bd_addr, tBT_TRANSPORT transport p_dev_rec->sec_rec.classic_link, p_dev_rec->sec_rec.sec_flags, p_dev_rec->sec_rec.security_required, (p_callback) ? 'T' : 'F'); - tBTM_STATUS rc = BTM_SUCCESS; + tBTM_STATUS rc = tBTM_STATUS::BTM_SUCCESS; switch (transport) { case BT_TRANSPORT_LE: if (get_btm_client_interface().peer.BTM_IsAclConnectionUp(bd_addr, BT_TRANSPORT_LE)) { @@ -1069,8 +1072,8 @@ tBTM_STATUS BTM_SetEncryption(const RawAddress& bd_addr, tBT_TRANSPORT transport } switch (rc) { - case BTM_CMD_STARTED: - case BTM_BUSY: + case tBTM_STATUS::BTM_CMD_STARTED: + case tBTM_STATUS::BTM_BUSY: break; default: @@ -1100,13 +1103,13 @@ static tBTM_STATUS btm_sec_send_hci_disconnect(tBTM_SEC_DEV_REC* p_dev_rec, tHCI if (conn_handle == p_dev_rec->hci_handle) { if (p_dev_rec->sec_rec.classic_link == tSECURITY_STATE::DISCONNECTING) { // Already sent classic disconnect - return BTM_CMD_STARTED; + return tBTM_STATUS::BTM_CMD_STARTED; } p_dev_rec->sec_rec.classic_link = tSECURITY_STATE::DISCONNECTING; } else if (conn_handle == p_dev_rec->ble_hci_handle) { if (p_dev_rec->sec_rec.le_link == tSECURITY_STATE::DISCONNECTING) { // Already sent ble disconnect - return BTM_CMD_STARTED; + return tBTM_STATUS::BTM_CMD_STARTED; } p_dev_rec->sec_rec.le_link = tSECURITY_STATE::DISCONNECTING; } else { @@ -1120,7 +1123,7 @@ static tBTM_STATUS btm_sec_send_hci_disconnect(tBTM_SEC_DEV_REC* p_dev_rec, tHCI hci_reason_code_text(reason)); acl_disconnect_after_role_switch(conn_handle, reason, comment); - return BTM_CMD_STARTED; + return tBTM_STATUS::BTM_CMD_STARTED; } /******************************************************************************* @@ -1130,7 +1133,7 @@ static tBTM_STATUS btm_sec_send_hci_disconnect(tBTM_SEC_DEV_REC* p_dev_rec, tHCI * Description This function is called to confirm the numeric value for * Simple Pairing in response to BTM_SP_CFM_REQ_EVT * - * Parameters: res - result of the operation BTM_SUCCESS if + * Parameters: res - result of the operation tBTM_STATUS::BTM_SUCCESS if * success * bd_addr - Address of the peer device * @@ -1152,7 +1155,7 @@ void BTM_ConfirmReqReply(tBTM_STATUS res, const RawAddress& bd_addr) { btm_sec_cb.change_pairing_state(BTM_PAIR_STATE_WAIT_AUTH_COMPLETE); - if ((res == BTM_SUCCESS) || (res == BTM_SUCCESS_NO_SECURITY)) { + if ((res == tBTM_STATUS::BTM_SUCCESS) || (res == tBTM_STATUS::BTM_SUCCESS_NO_SECURITY)) { acl_set_disconnect_reason(HCI_SUCCESS); btsnd_hcic_user_conf_reply(bd_addr, true); @@ -1171,7 +1174,7 @@ void BTM_ConfirmReqReply(tBTM_STATUS res, const RawAddress& bd_addr) { * Description This function is called to provide the passkey for * Simple Pairing in response to BTM_SP_KEY_REQ_EVT * - * Parameters: res - result of the operation BTM_SUCCESS if success + * Parameters: res - result of the operation tBTM_STATUS::BTM_SUCCESS if success * bd_addr - Address of the peer device * passkey - numeric value in the range of * BTM_MIN_PASSKEY_VAL(0) - @@ -1187,7 +1190,8 @@ void BTM_PasskeyReqReply(tBTM_STATUS res, const RawAddress& bd_addr, uint32_t pa } /* If timeout already expired or has been canceled, ignore the reply */ - if ((btm_sec_cb.pairing_state == BTM_PAIR_STATE_WAIT_AUTH_COMPLETE) && (res != BTM_SUCCESS)) { + if ((btm_sec_cb.pairing_state == BTM_PAIR_STATE_WAIT_AUTH_COMPLETE) && + (res != tBTM_STATUS::BTM_SUCCESS)) { tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev(bd_addr); if (p_dev_rec != NULL) { acl_set_disconnect_reason(HCI_ERR_HOST_REJECT_SECURITY); @@ -1214,7 +1218,7 @@ void BTM_PasskeyReqReply(tBTM_STATUS res, const RawAddress& bd_addr, uint32_t pa btm_sec_cb.change_pairing_state(BTM_PAIR_STATE_WAIT_AUTH_COMPLETE); - if (res != BTM_SUCCESS) { + if (res != tBTM_STATUS::BTM_SUCCESS) { /* use BTM_PAIR_STATE_WAIT_AUTH_COMPLETE to report authentication failed * event */ acl_set_disconnect_reason(HCI_ERR_HOST_REJECT_SECURITY); @@ -1266,7 +1270,7 @@ void BTM_RemoteOobDataReply(tBTM_STATUS res, const RawAddress& bd_addr, const Oc btm_sec_cb.change_pairing_state(BTM_PAIR_STATE_WAIT_AUTH_COMPLETE); - if (res != BTM_SUCCESS) { + if (res != tBTM_STATUS::BTM_SUCCESS) { /* use BTM_PAIR_STATE_WAIT_AUTH_COMPLETE to report authentication failed * event */ acl_set_disconnect_reason(HCI_ERR_HOST_REJECT_SECURITY); @@ -1428,7 +1432,7 @@ tBTM_STATUS btm_sec_l2cap_access_req_by_requirement(const RawAddress& bd_addr, "is_initiator:{}", bd_addr, security_required, is_originator); - tBTM_STATUS rc = BTM_SUCCESS; + tBTM_STATUS rc = tBTM_STATUS::BTM_SUCCESS; bool chk_acp_auth_done = false; /* should check PSM range in LE connection oriented L2CAP connection */ constexpr tBT_TRANSPORT transport = BT_TRANSPORT_BR_EDR; @@ -1462,7 +1466,7 @@ tBTM_STATUS btm_sec_l2cap_access_req_by_requirement(const RawAddress& bd_addr, if ((p_dev_rec->sec_rec.p_callback) || (btm_sec_cb.pairing_state != BTM_PAIR_STATE_IDLE)) { log::debug("security_flags:x{:x}, sec_flags:x{:x}", security_required, p_dev_rec->sec_rec.sec_flags); - rc = BTM_CMD_STARTED; + rc = tBTM_STATUS::BTM_CMD_STARTED; if ((btm_sec_cb.security_mode == BTM_SEC_MODE_SERVICE) || (BTM_SM4_KNOWN == p_dev_rec->sm4) || (BTM_SEC_IS_SM4(p_dev_rec->sm4) && (!btm_sec_is_upgrade_possible(p_dev_rec, is_originator)))) { @@ -1475,7 +1479,7 @@ tBTM_STATUS btm_sec_l2cap_access_req_by_requirement(const RawAddress& bd_addr, (((security_required & BTM_SEC_OUT_FLAGS) == (BTM_SEC_OUT_AUTHENTICATE | BTM_SEC_OUT_ENCRYPT)) && btm_dev_encrypted(p_dev_rec))) { - rc = BTM_SUCCESS; + rc = tBTM_STATUS::BTM_SUCCESS; } } else { if (((security_required & BTM_SEC_IN_FLAGS) == 0) || @@ -1488,17 +1492,17 @@ tBTM_STATUS btm_sec_l2cap_access_req_by_requirement(const RawAddress& bd_addr, if (((security_required & BTM_SEC_IN_MIN_16_DIGIT_PIN) == 0) || (((security_required & BTM_SEC_IN_MIN_16_DIGIT_PIN) == BTM_SEC_IN_MIN_16_DIGIT_PIN) && btm_dev_16_digit_authenticated(p_dev_rec))) { - rc = BTM_SUCCESS; + rc = tBTM_STATUS::BTM_SUCCESS; } } } - if ((rc == BTM_SUCCESS) && (security_required & BTM_SEC_MODE4_LEVEL4) && + if ((rc == tBTM_STATUS::BTM_SUCCESS) && (security_required & BTM_SEC_MODE4_LEVEL4) && (p_dev_rec->sec_rec.link_key_type != BTM_LKEY_TYPE_AUTH_COMB_P_256)) { - rc = BTM_CMD_STARTED; + rc = tBTM_STATUS::BTM_CMD_STARTED; } - if (rc == BTM_SUCCESS) { + if (rc == tBTM_STATUS::BTM_SUCCESS) { if (access_secure_service_from_temp_bond(p_dev_rec, is_originator, security_required)) { log::error( "Trying to access a secure service from a temp bonding, " @@ -1514,7 +1518,7 @@ tBTM_STATUS btm_sec_l2cap_access_req_by_requirement(const RawAddress& bd_addr, } btm_sec_cb.sec_req_pending = true; - return BTM_CMD_STARTED; + return tBTM_STATUS::BTM_CMD_STARTED; } /* Save the security requirements in case a pairing is needed */ @@ -1540,7 +1544,7 @@ tBTM_STATUS btm_sec_l2cap_access_req_by_requirement(const RawAddress& bd_addr, p_dev_rec->sec_rec.sec_flags, (is_originator) ? "initiator" : "acceptor"); p_dev_rec->sm4 |= BTM_SM4_REQ_PEND; - return BTM_CMD_STARTED; + return tBTM_STATUS::BTM_CMD_STARTED; } } @@ -1572,7 +1576,7 @@ tBTM_STATUS btm_sec_l2cap_access_req_by_requirement(const RawAddress& bd_addr, p_dev_rec->sec_rec.classic_link = tSECURITY_STATE::DELAY_FOR_ENC; (*p_callback)(bd_addr, transport, p_ref_data, rc); - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } } @@ -1597,7 +1601,7 @@ tBTM_STATUS btm_sec_l2cap_access_req_by_requirement(const RawAddress& bd_addr, } rc = btm_sec_execute_procedure(p_dev_rec); - if (rc != BTM_CMD_STARTED) { + if (rc != tBTM_STATUS::BTM_CMD_STARTED) { log::verbose("p_dev_rec={}, clearing callback. old p_callback={}", fmt::ptr(p_dev_rec), fmt::ptr(p_dev_rec->sec_rec.p_callback)); p_dev_rec->sec_rec.p_callback = NULL; @@ -1645,8 +1649,8 @@ tBTM_STATUS btm_sec_l2cap_access_req(const RawAddress& bd_addr, uint16_t psm, bo /* Services level0 by default have no security */ if (psm == BT_PSM_SDP) { log::debug("No security required for SDP"); - (*p_callback)(bd_addr, transport, p_ref_data, BTM_SUCCESS_NO_SECURITY); - return BTM_SUCCESS; + (*p_callback)(bd_addr, transport, p_ref_data, tBTM_STATUS::BTM_SUCCESS_NO_SECURITY); + return tBTM_STATUS::BTM_SUCCESS; } uint16_t security_required; @@ -1680,7 +1684,7 @@ tBTM_STATUS btm_sec_l2cap_access_req(const RawAddress& bd_addr, uint16_t psm, bo * p_ref_data - Pointer to any reference data needed by the * the callback function. * - * Returns BTM_CMD_STARTED + * Returns tBTM_STATUS::BTM_CMD_STARTED * ******************************************************************************/ tBTM_STATUS btm_sec_mx_access_request(const RawAddress& bd_addr, bool is_originator, @@ -1702,7 +1706,7 @@ tBTM_STATUS btm_sec_mx_access_request(const RawAddress& bd_addr, bool is_origina log::debug("Pairing in progress pairing_state:{}", tBTM_SEC_CB::btm_pair_state_descr(btm_sec_cb.pairing_state)); - rc = BTM_CMD_STARTED; + rc = tBTM_STATUS::BTM_CMD_STARTED; if ((btm_sec_cb.security_mode == BTM_SEC_MODE_SERVICE) || (BTM_SM4_KNOWN == p_dev_rec->sm4) || (BTM_SEC_IS_SM4(p_dev_rec->sm4) && @@ -1716,7 +1720,7 @@ tBTM_STATUS btm_sec_mx_access_request(const RawAddress& bd_addr, bool is_origina (((security_required & BTM_SEC_OUT_FLAGS) == (BTM_SEC_OUT_AUTHENTICATE | BTM_SEC_OUT_ENCRYPT)) && btm_dev_encrypted(p_dev_rec))) { - rc = BTM_SUCCESS; + rc = tBTM_STATUS::BTM_SUCCESS; } } else { if (((security_required & BTM_SEC_IN_FLAGS) == 0) || @@ -1729,25 +1733,25 @@ tBTM_STATUS btm_sec_mx_access_request(const RawAddress& bd_addr, bool is_origina if (((security_required & BTM_SEC_IN_MIN_16_DIGIT_PIN) == 0) || (((security_required & BTM_SEC_IN_MIN_16_DIGIT_PIN) == BTM_SEC_IN_MIN_16_DIGIT_PIN) && btm_dev_16_digit_authenticated(p_dev_rec))) { - rc = BTM_SUCCESS; + rc = tBTM_STATUS::BTM_SUCCESS; } } } - if ((rc == BTM_SUCCESS) && (security_required & BTM_SEC_MODE4_LEVEL4) && + if ((rc == tBTM_STATUS::BTM_SUCCESS) && (security_required & BTM_SEC_MODE4_LEVEL4) && (p_dev_rec->sec_rec.link_key_type != BTM_LKEY_TYPE_AUTH_COMB_P_256)) { - rc = BTM_CMD_STARTED; + rc = tBTM_STATUS::BTM_CMD_STARTED; } } /* the new security request */ if (p_dev_rec->sec_rec.classic_link != tSECURITY_STATE::IDLE) { log::debug("A pending security procedure in progress"); - rc = BTM_CMD_STARTED; + rc = tBTM_STATUS::BTM_CMD_STARTED; } - if (rc == BTM_CMD_STARTED) { + if (rc == tBTM_STATUS::BTM_CMD_STARTED) { btm_sec_queue_mx_request(bd_addr, BT_PSM_RFCOMM, is_originator, security_required, p_callback, p_ref_data); - } else /* rc == BTM_SUCCESS */ + } else /* rc == tBTM_STATUS::BTM_SUCCESS */ { if (access_secure_service_from_temp_bond(p_dev_rec, is_originator, security_required)) { log::error( @@ -1818,7 +1822,7 @@ tBTM_STATUS btm_sec_mx_access_request(const RawAddress& bd_addr, bool is_origina rc = btm_sec_execute_procedure(p_dev_rec); log::debug("Started security procedure peer:{} btm_status:{}", p_dev_rec->RemoteAddress(), btm_status_text(rc)); - if (rc != BTM_CMD_STARTED) { + if (rc != tBTM_STATUS::BTM_CMD_STARTED) { if (p_callback) { p_dev_rec->sec_rec.p_callback = NULL; (*p_callback)(bd_addr, transport, p_ref_data, rc); @@ -1896,7 +1900,7 @@ static void btm_sec_bond_cancel_complete(void) { /* Notify application that the cancel succeeded */ if (btm_sec_cb.api.p_bond_cancel_cmpl_callback) { - btm_sec_cb.api.p_bond_cancel_cmpl_callback(BTM_SUCCESS); + btm_sec_cb.api.p_bond_cancel_cmpl_callback(tBTM_STATUS::BTM_SUCCESS); } } } @@ -2046,21 +2050,21 @@ void btm_sec_abort_access_req(const RawAddress& bd_addr) { * Description This function is called to create an ACL connection for * the dedicated bonding process * - * Returns BTM_SUCCESS if an ACL connection is already up - * BTM_CMD_STARTED if the ACL connection has been requested + * Returns tBTM_STATUS::BTM_SUCCESS if an ACL connection is already up + * tBTM_STATUS::BTM_CMD_STARTED if the ACL connection has been requested * BTM_NO_RESOURCES if failed to start the ACL connection * ******************************************************************************/ static tBTM_STATUS btm_sec_dd_create_conn(tBTM_SEC_DEV_REC* p_dev_rec) { tBTM_STATUS status = l2cu_ConnectAclForSecurity(p_dev_rec->bd_addr); - if (status == BTM_CMD_STARTED) { + if (status == tBTM_STATUS::BTM_CMD_STARTED) { btm_sec_cb.change_pairing_state(BTM_PAIR_STATE_WAIT_PIN_REQ); /* If already connected, start pending security procedure */ if (get_btm_client_interface().peer.BTM_IsAclConnectionUp(p_dev_rec->bd_addr, BT_TRANSPORT_BR_EDR)) { - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } - return BTM_CMD_STARTED; + return tBTM_STATUS::BTM_CMD_STARTED; } else if (status == BTM_NO_RESOURCES) { return BTM_NO_RESOURCES; } @@ -2072,7 +2076,7 @@ static tBTM_STATUS btm_sec_dd_create_conn(tBTM_SEC_DEV_REC* p_dev_rec) { btm_sec_cb.change_pairing_state(BTM_PAIR_STATE_WAIT_PIN_REQ); - return BTM_CMD_STARTED; + return tBTM_STATUS::BTM_CMD_STARTED; } /******************************************************************************* @@ -2166,7 +2170,6 @@ tBTM_SEC_DEV_REC* btm_rnr_add_name_to_security_record(const RawAddress* p_bd_add "name:{} classic_link:{}", tBTM_SEC_CB::btm_pair_state_descr(btm_sec_cb.pairing_state), reinterpret_cast<char const*>(p_bd_name), p_dev_rec->sec_rec.classic_link); - bd_name_copy(p_dev_rec->sec_bd_name, p_bd_name); p_dev_rec->sec_rec.sec_flags |= BTM_SEC_NAME_KNOWN; log::verbose("setting BTM_SEC_NAME_KNOWN sec_flags:0x{:x}", p_dev_rec->sec_rec.sec_flags); @@ -2183,6 +2186,8 @@ tBTM_SEC_DEV_REC* btm_rnr_add_name_to_security_record(const RawAddress* p_bd_add p_dev_rec->sec_bd_name[0] = 0; } + bluetooth::metrics::LogRemoteNameRequestCompletion(bd_addr, hci_status); + /* Notify all clients waiting for name to be resolved */ call_registered_rmt_name_callbacks(&bd_addr, p_dev_rec->dev_class, p_dev_rec->sec_bd_name, hci_status); @@ -2315,9 +2320,10 @@ void btm_sec_rmt_name_request_complete(const RawAddress* p_bd_addr, const uint8_ /* Both we and the peer are 2.1 - continue to create connection */ else { tBTM_STATUS req_status = btm_sec_dd_create_conn(p_dev_rec); - if (req_status == BTM_SUCCESS) { + bluetooth::metrics::LogAclAfterRemoteNameRequest(bd_addr, req_status); + if (req_status == tBTM_STATUS::BTM_SUCCESS) { await_connection = false; - } else if (req_status != BTM_CMD_STARTED) { + } else if (req_status != tBTM_STATUS::BTM_CMD_STARTED) { log::warn("failed to start connection"); btm_sec_cb.change_pairing_state(BTM_PAIR_STATE_IDLE); @@ -2374,7 +2380,7 @@ void btm_sec_rmt_name_request_complete(const RawAddress* p_bd_addr, const uint8_ tBTM_STATUS btm_status = btm_sec_execute_procedure(p_dev_rec); /* If result is pending reply from the user or from the device is pending */ - if (btm_status == BTM_CMD_STARTED) { + if (btm_status == tBTM_STATUS::BTM_CMD_STARTED) { return; } @@ -2748,7 +2754,7 @@ void btm_proc_sp_req_evt(tBTM_SP_EVT event, const RawAddress bda, const uint32_t * right now */ } else if ((event == BTM_SP_CFM_REQ_EVT) && (evt_data.cfm_req.just_works)) { /* automatically reply with just works if no sp_cback */ - status = BTM_SUCCESS; + status = tBTM_STATUS::BTM_SUCCESS; } if (event == BTM_SP_CFM_REQ_EVT) { @@ -2993,6 +2999,7 @@ void btm_sec_auth_complete(uint16_t handle, tHCI_STATUS status) { bool was_authenticating = false; if (p_dev_rec) { + bluetooth::metrics::LogAuthenticationComplete(p_dev_rec->bd_addr, status); log::verbose( "Security Manager: in state: {}, handle: {}, status: {}, " "dev->sec_rec.classic_link:{}, bda: {}, RName: {}", @@ -3014,7 +3021,7 @@ void btm_sec_auth_complete(uint16_t handle, tHCI_STATUS status) { return; } - if (com::android::bluetooth::flags::clear_collision_state_on_pairing_complete()) { + if (com::android::bluetooth::flags::clear_auth_collision_state_on_pairing_complete()) { if (p_dev_rec && btm_sec_cb.p_collided_dev_rec && p_dev_rec->bd_addr == btm_sec_cb.p_collided_dev_rec->bd_addr) { btm_sec_cb.collision_start_time = 0; @@ -3103,7 +3110,7 @@ void btm_sec_auth_complete(uint16_t handle, tHCI_STATUS status) { tHCI_ROLE role = HCI_ROLE_UNKNOWN; if (get_btm_client_interface().link_policy.BTM_GetRole(p_dev_rec->bd_addr, &role) != - BTM_SUCCESS) { + tBTM_STATUS::BTM_SUCCESS) { log::warn("Unable to get link role peer:{}", p_dev_rec->bd_addr); } if (role == HCI_ROLE_CENTRAL) { @@ -3115,7 +3122,10 @@ void btm_sec_auth_complete(uint16_t handle, tHCI_STATUS status) { log::info( "auth completed in role=peripheral, try to switch role and " "encrypt"); - BTM_SwitchRoleToCentral(p_dev_rec->RemoteAddress()); + if (get_btm_client_interface().link_policy.BTM_SwitchRoleToCentral( + p_dev_rec->RemoteAddress()) != BTM_CMD_STARTED) { + log::warn("Unable to switch role to central peer:{}", p_dev_rec->RemoteAddress()); + } } l2cu_start_post_bond_timer(p_dev_rec->hci_handle); @@ -3148,7 +3158,7 @@ void btm_sec_auth_complete(uint16_t handle, tHCI_STATUS status) { /* If there is no next procedure, or procedure failed to start, notify the * caller */ - if (btm_status != BTM_CMD_STARTED) { + if (btm_status != tBTM_STATUS::BTM_CMD_STARTED) { btm_sec_dev_rec_cback_event(p_dev_rec, btm_status, false); } } @@ -3282,7 +3292,7 @@ void btm_sec_encrypt_change(uint16_t handle, tHCI_STATUS status, uint8_t encr_en } tHCI_ROLE role = HCI_ROLE_UNKNOWN; if (get_btm_client_interface().link_policy.BTM_GetRole(p_dev_rec->bd_addr, &role) != - BTM_SUCCESS) { + tBTM_STATUS::BTM_SUCCESS) { log::warn("Unable to get link policy role peer:{}", p_dev_rec->bd_addr); } if (p_dev_rec->sec_rec.new_encryption_key_is_p256) { @@ -3332,7 +3342,7 @@ void btm_sec_encrypt_change(uint16_t handle, tHCI_STATUS status, uint8_t encr_en tBTM_STATUS btm_status = btm_sec_execute_procedure(p_dev_rec); /* If there is no next procedure, or procedure failed to start, notify the * caller */ - if (static_cast<std::underlying_type_t<tHCI_STATUS>>(status) != BTM_CMD_STARTED) { + if (static_cast<std::underlying_type_t<tHCI_STATUS>>(status) != tBTM_STATUS::BTM_CMD_STARTED) { btm_sec_dev_rec_cback_event(p_dev_rec, btm_status, false); } } @@ -3431,7 +3441,7 @@ static void btm_sec_connect_after_reject_timeout(void* /* data */) { log::verbose("restarting ACL connection"); btm_sec_cb.p_collided_dev_rec = 0; - if (btm_sec_dd_create_conn(p_dev_rec) != BTM_CMD_STARTED) { + if (btm_sec_dd_create_conn(p_dev_rec) != tBTM_STATUS::BTM_CMD_STARTED) { log::warn("Security Manager: failed to start connection"); btm_sec_cb.change_pairing_state(BTM_PAIR_STATE_IDLE); @@ -3514,8 +3524,9 @@ void btm_sec_connected(const RawAddress& bda, uint16_t handle, tHCI_STATUS statu /* remote device name is unknowm, start getting remote name first */ btm_sec_cb.change_pairing_state(BTM_PAIR_STATE_GET_REM_NAME); - if (get_btm_client_interface().peer.BTM_ReadRemoteDeviceName( - p_dev_rec->bd_addr, NULL, BT_TRANSPORT_BR_EDR) != BTM_CMD_STARTED) { + if (get_btm_client_interface().peer.BTM_ReadRemoteDeviceName(p_dev_rec->bd_addr, NULL, + BT_TRANSPORT_BR_EDR) != + tBTM_STATUS::BTM_CMD_STARTED) { log::error("cannot read remote name"); btm_sec_cb.change_pairing_state(BTM_PAIR_STATE_IDLE); } @@ -3549,7 +3560,7 @@ void btm_sec_connected(const RawAddress& bda, uint16_t handle, tHCI_STATUS statu /* Try again: RNR when no ACL causes HCI_RMT_HOST_SUP_FEAT_NOTIFY_EVT */ btm_sec_cb.change_pairing_state(BTM_PAIR_STATE_GET_REM_NAME); if (get_btm_client_interface().peer.BTM_ReadRemoteDeviceName( - bda, NULL, BT_TRANSPORT_BR_EDR) != BTM_CMD_STARTED) { + bda, NULL, BT_TRANSPORT_BR_EDR) != tBTM_STATUS::BTM_CMD_STARTED) { log::error("cannot read remote name"); btm_sec_cb.change_pairing_state(BTM_PAIR_STATE_IDLE); } @@ -3705,7 +3716,7 @@ void btm_sec_connected(const RawAddress& bda, uint16_t handle, tHCI_STATUS statu log::debug("Is connection locally initiated:{}", p_dev_rec->is_originator); if (!(p_dev_rec->sec_rec.sec_flags & BTM_SEC_NAME_KNOWN) || p_dev_rec->is_originator) { tBTM_STATUS res = btm_sec_execute_procedure(p_dev_rec); - if (res != BTM_CMD_STARTED) { + if (res != tBTM_STATUS::BTM_CMD_STARTED) { btm_sec_dev_rec_cback_event(p_dev_rec, res, false); } } @@ -3718,7 +3729,7 @@ tBTM_STATUS btm_sec_disconnect(uint16_t handle, tHCI_STATUS reason, std::string if (!p_dev_rec) { acl_disconnect_from_handle(handle, reason, "stack::btm::btm_sec::btm_sec_disconnect No security record"); - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } /* If we are in the process of bonding we need to tell client that auth failed @@ -3728,7 +3739,7 @@ tBTM_STATUS btm_sec_disconnect(uint16_t handle, tHCI_STATUS reason, std::string (btm_sec_cb.pairing_flags & BTM_PAIR_FLAGS_WE_STARTED_DD)) { /* we are currently doing bonding. Link will be disconnected when done */ btm_sec_cb.pairing_flags |= BTM_PAIR_FLAGS_DISC_WHEN_DONE; - return BTM_BUSY; + return tBTM_STATUS::BTM_BUSY; } return btm_sec_send_hci_disconnect(p_dev_rec, reason, handle, comment); @@ -3761,7 +3772,7 @@ void btm_sec_disconnected(uint16_t handle, tHCI_REASON reason, std::string comme /* clear unused flags */ p_dev_rec->sm4 &= BTM_SM4_TRUE; - if (com::android::bluetooth::flags::clear_collision_state_on_pairing_complete()) { + if (com::android::bluetooth::flags::clear_auth_collision_state_on_pairing_complete()) { if (btm_sec_cb.p_collided_dev_rec && p_dev_rec->bd_addr == btm_sec_cb.p_collided_dev_rec->bd_addr) { log::debug("clear auth collision info after disconnection"); @@ -4387,8 +4398,8 @@ void btm_sec_update_clock_offset(uint16_t handle, uint16_t clock_offset) { * the peer will not be established. This function in this * case performs only authorization. * - * Returns BTM_SUCCESS - permission is granted - * BTM_CMD_STARTED - in process + * Returns tBTM_STATUS::BTM_SUCCESS - permission is granted + * tBTM_STATUS::BTM_CMD_STARTED - in process * BTM_NO_RESOURCES - permission declined * ******************************************************************************/ @@ -4401,7 +4412,7 @@ tBTM_STATUS btm_sec_execute_procedure(tBTM_SEC_DEV_REC* p_dev_rec) { if (p_dev_rec->sec_rec.classic_link != tSECURITY_STATE::IDLE) { log::info("No immediate action taken in busy state: le_link={} classic_link={}", p_dev_rec->sec_rec.le_link, p_dev_rec->sec_rec.classic_link); - return BTM_CMD_STARTED; + return tBTM_STATUS::BTM_CMD_STARTED; } /* If any security is required, get the name first */ @@ -4412,7 +4423,7 @@ tBTM_STATUS btm_sec_execute_procedure(tBTM_SEC_DEV_REC* p_dev_rec) { log::warn("Unable to start remote name request"); return BTM_NO_RESOURCES; } - return BTM_CMD_STARTED; + return tBTM_STATUS::BTM_CMD_STARTED; } /* If connection is not authenticated and authentication is required */ @@ -4474,7 +4485,7 @@ tBTM_STATUS btm_sec_execute_procedure(tBTM_SEC_DEV_REC* p_dev_rec) { } btm_sec_wait_and_start_authentication(p_dev_rec); - return BTM_CMD_STARTED; + return tBTM_STATUS::BTM_CMD_STARTED; } } @@ -4490,7 +4501,7 @@ tBTM_STATUS btm_sec_execute_procedure(tBTM_SEC_DEV_REC* p_dev_rec) { btsnd_hcic_set_conn_encrypt(p_dev_rec->hci_handle, true); p_dev_rec->sec_rec.classic_link = tSECURITY_STATE::ENCRYPTING; - return BTM_CMD_STARTED; + return tBTM_STATUS::BTM_CMD_STARTED; } else { log::debug("Encryption not required"); } @@ -4516,7 +4527,7 @@ tBTM_STATUS btm_sec_execute_procedure(tBTM_SEC_DEV_REC* p_dev_rec) { log::verbose("Security Manager: access granted"); - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } /******************************************************************************* @@ -4585,7 +4596,7 @@ static void btm_sec_auth_timer_timeout(void* data) { log::info("device is already authenticated"); if (p_dev_rec->sec_rec.p_callback) { (*p_dev_rec->sec_rec.p_callback)(p_dev_rec->bd_addr, BT_TRANSPORT_BR_EDR, - p_dev_rec->sec_rec.p_ref_data, BTM_SUCCESS); + p_dev_rec->sec_rec.p_ref_data, tBTM_STATUS::BTM_SUCCESS); } } else if (p_dev_rec->sec_rec.classic_link == tSECURITY_STATE::AUTHENTICATING) { log::info("device is in the process of authenticating"); @@ -4612,7 +4623,7 @@ static void btm_sec_collision_timeout(void* /* data */) { tBTM_STATUS status = btm_sec_execute_procedure(btm_sec_cb.p_collided_dev_rec); /* If result is pending reply from the user or from the device is pending */ - if (status != BTM_CMD_STARTED) { + if (status != tBTM_STATUS::BTM_CMD_STARTED) { /* There is no next procedure or start of procedure failed, notify the * waiting layer */ btm_sec_dev_rec_cback_event(btm_sec_cb.p_collided_dev_rec, status, false); @@ -4829,7 +4840,7 @@ static bool btm_sec_check_prefetch_pin(tBTM_SEC_DEV_REC* p_dev_rec) { /* If we got a PIN, use that, else try to get one */ if (btm_sec_cb.pin_code_len) { - BTM_PINCodeReply(p_dev_rec->bd_addr, BTM_SUCCESS, btm_sec_cb.pin_code_len, + BTM_PINCodeReply(p_dev_rec->bd_addr, tBTM_STATUS::BTM_SUCCESS, btm_sec_cb.pin_code_len, btm_sec_cb.pin_code); } else { /* pin was not supplied - pre-fetch pin code now */ @@ -4891,7 +4902,7 @@ static void btm_sec_check_pending_enc_req(tBTM_SEC_DEV_REC* p_dev_rec, tBT_TRANS return; } - const tBTM_STATUS res = encr_enable ? BTM_SUCCESS : BTM_ERR_PROCESSING; + const tBTM_STATUS res = encr_enable ? tBTM_STATUS::BTM_SUCCESS : BTM_ERR_PROCESSING; list_t* list = fixed_queue_get_list(btm_sec_cb.sec_pending_q); for (const list_node_t* node = list_begin(list); node != list_end(list);) { tBTM_SEC_QUEUE_ENTRY* p_e = (tBTM_SEC_QUEUE_ENTRY*)list_node(node); @@ -5029,7 +5040,7 @@ void btm_sec_set_peer_sec_caps(uint16_t hci_handle, bool ssp_supported, bool sc_ if (!(p_dev_rec->sec_rec.sec_flags & BTM_SEC_NAME_KNOWN) || p_dev_rec->is_originator) { tBTM_STATUS btm_status = btm_sec_execute_procedure(p_dev_rec); - if (btm_status != BTM_CMD_STARTED) { + if (btm_status != tBTM_STATUS::BTM_CMD_STARTED) { log::warn("Security procedure not started! status:{}", btm_status_text(btm_status)); btm_sec_dev_rec_cback_event(p_dev_rec, btm_status, false); } diff --git a/system/stack/btm/btm_sec.h b/system/stack/btm/btm_sec.h index 8ec45f7a4d..52fbd40af9 100644 --- a/system/stack/btm/btm_sec.h +++ b/system/stack/btm/btm_sec.h @@ -167,7 +167,7 @@ uint8_t BTM_SecClrServiceByPsm(uint16_t psm); * * Parameters: bd_addr - Address of the device for which PIN was * requested - * res - result of the operation BTM_SUCCESS + * res - result of the operation tBTM_STATUS::BTM_SUCCESS * if success * pin_len - length in bytes of the PIN Code * p_pin - pointer to array with the PIN Code @@ -196,7 +196,7 @@ tBTM_STATUS btm_sec_bond_by_transport(const RawAddress& bd_addr, tBLE_ADDR_TYPE * * Description This function is called to perform bonding with peer device. * If the connection is already up, but not secure, pairing - * is attempted. If already paired BTM_SUCCESS is returned. + * is attempted. If already paired tBTM_STATUS::BTM_SUCCESS is returned. * * Parameters: bd_addr - Address of the device to bond * transport - doing SSP over BR/EDR or SMP over LE @@ -225,7 +225,7 @@ tBTM_STATUS BTM_SecBondCancel(const RawAddress& bd_addr); * * Description This function is called to obtain link key type for the * device. - * it returns BTM_SUCCESS if link key is available, or + * it returns tBTM_STATUS::BTM_SUCCESS if link key is available, or * BTM_UNKNOWN_ADDR if Security Manager does not know about * the device or device record does not contain link key info * @@ -255,10 +255,10 @@ tBTM_LINK_KEY_TYPE BTM_SecGetDeviceLinkKeyType(const RawAddress& bd_addr); * completion. can be set to NULL if not used. * sec_act - LE security action, unused for BR/EDR * - * Returns BTM_SUCCESS - already encrypted + * Returns tBTM_STATUS::BTM_SUCCESS - already encrypted * BTM_PENDING - command will be returned in the callback * BTM_WRONG_MODE- connection not up. - * BTM_BUSY - security procedures are currently active + * tBTM_STATUS::BTM_BUSY - security procedures are currently active * BTM_ERR_KEY_MISSING - link key is missing. * BTM_MODE_UNSUPPORTED - if security manager not linked in. * @@ -276,7 +276,7 @@ bool BTM_SecIsSecurityPending(const RawAddress& bd_addr); * Description This function is called to confirm the numeric value for * Simple Pairing in response to BTM_SP_CFM_REQ_EVT * - * Parameters: res - result of the operation BTM_SUCCESS if + * Parameters: res - result of the operation tBTM_STATUS::BTM_SUCCESS if * success * bd_addr - Address of the peer device * @@ -290,7 +290,7 @@ void BTM_ConfirmReqReply(tBTM_STATUS res, const RawAddress& bd_addr); * Description This function is called to provide the passkey for * Simple Pairing in response to BTM_SP_KEY_REQ_EVT * - * Parameters: res - result of the operation BTM_SUCCESS if success + * Parameters: res - result of the operation tBTM_STATUS::BTM_SUCCESS if success * bd_addr - Address of the peer device * passkey - numeric value in the range of * BTM_MIN_PASSKEY_VAL(0) - @@ -395,7 +395,7 @@ tBTM_STATUS btm_sec_l2cap_access_req_by_requirement(const RawAddress& bd_addr, *required procedures are completed p_ref_data - Pointer to any reference *data needed by the the callback function. * - * Returns BTM_CMD_STARTED + * Returns tBTM_STATUS::BTM_CMD_STARTED * ******************************************************************************/ tBTM_STATUS btm_sec_mx_access_request(const RawAddress& bd_addr, bool is_originator, diff --git a/system/stack/btm/power_mode.h b/system/stack/btm/power_mode.h index 402937c14c..c31b6b3607 100644 --- a/system/stack/btm/power_mode.h +++ b/system/stack/btm/power_mode.h @@ -209,7 +209,7 @@ inline void set_le_scan_mode_to_ctrl_state(uint32_t duty_cycle, tBTM_CONTRL_STAT * * Description register or deregister with power manager * - * Returns BTM_SUCCESS if successful, + * Returns tBTM_STATUS::BTM_SUCCESS if successful, * BTM_NO_RESOURCES if no room to hold registration * BTM_ILLEGAL_VALUE * @@ -229,7 +229,7 @@ void BTM_PM_OnDisconnected(uint16_t handle); * Description store the mode in control block or * alter ACL connection behavior. * - * Returns BTM_SUCCESS if successful, + * Returns tBTM_STATUS::BTM_SUCCESS if successful, * BTM_UNKNOWN_ADDR if bd addr is not active or bad * ******************************************************************************/ @@ -250,7 +250,7 @@ bool BTM_SetLinkPolicyActiveMode(const RawAddress& remote_bda); * min_loc_to - minimum local timeout * * - * Returns BTM_SUCCESS if the HCI command is issued successful, + * Returns tBTM_STATUS::BTM_SUCCESS if the HCI command is issued successful, * BTM_UNKNOWN_ADDR if bd addr is not active or bad * BTM_CMD_STORED if the command is stored * diff --git a/system/stack/btu/btu_hcif.cc b/system/stack/btu/btu_hcif.cc index 2205009c60..584912973d 100644 --- a/system/stack/btu/btu_hcif.cc +++ b/system/stack/btu/btu_hcif.cc @@ -46,6 +46,7 @@ #include "stack/include/btm_ble_addr.h" #include "stack/include/btm_iso_api.h" #include "stack/include/btm_sec_api_types.h" +#include "stack/include/btm_status.h" #include "stack/include/dev_hci_link_interface.h" #include "stack/include/hci_error_code.h" #include "stack/include/hci_evt_length.h" @@ -128,7 +129,6 @@ static void btu_hcif_log_event_metrics(uint8_t evt_code, const uint8_t* p_event) log_classic_pairing_event(bda, handle, cmd, evt_code, status, reason, value); break; case HCI_SIMPLE_PAIRING_COMPLETE_EVT: - case HCI_RMT_NAME_REQUEST_COMP_EVT: STREAM_TO_UINT8(status, p_event); STREAM_TO_BDADDR(bda, p_event); log_classic_pairing_event(bda, handle, cmd, evt_code, status, reason, value); @@ -177,6 +177,7 @@ static void btu_hcif_log_event_metrics(uint8_t evt_code, const uint8_t* p_event) case HCI_CONNECTION_COMP_EVT: // EventCode::CONNECTION_COMPLETE case HCI_CONNECTION_REQUEST_EVT: // EventCode::CONNECTION_REQUEST case HCI_DISCONNECTION_COMP_EVT: // EventCode::DISCONNECTION_COMPLETE + case HCI_RMT_NAME_REQUEST_COMP_EVT: // EventCode::REMOTE_NAME_REQUEST_COMPLETE default: log::error( "Unexpectedly received event_code:0x{:02x} that should not be " @@ -1220,7 +1221,7 @@ void btu_hcif_read_local_oob_complete(const uint8_t* p, uint16_t evt_len) { } STREAM_TO_UINT8(status, p); if (status == HCI_SUCCESS) { - evt_data.status = BTM_SUCCESS; + evt_data.status = tBTM_STATUS::BTM_SUCCESS; } else { evt_data.status = BTM_ERR_PROCESSING; } @@ -1246,7 +1247,7 @@ void btu_hcif_read_local_oob_extended_complete(const uint8_t* p, uint16_t evt_le uint8_t status; STREAM_TO_UINT8(status, p); if (status == HCI_SUCCESS) { - evt_data.status = BTM_SUCCESS; + evt_data.status = tBTM_STATUS::BTM_SUCCESS; } else { evt_data.status = BTM_ERR_PROCESSING; } diff --git a/system/stack/fuzzers/gatt_fuzzer.cc b/system/stack/fuzzers/gatt_fuzzer.cc index a98f674e72..409e62c1da 100644 --- a/system/stack/fuzzers/gatt_fuzzer.cc +++ b/system/stack/fuzzers/gatt_fuzzer.cc @@ -49,6 +49,9 @@ namespace os { bool GetSystemPropertyBool(const std::string& property, bool default_value) { return default_value; } +uint32_t GetSystemPropertyUint32(const std::string& property, uint32_t default_value) { + return default_value; +} } // namespace os } // namespace bluetooth diff --git a/system/stack/fuzzers/smp_fuzzer.cc b/system/stack/fuzzers/smp_fuzzer.cc index e79ab313c8..89a90c06a7 100644 --- a/system/stack/fuzzers/smp_fuzzer.cc +++ b/system/stack/fuzzers/smp_fuzzer.cc @@ -23,6 +23,7 @@ #include "common/message_loop_thread.h" #include "osi/include/allocator.h" #include "stack/include/bt_hdr.h" +#include "stack/include/btm_status.h" #include "stack/include/smp_api.h" #include "stack/smp/smp_int.h" #include "test/fake/fake_osi.h" @@ -167,7 +168,7 @@ tBTM_STATUS smp_callback(tSMP_EVT event, const RawAddress& bd_addr, const tSMP_E default: break; } - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } void Fuzz(const uint8_t* data, size_t size) { diff --git a/system/stack/gap/gap_ble.cc b/system/stack/gap/gap_ble.cc index 3b55c031ca..9f09ce4b44 100644 --- a/system/stack/gap/gap_ble.cc +++ b/system/stack/gap/gap_ble.cc @@ -28,6 +28,7 @@ #include "stack/include/bt_types.h" #include "stack/include/bt_uuid16.h" #include "stack/include/btm_client_interface.h" +#include "stack/include/btm_status.h" #include "types/bluetooth/uuid.h" #include "types/bt_transport.h" #include "types/raw_address.h" @@ -143,7 +144,7 @@ tGATT_STATUS read_attr_value(uint16_t handle, tGATT_VALUE* p_value, bool is_long switch (db_attr.uuid) { case GATT_UUID_GAP_DEVICE_NAME: if (get_btm_client_interface().local.BTM_ReadLocalDeviceName((const char**)&p_dev_name) != - BTM_SUCCESS) { + tBTM_STATUS::BTM_SUCCESS) { log::warn("Unable to read local device name"); }; if (strlen((char*)p_dev_name) > GATT_MAX_ATTR_LEN) { @@ -514,7 +515,7 @@ void GAP_BleAttrDBUpdate(uint16_t attr_uuid, tGAP_BLE_ATTR_VALUE* p_value) { case GATT_UUID_GAP_DEVICE_NAME: if (get_btm_client_interface().local.BTM_SetLocalDeviceName( - (const char*)p_value->p_dev_name) != BTM_SUCCESS) { + (const char*)p_value->p_dev_name) != tBTM_STATUS::BTM_SUCCESS) { log::warn("Unable to set local name"); } break; diff --git a/system/stack/gap/gap_conn.cc b/system/stack/gap/gap_conn.cc index 653e721477..7bda480ff9 100644 --- a/system/stack/gap/gap_conn.cc +++ b/system/stack/gap/gap_conn.cc @@ -31,6 +31,7 @@ #include "osi/include/mutex.h" #include "stack/btm/btm_sec.h" #include "stack/include/bt_hdr.h" +#include "stack/include/btm_client_interface.h" #include "types/raw_address.h" using namespace bluetooth; @@ -103,8 +104,6 @@ static tGAP_CCB* gap_allocate_ccb(void); static void gap_release_ccb(tGAP_CCB* p_ccb); static void gap_checks_con_flags(tGAP_CCB* p_ccb); -bool BTM_UseLeLink(const RawAddress& bd_addr); - /******************************************************************************* * * Function gap_conn_init @@ -622,7 +621,7 @@ static void gap_connect_ind(const RawAddress& bd_addr, uint16_t l2cap_cid, uint1 log::warn("*******"); /* Disconnect because it is an unexpected connection */ - if (BTM_UseLeLink(bd_addr)) { + if (get_btm_client_interface().ble.BTM_UseLeLink(bd_addr)) { if (!L2CA_DisconnectLECocReq(l2cap_cid)) { log::warn("Unable to request L2CAP disconnect le_coc peer:{} cid:{}", bd_addr, l2cap_cid); } diff --git a/system/stack/gatt/gatt_api.cc b/system/stack/gatt/gatt_api.cc index c6ea0cf5b0..6c02eda245 100644 --- a/system/stack/gatt/gatt_api.cc +++ b/system/stack/gatt/gatt_api.cc @@ -41,8 +41,10 @@ #include "stack/btm/btm_dev.h" #include "stack/gatt/connection_manager.h" #include "stack/gatt/gatt_int.h" +#include "stack/include/ais_api.h" #include "stack/include/bt_hdr.h" #include "stack/include/bt_uuid16.h" +#include "stack/include/btm_client_interface.h" #include "stack/include/l2cap_acl_interface.h" #include "stack/include/l2cdefs.h" #include "stack/include/sdp_api.h" @@ -323,8 +325,10 @@ tGATT_STATUS GATTS_AddService(tGATT_IF gatt_if, btgatt_db_element_t* service, in Uuid* p_uuid = gatts_get_service_uuid(elem.p_db); if (*p_uuid != Uuid::From16Bit(UUID_SERVCLASS_GMCS_SERVER) && *p_uuid != Uuid::From16Bit(UUID_SERVCLASS_GTBS_SERVER)) { - if (com::android::bluetooth::flags::channel_sounding_in_stack() && - *p_uuid == Uuid::From16Bit(UUID_SERVCLASS_RAS)) { + if ((com::android::bluetooth::flags::channel_sounding_in_stack() && + *p_uuid == Uuid::From16Bit(UUID_SERVCLASS_RAS)) || + (com::android::bluetooth::flags::android_os_identifier() && + *p_uuid == ANDROID_INFORMATION_SERVICE_UUID)) { elem.sdp_handle = 0; } else { elem.sdp_handle = gatt_add_sdp_record(*p_uuid, elem.s_hdl, elem.e_hdl); @@ -840,7 +844,9 @@ void GATTC_UpdateUserAttMtuIfNeeded(const RawAddress& remote_bda, tBT_TRANSPORT } p_tcb->max_user_mtu = user_mtu; - BTM_SetBleDataLength(remote_bda, user_mtu); + if (get_btm_client_interface().ble.BTM_SetBleDataLength(remote_bda, user_mtu) != BTM_SUCCESS) { + log::warn("Unable to set ble data length peer:{} mtu:{}", remote_bda, user_mtu); + } } std::list<uint16_t> GATTC_GetAndRemoveListOfConnIdsWaitingForMtuRequest( diff --git a/system/stack/gatt/gatt_auth.cc b/system/stack/gatt/gatt_auth.cc index 8b893e2354..7ed047b8eb 100644 --- a/system/stack/gatt/gatt_auth.cc +++ b/system/stack/gatt/gatt_auth.cc @@ -36,6 +36,7 @@ #include "stack/include/bt_hdr.h" #include "stack/include/bt_types.h" #include "stack/include/btm_ble_sec_api.h" +#include "stack/include/btm_status.h" #include "types/raw_address.h" using namespace bluetooth; @@ -175,7 +176,7 @@ static void gatt_enc_cmpl_cback(RawAddress bd_addr, tBT_TRANSPORT transport, voi if (p_clcb != NULL) { bool status = false; - if (result == BTM_SUCCESS) { + if (result == tBTM_STATUS::BTM_SUCCESS) { if (gatt_get_sec_act(p_tcb) == GATT_SEC_ENCRYPT_MITM) { status = BTM_IsLinkKeyAuthed(bd_addr, transport); } else { @@ -432,7 +433,8 @@ bool gatt_security_check_start(tGATT_CLCB* p_clcb) { gatt_convert_sec_action(gatt_sec_act, &btm_ble_sec_act); tBTM_STATUS btm_status = BTM_SetEncryption(p_tcb->peer_bda, p_tcb->transport, gatt_enc_cmpl_cback, NULL, btm_ble_sec_act); - if ((btm_status != BTM_SUCCESS) && (btm_status != BTM_CMD_STARTED)) { + if ((btm_status != tBTM_STATUS::BTM_SUCCESS) && + (btm_status != tBTM_STATUS::BTM_CMD_STARTED)) { log::error("BTM_SetEncryption failed btm_status={}", btm_status); gatt_set_sec_act(p_tcb, GATT_SEC_NONE); gatt_set_ch_state(p_tcb, GATT_CH_OPEN); diff --git a/system/stack/gatt/gatt_cl.cc b/system/stack/gatt/gatt_cl.cc index 9d4577eda1..71b1ac42c3 100644 --- a/system/stack/gatt/gatt_cl.cc +++ b/system/stack/gatt/gatt_cl.cc @@ -31,13 +31,11 @@ #include "gatt_int.h" #include "hardware/bt_gatt_types.h" #include "internal_include/bt_target.h" -#include "internal_include/bt_trace.h" -#include "os/log.h" #include "osi/include/allocator.h" -#include "osi/include/osi.h" #include "stack/arbiter/acl_arbiter.h" #include "stack/eatt/eatt.h" #include "stack/include/bt_types.h" +#include "stack/include/btm_client_interface.h" #include "types/bluetooth/uuid.h" #define GATT_WRITE_LONG_HDR_SIZE 5 /* 1 opcode + 2 handle + 2 offset */ @@ -1127,7 +1125,11 @@ void gatt_process_mtu_rsp(tGATT_TCB& tcb, tGATT_CLCB* p_clcb, uint16_t len, uint log::info("MTU Exchange resulted in: {}", tcb.payload_size); - BTM_SetBleDataLength(tcb.peer_bda, tcb.max_user_mtu + L2CAP_PKT_OVERHEAD); + if (get_btm_client_interface().ble.BTM_SetBleDataLength( + tcb.peer_bda, tcb.max_user_mtu + L2CAP_PKT_OVERHEAD) != BTM_SUCCESS) { + log::warn("Unable to set BLE data length peer:{} mtu:{}", tcb.peer_bda, + tcb.max_user_mtu + L2CAP_PKT_OVERHEAD); + } } gatt_end_operation(p_clcb, status, NULL); diff --git a/system/stack/gatt/gatt_main.cc b/system/stack/gatt/gatt_main.cc index f8d6406610..aff993a9f2 100644 --- a/system/stack/gatt/gatt_main.cc +++ b/system/stack/gatt/gatt_main.cc @@ -294,7 +294,6 @@ bool gatt_disconnect(tGATT_TCB* p_tcb) { tGATT_CH_STATE ch_state = gatt_get_ch_state(p_tcb); if (ch_state == GATT_CH_CLOSING) { log::debug("Device already in closing state peer:{}", p_tcb->peer_bda); - log::verbose("already in closing state"); return true; } diff --git a/system/stack/gatt/gatt_sr.cc b/system/stack/gatt/gatt_sr.cc index c85949f02e..87dac2121a 100644 --- a/system/stack/gatt/gatt_sr.cc +++ b/system/stack/gatt/gatt_sr.cc @@ -37,6 +37,7 @@ #include "stack/eatt/eatt.h" #include "stack/include/bt_hdr.h" #include "stack/include/bt_types.h" +#include "stack/include/btm_client_interface.h" #include "stack/include/l2cdefs.h" #include "types/bluetooth/uuid.h" @@ -869,7 +870,11 @@ static void gatts_process_mtu_req(tGATT_TCB& tcb, uint16_t cid, uint16_t len, ui log::info("MTU {} request from remote ({}), resulted MTU {}", mtu, tcb.peer_bda, tcb.payload_size); - BTM_SetBleDataLength(tcb.peer_bda, tcb.payload_size + L2CAP_PKT_OVERHEAD); + if (get_btm_client_interface().ble.BTM_SetBleDataLength( + tcb.peer_bda, tcb.payload_size + L2CAP_PKT_OVERHEAD) != BTM_SUCCESS) { + log::warn("Unable to set BLE data length peer:{} mtu:{}", tcb.peer_bda, + tcb.payload_size + L2CAP_PKT_OVERHEAD); + } BT_HDR* p_buf = attp_build_sr_msg(tcb, GATT_RSP_MTU, &gatt_sr_msg, GATT_DEF_BLE_MTU_SIZE); attp_send_sr_msg(tcb, cid, p_buf); diff --git a/system/stack/gatt/gatt_utils.cc b/system/stack/gatt/gatt_utils.cc index ef3b888e04..f1bb8afcb0 100644 --- a/system/stack/gatt/gatt_utils.cc +++ b/system/stack/gatt/gatt_utils.cc @@ -758,10 +758,10 @@ void gatt_rsp_timeout(void* data) { auto eatt_channel = EattExtension::GetInstance()->FindEattChannelByCid(p_clcb->p_tcb->peer_bda, p_clcb->cid); if (eatt_channel) { - log::warn("disconnecting EATT cid: {}", p_clcb->cid); + log::warn("conn_id: 0x{:04x} disconnecting EATT cid: {}", p_clcb->conn_id, p_clcb->cid); EattExtension::GetInstance()->Disconnect(p_clcb->p_tcb->peer_bda, p_clcb->cid); } else { - log::warn("disconnecting GATT..."); + log::warn("conn_id: 0x{:04x} disconnecting GATT...", p_clcb->conn_id); gatt_disconnect(p_clcb->p_tcb); } } @@ -801,7 +801,7 @@ void gatt_indication_confirmation_timeout(void* data) { return; } - log::warn("disconnecting..."); + log::warn("disconnecting... bda:{} transport:{}", p_tcb->peer_bda, p_tcb->transport); gatt_disconnect(p_tcb); } diff --git a/system/stack/hid/hidd_conn.cc b/system/stack/hid/hidd_conn.cc index 2a1521cf92..8a24dd4e05 100644 --- a/system/stack/hid/hidd_conn.cc +++ b/system/stack/hid/hidd_conn.cc @@ -106,7 +106,7 @@ static void hidd_check_config_done() { * ******************************************************************************/ static void hidd_l2cif_connect_ind(const RawAddress& bd_addr, uint16_t cid, uint16_t psm, - uint8_t id) { + uint8_t /* id */) { tHID_DEV_DEV_CTB* p_dev; bool accept = TRUE; // accept by default @@ -180,7 +180,7 @@ static void hidd_l2cif_connect_ind(const RawAddress& bd_addr, uint16_t cid, uint p_hcon->intr_cid = cid; } -static void hidd_on_l2cap_error(uint16_t lcid, uint16_t result) { +static void hidd_on_l2cap_error(uint16_t /* lcid */, uint16_t result) { log::warn("connection of config failed, now disconnect"); hidd_conn_disconnect(); @@ -267,7 +267,7 @@ static void hidd_l2cif_config_ind(uint16_t cid, tL2CAP_CFG_INFO* p_cfg) { * Returns void * ******************************************************************************/ -static void hidd_l2cif_config_cfm(uint16_t cid, uint16_t initiator, tL2CAP_CFG_INFO* p_cfg) { +static void hidd_l2cif_config_cfm(uint16_t cid, uint16_t /* initiator */, tL2CAP_CFG_INFO* p_cfg) { hidd_l2cif_config_ind(cid, p_cfg); log::verbose("cid={:04x}", cid); diff --git a/system/stack/hid/hidh_api.cc b/system/stack/hid/hidh_api.cc index 7090a837dc..d61bc06bdf 100644 --- a/system/stack/hid/hidh_api.cc +++ b/system/stack/hid/hidh_api.cc @@ -110,7 +110,7 @@ void hidh_get_str_attr(tSDP_DISC_REC* p_rec, uint16_t attr_id, uint16_t max_len, } } -static void hidh_search_callback(const RawAddress& /* bd_addr */, tSDP_RESULT sdp_result) { +static void hidh_search_callback(const RawAddress& bd_addr, tSDP_RESULT sdp_result) { tSDP_DISCOVERY_DB* p_db = hh_cb.p_sdp_db; tSDP_DISC_REC* p_rec; tSDP_DISC_ATTR *p_attr, *p_subattr1, *p_subattr2, *p_repdesc; @@ -119,15 +119,15 @@ static void hidh_search_callback(const RawAddress& /* bd_addr */, tSDP_RESULT sd hh_cb.sdp_busy = false; - if (sdp_result != SDP_SUCCESS) { - hh_cb.sdp_cback(sdp_result, 0, NULL); + if (sdp_result != tSDP_STATUS::SDP_SUCCESS) { + hh_cb.sdp_cback(bd_addr, sdp_result, 0, NULL); return; } Uuid hid_uuid = Uuid::From16Bit(UUID_SERVCLASS_HUMAN_INTERFACE); p_rec = get_legacy_stack_sdp_api()->db.SDP_FindServiceUUIDInDb(p_db, hid_uuid, NULL); if (p_rec == NULL) { - hh_cb.sdp_cback(HID_SDP_NO_SERV_UUID, 0, NULL); + hh_cb.sdp_cback(bd_addr, tSDP_STATUS::HID_SDP_NO_SERV_UUID, 0, NULL); return; } @@ -142,7 +142,7 @@ static void hidh_search_callback(const RawAddress& /* bd_addr */, tSDP_RESULT sd ((p_subattr2 = p_subattr1->attr_value.v.p_sub_attr) == NULL) || ((p_repdesc = p_subattr2->p_next_attr) == NULL) || (SDP_DISC_ATTR_TYPE(p_repdesc->attr_len_type) != TEXT_STR_DESC_TYPE)) { - hh_cb.sdp_cback(HID_SDP_MANDATORY_MISSING, 0, NULL); + hh_cb.sdp_cback(bd_addr, tSDP_STATUS::HID_SDP_MANDATORY_MISSING, 0, NULL); return; } @@ -255,7 +255,7 @@ static void hidh_search_callback(const RawAddress& /* bd_addr */, tSDP_RESULT sd } hh_cb.sdp_rec.p_sdp_layer_rec = p_rec; - hh_cb.sdp_cback(SDP_SUCCESS, attr_mask, &hh_cb.sdp_rec); + hh_cb.sdp_cback(bd_addr, tSDP_STATUS::SDP_SUCCESS, attr_mask, &hh_cb.sdp_rec); } /******************************************************************************* diff --git a/system/stack/hid/hidh_conn.cc b/system/stack/hid/hidh_conn.cc index dc43555c1a..159bf46cf6 100644 --- a/system/stack/hid/hidh_conn.cc +++ b/system/stack/hid/hidh_conn.cc @@ -177,7 +177,7 @@ tHID_STATUS hidh_conn_disconnect(uint8_t dhandle) { * ******************************************************************************/ static void hidh_l2cif_connect_ind(const RawAddress& bd_addr, uint16_t l2cap_cid, uint16_t psm, - uint8_t l2cap_id) { + uint8_t /* l2cap_id */) { bool bAccept = true; uint8_t i = kHID_HOST_MAX_DEVICES; @@ -402,7 +402,8 @@ static void hidh_l2cif_config_ind(uint16_t l2cap_cid, tL2CAP_CFG_INFO* p_cfg) { * Returns void * ******************************************************************************/ -static void hidh_l2cif_config_cfm(uint16_t l2cap_cid, uint16_t initiator, tL2CAP_CFG_INFO* p_cfg) { +static void hidh_l2cif_config_cfm(uint16_t l2cap_cid, uint16_t /* initiator */, + tL2CAP_CFG_INFO* p_cfg) { hidh_l2cif_config_ind(l2cap_cid, p_cfg); uint8_t dhandle; diff --git a/system/stack/include/a2dp_ext.h b/system/stack/include/a2dp_ext.h index 9987d662dd..ecada4bee7 100644 --- a/system/stack/include/a2dp_ext.h +++ b/system/stack/include/a2dp_ext.h @@ -41,7 +41,7 @@ public: return vendor_specific_parameters_; } - void setVendorSpecificParameters(std::vector<uint8_t> const& parameters) {} + void setVendorSpecificParameters(std::vector<uint8_t> const& /* parameters */) {} void setCodecConfig(btav_a2dp_codec_config_t codec_parameters, uint8_t const codec_config[AVDT_CODEC_SIZE], diff --git a/system/stack/include/acl_api.h b/system/stack/include/acl_api.h index 850c396647..da657c5550 100644 --- a/system/stack/include/acl_api.h +++ b/system/stack/include/acl_api.h @@ -51,7 +51,7 @@ void BTM_acl_after_controller_started(); * * Description Create and send HCI "Write Link Supervision Timeout" command * - * Returns BTM_CMD_STARTED if successfully initiated, otherwise error + * Returns tBTM_STATUS::BTM_CMD_STARTED if successfully initiated, otherwise error * ******************************************************************************/ tBTM_STATUS BTM_SetLinkSuperTout(const RawAddress& remote_bda, uint16_t timeout); @@ -88,7 +88,7 @@ bool BTM_IsAclConnectionUpAndHandleValid(const RawAddress& remote_bda, tBT_TRANS * Description This function is called to get the role of the local device * for the ACL connection with the specified remote device * - * Returns BTM_SUCCESS if connection exists. + * Returns tBTM_STATUS::BTM_SUCCESS if connection exists. * BTM_UNKNOWN_ADDR if no active link with bd addr specified * ******************************************************************************/ @@ -101,8 +101,8 @@ tBTM_STATUS BTM_GetRole(const RawAddress& remote_bd_addr, tHCI_ROLE* p_role); * Description This function is called to switch role between central and * peripheral. If role is already set it will do nothing. * - * Returns BTM_SUCCESS if already in specified role. - * BTM_CMD_STARTED if command issued to controller. + * Returns tBTM_STATUS::BTM_SUCCESS if already in specified role. + * tBTM_STATUS::BTM_CMD_STARTED if command issued to controller. * BTM_NO_RESOURCES if memory couldn't be allocated to issue * the command * BTM_UNKNOWN_ADDR if no active link with bd addr specified @@ -120,11 +120,12 @@ tBTM_STATUS BTM_SwitchRoleToCentral(const RawAddress& remote_bd_addr); * The address of link policy results are returned in the * callback. (tBTM_RSSI_RESULT) * - * Returns BTM_CMD_STARTED if command issued to controller. + * Returns tBTM_STATUS::BTM_CMD_STARTED if command issued to controller. * BTM_NO_RESOURCES if memory couldn't be allocated to issue * the command * BTM_UNKNOWN_ADDR if no active link with bd addr specified - * BTM_BUSY if command is already in progress + * tBTM_STATUS::BTM_BUSY if command is already in progress + * BTM_UNKNOWN_ADDR if no active link with bd addr specified * ******************************************************************************/ tBTM_STATUS BTM_ReadRSSI(const RawAddress& remote_bda, tBTM_CMPL_CB* p_cb); @@ -137,11 +138,12 @@ tBTM_STATUS BTM_ReadRSSI(const RawAddress& remote_bda, tBTM_CMPL_CB* p_cb); * The result is returned in the callback. * (tBTM_FAILED_CONTACT_COUNTER_RESULT) * - * Returns BTM_CMD_STARTED if command issued to controller. + * Returns tBTM_STATUS::BTM_CMD_STARTED if command issued to controller. * BTM_NO_RESOURCES if memory couldn't be allocated to issue * the command * BTM_UNKNOWN_ADDR if no active link with bd addr specified - * BTM_BUSY if command is already in progress + * tBTM_STATUS::BTM_BUSY if command is already in progress + * BTM_UNKNOWN_ADDR if no active link with bd addr specified * ******************************************************************************/ tBTM_STATUS BTM_ReadFailedContactCounter(const RawAddress& remote_bda, tBTM_CMPL_CB* p_cb); @@ -155,11 +157,11 @@ tBTM_STATUS BTM_ReadFailedContactCounter(const RawAddress& remote_bda, tBTM_CMPL * are returned in the callback. * (tBTM_RSSI_RESULT) * - * Returns BTM_CMD_STARTED if command issued to controller. + * Returns tBTM_STATUS::BTM_CMD_STARTED if command issued to controller. * BTM_NO_RESOURCES if memory couldn't be allocated to issue * the command * BTM_UNKNOWN_ADDR if no active link with bd addr specified - * BTM_BUSY if command is already in progress + * tBTM_STATUS::BTM_BUSY if command is already in progress * ******************************************************************************/ tBTM_STATUS BTM_ReadTxPower(const RawAddress& remote_bda, tBT_TRANSPORT transport, @@ -262,7 +264,7 @@ void btm_acl_notif_conn_collision(const RawAddress& bda); * BTM_ACL_MODE_HOLD * BTM_ACL_MODE_SNIFF * BTM_ACL_MODE_PARK - * (valid only if return code is BTM_SUCCESS) + * (valid only if return code is tBTM_STATUS::BTM_SUCCESS) * * Returns true if successful, false otherwise. * diff --git a/system/stack/include/ais_api.h b/system/stack/include/ais_api.h new file mode 100644 index 0000000000..41dad8242b --- /dev/null +++ b/system/stack/include/ais_api.h @@ -0,0 +1,43 @@ +/****************************************************************************** + * + * Copyright 2024 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + ******************************************************************************/ +#ifndef SYSTEM_STACK_INCLUDE_AIS_API_H_ +#define SYSTEM_STACK_INCLUDE_AIS_API_H_ + +#include "types/bluetooth/uuid.h" + +#define ANDROID_INFORMATION_SERVICE_UUID_STRING "e73e0001-ef1b-4e74-8291-2e4f3164f3b5" +/* Android Information Service characteristic */ +#define GATT_UUID_AIS_API_LEVEL_STRING "e73e0002-ef1b-4e74-8291-2e4f3164f3b5" + +extern const bluetooth::Uuid ANDROID_INFORMATION_SERVICE_UUID; +extern const bluetooth::Uuid GATT_UUID_AIS_API_LEVEL; + +/******************************************************************************* + * + * Function AIS_Init + * + * Description Initializes the control blocks used by AIS. + * This routine should not be called except once per + * stack invocation. + * + * Returns Nothing + * + ******************************************************************************/ +void AIS_Init(void); + +#endif // SYSTEM_STACK_INCLUDE_AIS_API_H_ diff --git a/system/stack/include/bt_name.h b/system/stack/include/bt_name.h index 2972bc74ca..c9749f0f72 100644 --- a/system/stack/include/bt_name.h +++ b/system/stack/include/bt_name.h @@ -26,7 +26,6 @@ typedef uint8_t BD_NAME[BD_NAME_LEN + 1]; /* Device name */ inline constexpr BD_NAME kBtmBdNameEmpty = {}; constexpr size_t kBdNameLength = static_cast<size_t>(BD_NAME_LEN); -constexpr uint8_t kBdNameDelim = (uint8_t)'\0'; inline size_t bd_name_copy(BD_NAME bd_name_dest, const BD_NAME bd_name_src) { return strlcpy(reinterpret_cast<char*>(bd_name_dest), reinterpret_cast<const char*>(bd_name_src), diff --git a/system/stack/include/btm_api.h b/system/stack/include/btm_api.h index c54abd7061..c9953cb2a8 100644 --- a/system/stack/include/btm_api.h +++ b/system/stack/include/btm_api.h @@ -68,7 +68,7 @@ void BTM_reset_complete(); * * Description This function is called to set the local device name. * - * Returns BTM_CMD_STARTED if successful, otherwise an error + * Returns tBTM_STATUS::BTM_CMD_STARTED if successful, otherwise an error * ******************************************************************************/ [[nodiscard]] tBTM_STATUS BTM_SetLocalDeviceName(const char* p_name); @@ -79,7 +79,7 @@ void BTM_reset_complete(); * * Description This function is called to set the local device class * - * Returns BTM_SUCCESS if successful, otherwise an error + * Returns tBTM_STATUS::BTM_SUCCESS if successful, otherwise an error * ******************************************************************************/ [[nodiscard]] tBTM_STATUS BTM_SetDeviceClass(DEV_CLASS dev_class); @@ -91,7 +91,7 @@ void BTM_reset_complete(); * Description This function is called to read the local device name. * * Returns status of the operation - * If success, BTM_SUCCESS is returned and p_name points stored + * If success, tBTM_STATUS::BTM_SUCCESS is returned and p_name points stored * local device name * If BTM doesn't store local device name, BTM_NO_RESOURCES is * is returned and p_name is set to NULL @@ -106,7 +106,7 @@ void BTM_reset_complete(); * Description Get local device name from controller. Do not use cached * name (used to get chip-id prior to btm reset complete). * - * Returns BTM_CMD_STARTED if successful, otherwise an error + * Returns tBTM_STATUS::BTM_CMD_STARTED if successful, otherwise an error * ******************************************************************************/ [[nodiscard]] tBTM_STATUS BTM_ReadLocalDeviceNameFromController(tBTM_CMPL_CB* p_rln_cmpl_cback); @@ -161,7 +161,7 @@ void BTM_WriteVoiceSettings(uint16_t settings); * resetting the controller. * * Returns - * BTM_SUCCESS Command sent. + * tBTM_STATUS::BTM_SUCCESS Command sent. * BTM_NO_RESOURCES If out of resources to send the command. * * @@ -178,14 +178,14 @@ void BTM_WriteVoiceSettings(uint16_t settings); * * Input Params: remote_bda - device address of name to retrieve * p_cb - callback function called when - * BTM_CMD_STARTED is returned. + * tBTM_STATUS::BTM_CMD_STARTED is returned. * A pointer to tBTM_REMOTE_DEV_NAME is * passed to the callback. * * Returns - * BTM_CMD_STARTED is returned if the request was successfully + * tBTM_STATUS::BTM_CMD_STARTED is returned if the request was successfully * sent to HCI. - * BTM_BUSY if already in progress + * tBTM_STATUS::BTM_BUSY if already in progress * BTM_UNKNOWN_ADDR if device address is bad * BTM_NO_RESOURCES if resources could not be allocated to * start the command @@ -206,7 +206,7 @@ void BTM_WriteVoiceSettings(uint16_t settings); * Input Params: None * * Returns - * BTM_CMD_STARTED is returned if the request was successfully + * tBTM_STATUS::BTM_CMD_STARTED is returned if the request was successfully * sent to HCI. * BTM_NO_RESOURCES if resources could not be allocated to * start the command @@ -302,8 +302,8 @@ void BTM_WriteVoiceSettings(uint16_t settings); * Parameter p_bda - (input) BD_ADDR -> Address of device to clear * (NULL clears all entries) * - * Returns BTM_BUSY if an inquiry, get remote name, or event filter - * is active, otherwise BTM_SUCCESS + * Returns tBTM_STATUS::BTM_BUSY if an inquiry, get remote name, or event filter + * is active, otherwise tBTM_STATUS::BTM_SUCCESS * ******************************************************************************/ [[nodiscard]] tBTM_STATUS BTM_ClearInqDb(const RawAddress* p_bda); @@ -320,10 +320,10 @@ void BTM_WriteVoiceSettings(uint16_t settings); * otherwise BTM will wait for the other side to connect. * * Returns BTM_UNKNOWN_ADDR if the ACL connection is not up - * BTM_BUSY if another SCO being set up to + * tBTM_STATUS::BTM_BUSY if another SCO being set up to * the same BD address * BTM_NO_RESOURCES if the max SCO limit has been reached - * BTM_CMD_STARTED if the connection establishment is started. + * tBTM_STATUS::BTM_CMD_STARTED if the connection establishment is started. * In this case, "*p_sco_inx" is filled in * with the sco index used for the connection. * @@ -338,11 +338,23 @@ void BTM_WriteVoiceSettings(uint16_t settings); * * Description This function is called to remove a specific SCO connection. * - * Returns BTM_CMD_STARTED if successfully initiated, otherwise error + * Returns tBTM_STATUS::BTM_CMD_STARTED if successfully initiated, otherwise error * ******************************************************************************/ [[nodiscard]] tBTM_STATUS BTM_RemoveSco(uint16_t sco_inx); -void BTM_RemoveSco(const RawAddress& bda); + +/******************************************************************************* + * + * Function BTM_RemoveScoByBdaddr + * + * Description This function is called to remove a specific SCO connection. + * but using the bluetooth device addess typically used + * for ACL termination. + * + * Returns void + * + ******************************************************************************/ +void BTM_RemoveScoByBdaddr(const RawAddress& bda); /******************************************************************************* * @@ -365,8 +377,8 @@ void BTM_RemoveSco(const RawAddress& bda); * BTM_CreateSco. It can be called only when there are no * active (e)SCO links. * - * Returns BTM_SUCCESS if the successful. - * BTM_BUSY if there are one or more active (e)SCO links. + * Returns tBTM_STATUS::BTM_SUCCESS if the successful. + * tBTM_STATUS::BTM_BUSY if there are one or more active (e)SCO links. * ******************************************************************************/ [[nodiscard]] tBTM_STATUS BTM_SetEScoMode(enh_esco_params_t* p_parms); @@ -380,7 +392,7 @@ void BTM_RemoveSco(const RawAddress& bda); * connection indication events and change of link parameter * events. * - * Returns BTM_SUCCESS if the successful. + * Returns tBTM_STATUS::BTM_SUCCESS if the successful. * BTM_ILLEGAL_VALUE if there is an illegal sco_inx * ******************************************************************************/ @@ -500,7 +512,7 @@ void BTM_RequestPeerSCA(const RawAddress& remote_bda, tBT_TRANSPORT transport); * Parameters p_buff - allocated HCI command buffer including extended * inquriry response * - * Returns BTM_SUCCESS - if successful + * Returns tBTM_STATUS::BTM_SUCCESS - if successful * BTM_MODE_UNSUPPORTED - if local device cannot support it * ******************************************************************************/ diff --git a/system/stack/include/btm_ble_api.h b/system/stack/include/btm_ble_api.h index 78c2a8bbde..689c8f9be3 100644 --- a/system/stack/include/btm_ble_api.h +++ b/system/stack/include/btm_ble_api.h @@ -309,7 +309,7 @@ tBTM_STATUS BTM_BleGetEnergyInfo(tBTM_BLE_ENERGY_INFO_CBACK* p_ener_cback); * * Description Set the maximum BLE transmission packet size * - * Returns BTM_SUCCESS if success; otherwise failed. + * Returns tBTM_STATUS::BTM_SUCCESS if success; otherwise failed. * ******************************************************************************/ tBTM_STATUS BTM_SetBleDataLength(const RawAddress& bd_addr, uint16_t tx_pdu_length); @@ -321,7 +321,7 @@ tBTM_STATUS BTM_SetBleDataLength(const RawAddress& bd_addr, uint16_t tx_pdu_leng * Description To read the current PHYs for specified LE connection * * - * Returns BTM_SUCCESS if success; otherwise failed. + * Returns tBTM_STATUS::BTM_SUCCESS if success; otherwise failed. * ******************************************************************************/ void BTM_BleReadPhy(const RawAddress& bd_addr, @@ -334,7 +334,7 @@ void BTM_BleReadPhy(const RawAddress& bd_addr, * Description To set PHY preferences for specified LE connection * * - * Returns BTM_SUCCESS if success; otherwise failed. + * Returns tBTM_STATUS::BTM_SUCCESS if success; otherwise failed. * ******************************************************************************/ void BTM_BleSetPhy(const RawAddress& bd_addr, uint8_t tx_phys, uint8_t rx_phys, diff --git a/system/stack/include/btm_ble_sec_api.h b/system/stack/include/btm_ble_sec_api.h index 6af16a9eb2..a25a0f3ba6 100644 --- a/system/stack/include/btm_ble_sec_api.h +++ b/system/stack/include/btm_ble_sec_api.h @@ -77,14 +77,14 @@ const Octet16& BTM_GetDeviceDHK(); * Description This function is called to grant security process. * * Parameters bd_addr - peer device bd address. - * res - result of the operation BTM_SUCCESS if success. + * res - result of the operation tBTM_STATUS::BTM_SUCCESS if success. * Otherwise, BTM_REPEATED_ATTEMPTS is too many * attempts. * * Returns None * ******************************************************************************/ -void BTM_SecurityGrant(const RawAddress& bd_addr, uint8_t res); +void BTM_SecurityGrant(const RawAddress& bd_addr, tBTM_STATUS res); /******************************************************************************* * @@ -101,7 +101,7 @@ void BTM_SecurityGrant(const RawAddress& bd_addr, uint8_t res); * BTM_MAX_PASSKEY_VAL(999999(0xF423F)). * ******************************************************************************/ -void BTM_BlePasskeyReply(const RawAddress& bd_addr, uint8_t res, uint32_t passkey); +void BTM_BlePasskeyReply(const RawAddress& bd_addr, tBTM_STATUS res, uint32_t passkey); /******************************************************************************* * @@ -112,10 +112,10 @@ void BTM_BlePasskeyReply(const RawAddress& bd_addr, uint8_t res, uint32_t passke * * Parameters: bd_addr - Address of the device with which numeric * comparison was requested - * res - comparison result BTM_SUCCESS if success + * res - comparison result tBTM_STATUS::BTM_SUCCESS if success * ******************************************************************************/ -void BTM_BleConfirmReply(const RawAddress& bd_addr, uint8_t res); +void BTM_BleConfirmReply(const RawAddress& bd_addr, tBTM_STATUS res); /******************************************************************************* * @@ -129,7 +129,7 @@ void BTM_BleConfirmReply(const RawAddress& bd_addr, uint8_t res); * p_data - simple pairing Randomizer C. * ******************************************************************************/ -void BTM_BleOobDataReply(const RawAddress& bd_addr, uint8_t res, uint8_t len, uint8_t* p_data); +void BTM_BleOobDataReply(const RawAddress& bd_addr, tBTM_STATUS res, uint8_t len, uint8_t* p_data); /******************************************************************************* * diff --git a/system/stack/include/btm_ble_sec_api_types.h b/system/stack/include/btm_ble_sec_api_types.h index 4540877b82..d53b628f26 100644 --- a/system/stack/include/btm_ble_sec_api_types.h +++ b/system/stack/include/btm_ble_sec_api_types.h @@ -22,6 +22,7 @@ #include "stack/include/bt_octets.h" #include "stack/include/btm_sec_api_types.h" +#include "stack/include/btm_status.h" ////////////////////////////////////////////////////////// ////// from btm_ble_api_types.h @@ -95,8 +96,8 @@ typedef union { /* Simple Pairing Events. Called by the stack when Simple Pairing related * events occur. */ -typedef uint8_t(tBTM_LE_CALLBACK)(tBTM_LE_EVT event, const RawAddress& bda, - tBTM_LE_EVT_DATA* p_data); +typedef tBTM_STATUS(tBTM_LE_CALLBACK)(tBTM_LE_EVT event, const RawAddress& bda, + tBTM_LE_EVT_DATA* p_data); #define BTM_BLE_KEY_TYPE_ID 1 #define BTM_BLE_KEY_TYPE_ER 2 diff --git a/system/stack/include/btm_client_interface.h b/system/stack/include/btm_client_interface.h index fe1ade108e..0de83ffac6 100644 --- a/system/stack/include/btm_client_interface.h +++ b/system/stack/include/btm_client_interface.h @@ -117,6 +117,7 @@ struct btm_client_interface_t { [[nodiscard]] tBTM_STATUS (*BTM_RegForEScoEvts)(uint16_t sco_inx, tBTM_ESCO_CBACK* p_esco_cback); [[nodiscard]] tBTM_STATUS (*BTM_RemoveSco)(uint16_t sco_inx); + void (*BTM_RemoveScoByBdaddr)(const RawAddress& bda); void (*BTM_WriteVoiceSettings)(uint16_t settings); void (*BTM_EScoConnRsp)(uint16_t sco_inx, tHCI_STATUS hci_status, enh_esco_params_t* p_parms); [[nodiscard]] uint8_t (*BTM_GetNumScoLinks)(); diff --git a/system/stack/include/btm_inq.h b/system/stack/include/btm_inq.h index 40a8f5b29c..05dd106975 100644 --- a/system/stack/include/btm_inq.h +++ b/system/stack/include/btm_inq.h @@ -31,8 +31,8 @@ * scans are enabled. If a value of '0' is entered for window * or interval, the default values are used. * - * Returns BTM_SUCCESS if successful - * BTM_BUSY if a setting of the filter is already in progress + * Returns tBTM_STATUS::BTM_SUCCESS if successful + * tBTM_STATUS::BTM_BUSY if a setting of the filter is already in progress * BTM_NO_RESOURCES if couldn't get a memory pool buffer * BTM_ILLEGAL_VALUE if a bad parameter was detected * BTM_WRONG_MODE if the device is not up. @@ -66,8 +66,8 @@ * NULL, the application is not notified when * completed. * Returns tBTM_STATUS - * BTM_CMD_STARTED if successfully initiated - * BTM_BUSY if already in progress + * tBTM_STATUS::BTM_CMD_STARTED if successfully initiated + * tBTM_STATUS::BTM_BUSY if already in progress * BTM_ILLEGAL_VALUE if parameter(s) are out of range * BTM_NO_RESOURCES if could not allocate resources to start * the command @@ -105,7 +105,7 @@ void BTM_CancelInquiry(void); * connectable mode. Discoverable mode means page scans are * enabled. * - * Returns BTM_SUCCESS if successful + * Returns tBTM_STATUS::BTM_SUCCESS if successful * BTM_ILLEGAL_VALUE if a bad parameter is detected * BTM_NO_RESOURCES if could not allocate a message buffer * BTM_WRONG_MODE if the device is not up. @@ -123,7 +123,7 @@ void BTM_CancelInquiry(void); * Input Params: BTM_INQ_RESULT_STANDARD, BTM_INQ_RESULT_WITH_RSSI or * BTM_INQ_RESULT_EXTENDED * - * Returns BTM_SUCCESS if successful + * Returns tBTM_STATUS::BTM_SUCCESS if successful * BTM_NO_RESOURCES if couldn't get a memory pool buffer * BTM_ILLEGAL_VALUE if a bad parameter was detected * BTM_WRONG_MODE if the device is not up. diff --git a/system/stack/include/btm_sec_api.h b/system/stack/include/btm_sec_api.h index fcfdd44448..680b5b6fdd 100644 --- a/system/stack/include/btm_sec_api.h +++ b/system/stack/include/btm_sec_api.h @@ -101,11 +101,11 @@ tBTM_STATUS BTM_DeleteStoredLinkKey(const RawAddress* bd_addr, tBTM_CMPL_CB* p_c * Description This procedure confirms requested to validate set device. * * Parameter bd_addr - BD address of the peer - * res - confirmation result BTM_SUCCESS if success + * res - confirmation result tBTM_STATUS::BTM_SUCCESS if success * * Returns void * ******************************************************************************/ -void BTM_BleSirkConfirmDeviceReply(const RawAddress& bd_addr, uint8_t res); +void BTM_BleSirkConfirmDeviceReply(const RawAddress& bd_addr, tBTM_STATUS res); uint8_t btm_ble_read_sec_key_size(const RawAddress& bd_addr); diff --git a/system/stack/include/hidh_api.h b/system/stack/include/hidh_api.h index da7c43356b..f8d55775ce 100644 --- a/system/stack/include/hidh_api.h +++ b/system/stack/include/hidh_api.h @@ -47,8 +47,8 @@ * Type Definitions ****************************************************************************/ -typedef void(tHID_HOST_SDP_CALLBACK)(tSDP_STATUS result, uint16_t attr_mask, - tHID_DEV_SDP_INFO* sdp_rec); +typedef void(tHID_HOST_SDP_CALLBACK)(const RawAddress& bd_add, tSDP_STATUS result, + uint16_t attr_mask, tHID_DEV_SDP_INFO* sdp_rec); /* HID-HOST returns the events in the following table to the application via * tHID_HOST_DEV_CALLBACK diff --git a/system/stack/include/inq_hci_link_interface.h b/system/stack/include/inq_hci_link_interface.h index 075485a6b2..4c9f929004 100644 --- a/system/stack/include/inq_hci_link_interface.h +++ b/system/stack/include/inq_hci_link_interface.h @@ -24,9 +24,6 @@ #include "stack/include/hci_error_code.h" #include "types/raw_address.h" -void btm_process_remote_name(const RawAddress* bda, const BD_NAME name, uint16_t evt_len, - tHCI_STATUS hci_status); - void btm_process_inq_complete(tHCI_STATUS status, uint8_t mode); void btm_acl_process_sca_cmpl_pkt(uint8_t len, uint8_t* data); diff --git a/system/stack/include/l2c_api.h b/system/stack/include/l2c_api.h index 6f5b5a6acc..97af8ac5f0 100644 --- a/system/stack/include/l2c_api.h +++ b/system/stack/include/l2c_api.h @@ -794,9 +794,8 @@ struct tL2CAP_FIXED_CHNL_REG { * * Parameters: Fixed CID * BD Address of remote - * Idle timeout to use (or 0xFFFF if don't care) * - * Return value: true if channel removed + * Return value: true if channel removed or marked for removal * ******************************************************************************/ [[nodiscard]] bool L2CA_RemoveFixedChnl(uint16_t fixed_cid, const RawAddress& rem_bda); diff --git a/system/stack/include/l2cap_security_interface.h b/system/stack/include/l2cap_security_interface.h index 8d8b22c3ea..94644e6368 100644 --- a/system/stack/include/l2cap_security_interface.h +++ b/system/stack/include/l2cap_security_interface.h @@ -32,8 +32,8 @@ void l2c_pin_code_request(const RawAddress& bd_addr); void l2cu_resubmit_pending_sec_req(const RawAddress* p_bda); // Establish ACL link to remote device for Security Manager/Pairing. -// Returns BTM_CMD_STARTED if already connecting, BTM_NO_RESOURCES if can't -// allocate lcb, BTM_SUCCESS if initiated the connection +// Returns tBTM_STATUS::BTM_CMD_STARTED if already connecting, BTM_NO_RESOURCES if can't +// allocate lcb, tBTM_STATUS::BTM_SUCCESS if initiated the connection tBTM_STATUS l2cu_ConnectAclForSecurity(const RawAddress& bd_addr); void l2cble_update_sec_act(const RawAddress& bd_addr, uint16_t sec_act); diff --git a/system/stack/include/rfcdefs.h b/system/stack/include/rfcdefs.h index c778492a91..628fc77c45 100644 --- a/system/stack/include/rfcdefs.h +++ b/system/stack/include/rfcdefs.h @@ -259,7 +259,7 @@ #define BTA_RFC_MTU_SIZE (L2CAP_MTU_SIZE - L2CAP_MIN_OFFSET - RFCOMM_DATA_OVERHEAD) // The port receive queue low watermark level, in number of buffers. -#define PORT_RX_BUF_LOW_WM 4 +#define PORT_RX_BUF_LOW_WM 8 // The port receive queue high watermark level, in number of buffers. #define PORT_RX_BUF_HIGH_WM 10 diff --git a/system/stack/include/sdp_api.h b/system/stack/include/sdp_api.h index 50466cc3fb..987a449a89 100644 --- a/system/stack/include/sdp_api.h +++ b/system/stack/include/sdp_api.h @@ -500,7 +500,7 @@ struct tSdpApi { Parameters: info - (input) device identification record p_handle - (output) handle of record if successful - Returns Returns SDP_SUCCESS if record added successfully, else + Returns Returns tSDP_STATUS::SDP_SUCCESS if record added successfully, else error ******************************************************************************/ @@ -521,7 +521,7 @@ struct tSdpApi { len - (input ) data base length p_cb - (input) callback when complete - Returns SDP_SUCCESS if query started successfully, else error + Returns tSDP_STATUS::SDP_SUCCESS if query started successfully, else error ******************************************************************************/ [[nodiscard]] tSDP_STATUS (*SDP_DiDiscover)(const RawAddress& remote_device, @@ -556,7 +556,7 @@ struct tSdpApi { device_info - (input) dicovery database p_cb - (input) callback when complete - Returns SDP_SUCCESS if record retrieved, else error + Returns tSDP_STATUS::SDP_SUCCESS if record retrieved, else error ******************************************************************************/ [[nodiscard]] tSDP_STATUS (*SDP_GetDiRecord)(uint8_t getRecordIndex, diff --git a/system/stack/include/sdp_status.h b/system/stack/include/sdp_status.h index d71922cfdb..d709dd5038 100644 --- a/system/stack/include/sdp_status.h +++ b/system/stack/include/sdp_status.h @@ -30,7 +30,7 @@ ****************************************************************************/ /* Success code and error codes */ -typedef enum : uint16_t { +enum class tSDP_STATUS : uint16_t { SDP_SUCCESS = 0x0000, SDP_INVALID_VERSION = 0x0001, SDP_INVALID_SERV_REC_HDL = 0x0002, @@ -44,7 +44,7 @@ typedef enum : uint16_t { SDP_ERR_ATTR_NOT_PRESENT = 0x000A, SDP_ILLEGAL_PARAMETER = 0x000B, - HID_SDP_NO_SERV_UUID = (SDP_ILLEGAL_PARAMETER + 1), + HID_SDP_NO_SERV_UUID = (tSDP_STATUS::SDP_ILLEGAL_PARAMETER + 1), HID_SDP_MANDATORY_MISSING, SDP_NO_RECS_MATCH = 0xFFF0, @@ -53,34 +53,34 @@ typedef enum : uint16_t { SDP_GENERIC_ERROR = 0xFFF3, SDP_DB_FULL = 0xFFF4, SDP_CANCEL = 0xFFF8, -} tSDP_STATUS; +}; using tSDP_RESULT = tSDP_STATUS; using tSDP_REASON = tSDP_STATUS; inline std::string sdp_status_text(const tSDP_STATUS& status) { switch (status) { - CASE_RETURN_TEXT(SDP_SUCCESS); - CASE_RETURN_TEXT(SDP_INVALID_VERSION); - CASE_RETURN_TEXT(SDP_INVALID_SERV_REC_HDL); - CASE_RETURN_TEXT(SDP_INVALID_REQ_SYNTAX); - CASE_RETURN_TEXT(SDP_INVALID_PDU_SIZE); - CASE_RETURN_TEXT(SDP_INVALID_CONT_STATE); - CASE_RETURN_TEXT(SDP_NO_RESOURCES); - CASE_RETURN_TEXT(SDP_DI_REG_FAILED); - CASE_RETURN_TEXT(SDP_DI_DISC_FAILED); - CASE_RETURN_TEXT(SDP_NO_DI_RECORD_FOUND); - CASE_RETURN_TEXT(SDP_ERR_ATTR_NOT_PRESENT); - CASE_RETURN_TEXT(SDP_ILLEGAL_PARAMETER); + CASE_RETURN_TEXT(tSDP_STATUS::SDP_SUCCESS); + CASE_RETURN_TEXT(tSDP_STATUS::SDP_INVALID_VERSION); + CASE_RETURN_TEXT(tSDP_STATUS::SDP_INVALID_SERV_REC_HDL); + CASE_RETURN_TEXT(tSDP_STATUS::SDP_INVALID_REQ_SYNTAX); + CASE_RETURN_TEXT(tSDP_STATUS::SDP_INVALID_PDU_SIZE); + CASE_RETURN_TEXT(tSDP_STATUS::SDP_INVALID_CONT_STATE); + CASE_RETURN_TEXT(tSDP_STATUS::SDP_NO_RESOURCES); + CASE_RETURN_TEXT(tSDP_STATUS::SDP_DI_REG_FAILED); + CASE_RETURN_TEXT(tSDP_STATUS::SDP_DI_DISC_FAILED); + CASE_RETURN_TEXT(tSDP_STATUS::SDP_NO_DI_RECORD_FOUND); + CASE_RETURN_TEXT(tSDP_STATUS::SDP_ERR_ATTR_NOT_PRESENT); + CASE_RETURN_TEXT(tSDP_STATUS::SDP_ILLEGAL_PARAMETER); - CASE_RETURN_TEXT(HID_SDP_NO_SERV_UUID); - CASE_RETURN_TEXT(HID_SDP_MANDATORY_MISSING); + CASE_RETURN_TEXT(tSDP_STATUS::HID_SDP_NO_SERV_UUID); + CASE_RETURN_TEXT(tSDP_STATUS::HID_SDP_MANDATORY_MISSING); - CASE_RETURN_TEXT(SDP_NO_RECS_MATCH); - CASE_RETURN_TEXT(SDP_CONN_FAILED); - CASE_RETURN_TEXT(SDP_CFG_FAILED); - CASE_RETURN_TEXT(SDP_GENERIC_ERROR); - CASE_RETURN_TEXT(SDP_DB_FULL); - CASE_RETURN_TEXT(SDP_CANCEL); + CASE_RETURN_TEXT(tSDP_STATUS::SDP_NO_RECS_MATCH); + CASE_RETURN_TEXT(tSDP_STATUS::SDP_CONN_FAILED); + CASE_RETURN_TEXT(tSDP_STATUS::SDP_CFG_FAILED); + CASE_RETURN_TEXT(tSDP_STATUS::SDP_GENERIC_ERROR); + CASE_RETURN_TEXT(tSDP_STATUS::SDP_DB_FULL); + CASE_RETURN_TEXT(tSDP_STATUS::SDP_CANCEL); default: return base::StringPrintf("UNKNOWN[%hu]", status); } diff --git a/system/stack/include/security_client_callbacks.h b/system/stack/include/security_client_callbacks.h index 3138c1c8d3..1e776c5ac2 100644 --- a/system/stack/include/security_client_callbacks.h +++ b/system/stack/include/security_client_callbacks.h @@ -34,7 +34,7 @@ /* Authorize device for service. Parameters are * Service Id (NULL - unknown service or unused) */ -typedef uint8_t(tBTM_AUTHORIZE_CALLBACK)(uint8_t service_id); +typedef tBTM_STATUS(tBTM_AUTHORIZE_CALLBACK)(uint8_t service_id); /* Get PIN for the connection. Parameters are * BD Address of remote @@ -42,17 +42,17 @@ typedef uint8_t(tBTM_AUTHORIZE_CALLBACK)(uint8_t service_id); * BD Name of remote * Flag indicating the minimum pin code length to be 16 digits */ -typedef uint8_t(tBTM_PIN_CALLBACK)(const RawAddress& bd_addr, DEV_CLASS dev_class, - const BD_NAME bd_name, bool min_16_digit); +typedef tBTM_STATUS(tBTM_PIN_CALLBACK)(const RawAddress& bd_addr, DEV_CLASS dev_class, + const BD_NAME bd_name, bool min_16_digit); /* New Link Key for the connection. Parameters are * BD Address of remote * Link Key * Key Type: Combination, Local Unit, or Remote Unit */ -typedef uint8_t(tBTM_LINK_KEY_CALLBACK)(const RawAddress& bd_addr, DEV_CLASS dev_class, - BD_NAME bd_name, const LinkKey& key, uint8_t key_type, - bool is_ctkd); +typedef tBTM_STATUS(tBTM_LINK_KEY_CALLBACK)(const RawAddress& bd_addr, DEV_CLASS dev_class, + BD_NAME bd_name, const LinkKey& key, uint8_t key_type, + bool is_ctkd); /* Remote Name Resolved. Parameters are * BD Address of remote @@ -131,9 +131,9 @@ typedef struct { uint8_t* p_pin); void (*BTM_SecConfirmReqReply)(tBTM_STATUS res, tBT_TRANSPORT transport, const RawAddress bd_addr); - void (*BTM_BleSirkConfirmDeviceReply)(const RawAddress& bd_addr, uint8_t res); + void (*BTM_BleSirkConfirmDeviceReply)(const RawAddress& bd_addr, tBTM_STATUS res); - void (*BTM_BlePasskeyReply)(const RawAddress& bd_addr, uint8_t res, uint32_t passkey); + void (*BTM_BlePasskeyReply)(const RawAddress& bd_addr, tBTM_STATUS res, uint32_t passkey); // other misc APIs uint8_t (*BTM_GetSecurityMode)(); diff --git a/system/stack/l2cap/l2c_api.cc b/system/stack/l2cap/l2c_api.cc index 922f8186a7..5aafd6771a 100644 --- a/system/stack/l2cap/l2c_api.cc +++ b/system/stack/l2cap/l2c_api.cc @@ -29,6 +29,7 @@ #include <base/location.h> #include <base/strings/stringprintf.h> #include <bluetooth/log.h> +#include <com_android_bluetooth_flags.h> #include <cstdint> #include <string> @@ -1214,6 +1215,9 @@ bool L2CA_ConnectFixedChnl(uint16_t fixed_cid, const RawAddress& rem_bda) { return true; } + // Restore the fixed channel if it was suspended + l2cu_fixed_channel_restore(p_lcb, fixed_cid); + (*l2cb.fixed_reg[fixed_cid - L2CAP_FIRST_FIXED_CHNL].pL2CA_FixedConn_Cb)( fixed_cid, p_lcb->remote_bd_addr, true, 0, p_lcb->transport); return true; @@ -1307,28 +1311,29 @@ tL2CAP_DW_RESULT L2CA_SendFixedChnlData(uint16_t fixed_cid, const RawAddress& re p_buf->event = 0; p_buf->layer_specific = L2CAP_FLUSHABLE_CH_BASED; - if (!p_lcb->p_fixed_ccbs[fixed_cid - L2CAP_FIRST_FIXED_CHNL]) { + tL2C_CCB* p_ccb = p_lcb->p_fixed_ccbs[fixed_cid - L2CAP_FIRST_FIXED_CHNL]; + + if (p_ccb == nullptr) { if (!l2cu_initialize_fixed_ccb(p_lcb, fixed_cid)) { log::warn("No channel control block found for CID: 0x{:4x}", fixed_cid); osi_free(p_buf); return tL2CAP_DW_RESULT::FAILED; } + p_ccb = p_lcb->p_fixed_ccbs[fixed_cid - L2CAP_FIRST_FIXED_CHNL]; } - if (p_lcb->p_fixed_ccbs[fixed_cid - L2CAP_FIRST_FIXED_CHNL]->cong_sent) { - log::warn( - "Unable to send data due to congestion CID: 0x{:04x} " - "xmit_hold_q.count: {} buff_quota: {}", - fixed_cid, - fixed_queue_length( - p_lcb->p_fixed_ccbs[fixed_cid - L2CAP_FIRST_FIXED_CHNL]->xmit_hold_q), - p_lcb->p_fixed_ccbs[fixed_cid - L2CAP_FIRST_FIXED_CHNL]->buff_quota); + // Sending packets over fixed channel reinstates them + l2cu_fixed_channel_restore(p_lcb, fixed_cid); + + if (p_ccb->cong_sent) { + log::warn("Link congestion CID: 0x{:04x} xmit_hold_q.count: {} buff_quota: {}", fixed_cid, + fixed_queue_length(p_ccb->xmit_hold_q), p_ccb->buff_quota); osi_free(p_buf); return tL2CAP_DW_RESULT::FAILED; } log::debug("Enqueued data for CID: 0x{:04x} len:{}", fixed_cid, p_buf->len); - l2c_enqueue_peer_data(p_lcb->p_fixed_ccbs[fixed_cid - L2CAP_FIRST_FIXED_CHNL], p_buf); + l2c_enqueue_peer_data(p_ccb, p_buf); l2c_link_check_send_pkts(p_lcb, 0, NULL); @@ -1338,7 +1343,7 @@ tL2CAP_DW_RESULT L2CA_SendFixedChnlData(uint16_t fixed_cid, const RawAddress& re l2cu_no_dynamic_ccbs(p_lcb); } - if (p_lcb->p_fixed_ccbs[fixed_cid - L2CAP_FIRST_FIXED_CHNL]->cong_sent) { + if (p_ccb->cong_sent) { log::debug("Link congested for CID: 0x{:04x}", fixed_cid); return tL2CAP_DW_RESULT::CONGESTED; } @@ -1354,13 +1359,11 @@ tL2CAP_DW_RESULT L2CA_SendFixedChnlData(uint16_t fixed_cid, const RawAddress& re * * Parameters: Fixed CID * BD Address of remote - * Idle timeout to use (or 0xFFFF if don't care) * - * Return value: true if channel removed + * Return value: true if channel removed or marked for removal * ******************************************************************************/ bool L2CA_RemoveFixedChnl(uint16_t fixed_cid, const RawAddress& rem_bda) { - tL2C_CCB* p_ccb; tBT_TRANSPORT transport = BT_TRANSPORT_BR_EDR; /* Check CID is valid and registered */ @@ -1382,11 +1385,22 @@ bool L2CA_RemoveFixedChnl(uint16_t fixed_cid, const RawAddress& rem_bda) { return false; } - log::verbose("BDA: {} CID: 0x{:04x}", rem_bda, fixed_cid); - /* Release the CCB, starting an inactivity timeout on the LCB if no other CCBs * exist */ - p_ccb = p_lcb->p_fixed_ccbs[fixed_cid - L2CAP_FIRST_FIXED_CHNL]; + tL2C_CCB* p_ccb = p_lcb->p_fixed_ccbs[fixed_cid - L2CAP_FIRST_FIXED_CHNL]; + + if (com::android::bluetooth::flags::transmit_smp_packets_before_release() && p_ccb->in_use && + !fixed_queue_is_empty(p_ccb->xmit_hold_q)) { + if (l2cu_fixed_channel_suspended(p_lcb, fixed_cid)) { + log::warn("Removal of BDA: {} CID: 0x{:04x} already pending", rem_bda, fixed_cid); + } else { + p_lcb->suspended.push_back(fixed_cid); + log::info("Waiting for transmit queue to clear, BDA: {} CID: 0x{:04x}", rem_bda, fixed_cid); + } + return true; + } + + log::verbose("BDA: {} CID: 0x{:04x}", rem_bda, fixed_cid); p_lcb->p_fixed_ccbs[fixed_cid - L2CAP_FIRST_FIXED_CHNL] = NULL; p_lcb->SetDisconnectReason(HCI_ERR_CONN_CAUSE_LOCAL_HOST); @@ -1744,6 +1758,10 @@ void L2CA_Dumpsys(int fd) { ccb->in_use ? "true" : "false"); ccb = ccb->p_next_ccb; } + + for (auto fixed_cid : lcb.suspended) { + LOG_DUMPSYS(fd, " pending removal fixed CID: 0x%04x", fixed_cid); + } } } #undef DUMPSYS_TAG diff --git a/system/stack/l2cap/l2c_ble.cc b/system/stack/l2cap/l2c_ble.cc index 91246b55bf..2ef8232525 100644 --- a/system/stack/l2cap/l2c_ble.cc +++ b/system/stack/l2cap/l2c_ble.cc @@ -50,6 +50,7 @@ #include "stack/include/btm_ble_api.h" #include "stack/include/btm_client_interface.h" #include "stack/include/btm_log_history.h" +#include "stack/include/btm_status.h" #include "stack/include/l2c_api.h" #include "stack/include/l2cap_acl_interface.h" #include "stack/include/l2cdefs.h" @@ -1075,7 +1076,10 @@ void l2cble_update_data_length(tL2C_LCB* p_lcb) { /* update TX data length if changed */ if (p_lcb->tx_data_len != tx_mtu) { - BTM_SetBleDataLength(p_lcb->remote_bd_addr, tx_mtu); + if (get_btm_client_interface().ble.BTM_SetBleDataLength(p_lcb->remote_bd_addr, tx_mtu) != + tBTM_STATUS::BTM_SUCCESS) { + log::warn("Unable to set BLE data length peer:{} mtu:{}", p_lcb->remote_bd_addr, tx_mtu); + } } } @@ -1236,7 +1240,7 @@ void l2cble_send_peer_disc_req(tL2C_CCB* p_ccb) { * ******************************************************************************/ void l2cble_sec_comp(RawAddress bda, tBT_TRANSPORT transport, void* /* p_ref_data */, - tBTM_STATUS status) { + tBTM_STATUS btm_status) { tL2C_LCB* p_lcb = l2cu_find_lcb_by_bd_addr(bda, BT_TRANSPORT_LE); tL2CAP_SEC_DATA* p_buf = NULL; uint8_t sec_act; @@ -1256,13 +1260,13 @@ void l2cble_sec_comp(RawAddress bda, tBT_TRANSPORT transport, void* /* p_ref_dat return; } - if (status != BTM_SUCCESS) { - (*(p_buf->p_callback))(bda, BT_TRANSPORT_LE, p_buf->p_ref_data, status); + if (btm_status != tBTM_STATUS::BTM_SUCCESS) { + (*(p_buf->p_callback))(bda, BT_TRANSPORT_LE, p_buf->p_ref_data, btm_status); osi_free(p_buf); } else { if (sec_act == BTM_SEC_ENCRYPT_MITM) { if (BTM_IsLinkKeyAuthed(bda, transport)) { - (*(p_buf->p_callback))(bda, BT_TRANSPORT_LE, p_buf->p_ref_data, status); + (*(p_buf->p_callback))(bda, BT_TRANSPORT_LE, p_buf->p_ref_data, btm_status); } else { log::verbose("MITM Protection Not present"); (*(p_buf->p_callback))(bda, BT_TRANSPORT_LE, p_buf->p_ref_data, BTM_FAILED_ON_SECURITY); @@ -1270,7 +1274,7 @@ void l2cble_sec_comp(RawAddress bda, tBT_TRANSPORT transport, void* /* p_ref_dat } else { log::verbose("MITM Protection not required sec_act = {}", p_lcb->sec_act); - (*(p_buf->p_callback))(bda, BT_TRANSPORT_LE, p_buf->p_ref_data, status); + (*(p_buf->p_callback))(bda, BT_TRANSPORT_LE, p_buf->p_ref_data, btm_status); } osi_free(p_buf); } @@ -1282,8 +1286,8 @@ void l2cble_sec_comp(RawAddress bda, tBT_TRANSPORT transport, void* /* p_ref_dat while (!fixed_queue_is_empty(p_lcb->le_sec_pending_q)) { p_buf = (tL2CAP_SEC_DATA*)fixed_queue_dequeue(p_lcb->le_sec_pending_q); - if (status != BTM_SUCCESS) { - (*(p_buf->p_callback))(bda, BT_TRANSPORT_LE, p_buf->p_ref_data, status); + if (btm_status != tBTM_STATUS::BTM_SUCCESS) { + (*(p_buf->p_callback))(bda, BT_TRANSPORT_LE, p_buf->p_ref_data, btm_status); osi_free(p_buf); } else { l2ble_sec_access_req(bda, p_buf->psm, p_buf->is_originator, p_buf->p_callback, @@ -1339,7 +1343,7 @@ tL2CAP_LE_RESULT_CODE l2ble_sec_access_req(const RawAddress& bd_addr, uint16_t p btm_ble_start_sec_check(bd_addr, psm, is_originator, &l2cble_sec_comp, p_ref_data); switch (result) { - case BTM_SUCCESS: + case tBTM_STATUS::BTM_SUCCESS: return L2CAP_LE_RESULT_CONN_OK; case BTM_ILLEGAL_VALUE: return L2CAP_LE_RESULT_NO_PSM; diff --git a/system/stack/l2cap/l2c_csm.cc b/system/stack/l2cap/l2c_csm.cc index 5a3e576223..15e225c38d 100644 --- a/system/stack/l2cap/l2c_csm.cc +++ b/system/stack/l2cap/l2c_csm.cc @@ -33,7 +33,6 @@ #include "internal_include/bt_target.h" #include "main/shim/entry.h" #include "main/shim/metrics_api.h" -#include "os/log.h" #include "osi/include/allocator.h" #include "osi/include/stack_power_telemetry.h" #include "stack/btm/btm_sec.h" @@ -58,7 +57,7 @@ static void l2c_csm_open(tL2C_CCB* p_ccb, tL2CEVT event, void* p_data); static void l2c_csm_w4_l2cap_disconnect_rsp(tL2C_CCB* p_ccb, tL2CEVT event, void* p_data); static void l2c_csm_w4_l2ca_disconnect_rsp(tL2C_CCB* p_ccb, tL2CEVT event, void* p_data); -static const char* l2c_csm_get_event_name(tL2CEVT event); +static std::string l2c_csm_get_event_name(const tL2CEVT& event); // Send a connect response with result OK and adjust the state machine static void l2c_csm_send_connect_rsp(tL2C_CCB* p_ccb) { @@ -252,7 +251,7 @@ static void l2c_csm_closed(tL2C_CCB* p_ccb, tL2CEVT event, void* p_data) { /* If sec access does not result in started SEC_COM or COMP_NEG are * already processed */ if (btm_sec_l2cap_access_req(p_ccb->p_lcb->remote_bd_addr, p_ccb->p_rcb->psm, true, - &l2c_link_sec_comp, p_ccb) == BTM_CMD_STARTED) { + &l2c_link_sec_comp, p_ccb) == tBTM_STATUS::BTM_CMD_STARTED) { p_ccb->chnl_state = CST_ORIG_W4_SEC_COMP; } } @@ -321,7 +320,7 @@ static void l2c_csm_closed(tL2C_CCB* p_ccb, tL2CEVT event, void* p_data) { p_ccb->chnl_state = CST_TERM_W4_SEC_COMP; auto status = btm_sec_l2cap_access_req(p_ccb->p_lcb->remote_bd_addr, p_ccb->p_rcb->psm, false, &l2c_link_sec_comp, p_ccb); - if (status == BTM_CMD_STARTED) { + if (status == tBTM_STATUS::BTM_CMD_STARTED) { // started the security process, tell the peer to set a longer timer l2cu_send_peer_connect_rsp(p_ccb, L2CAP_CONN_PENDING, 0); } else { @@ -1138,8 +1137,7 @@ static void l2c_csm_config(tL2C_CCB* p_ccb, tL2CEVT event, void* p_data) { if (l2cb.fixed_reg[p_ccb->local_cid - L2CAP_FIRST_FIXED_CHNL].pL2CA_FixedData_Cb != nullptr) { p_ccb->metrics.rx(static_cast<BT_HDR*>(p_data)->len); - (*l2cb.fixed_reg[p_ccb->local_cid - L2CAP_FIRST_FIXED_CHNL].pL2CA_FixedData_Cb)( - p_ccb->local_cid, p_ccb->p_lcb->remote_bd_addr, (BT_HDR*)p_data); + l2cu_fixed_channel_data_cb(p_lcb, p_ccb->local_cid, reinterpret_cast<BT_HDR*>(p_data)); } else { if (p_data != nullptr) { osi_free_and_reset(&p_data); @@ -1494,116 +1492,51 @@ static void l2c_csm_w4_l2ca_disconnect_rsp(tL2C_CCB* p_ccb, tL2CEVT event, void* p_ccb->chnl_state, l2c_csm_get_event_name(event), event); } -/******************************************************************************* - * - * Function l2c_csm_get_event_name - * - * Description This function returns the event name. - * - * NOTE conditionally compiled to save memory. - * - * Returns pointer to the name - * - ******************************************************************************/ -static const char* l2c_csm_get_event_name(tL2CEVT event) { +static std::string l2c_csm_get_event_name(const tL2CEVT& event) { switch (event) { - case L2CEVT_LP_CONNECT_CFM: /* Lower layer connect confirm */ - return "LOWER_LAYER_CONNECT_CFM"; - case L2CEVT_LP_CONNECT_CFM_NEG: /* Lower layer connect confirm (failed) */ - return "LOWER_LAYER_CONNECT_CFM_NEG"; - case L2CEVT_LP_CONNECT_IND: /* Lower layer connect indication */ - return "LOWER_LAYER_CONNECT_IND"; - case L2CEVT_LP_DISCONNECT_IND: /* Lower layer disconnect indication */ - return "LOWER_LAYER_DISCONNECT_IND"; - - case L2CEVT_SEC_COMP: /* Security cleared successfully */ - return "SECURITY_COMPLETE"; - case L2CEVT_SEC_COMP_NEG: /* Security procedure failed */ - return "SECURITY_COMPLETE_NEG"; - - case L2CEVT_L2CAP_CONNECT_REQ: /* Peer connection request */ - return "PEER_CONNECT_REQ"; - case L2CEVT_L2CAP_CONNECT_RSP: /* Peer connection response */ - return "PEER_CONNECT_RSP"; - case L2CEVT_L2CAP_CONNECT_RSP_PND: /* Peer connection response pending */ - return "PEER_CONNECT_RSP_PND"; - case L2CEVT_L2CAP_CONNECT_RSP_NEG: /* Peer connection response (failed) */ - return "PEER_CONNECT_RSP_NEG"; - case L2CEVT_L2CAP_CONFIG_REQ: /* Peer configuration request */ - return "PEER_CONFIG_REQ"; - case L2CEVT_L2CAP_CONFIG_RSP: /* Peer configuration response */ - return "PEER_CONFIG_RSP"; - case L2CEVT_L2CAP_CONFIG_RSP_NEG: /* Peer configuration response (failed) */ - return "PEER_CONFIG_RSP_NEG"; - case L2CEVT_L2CAP_DISCONNECT_REQ: /* Peer disconnect request */ - return "PEER_DISCONNECT_REQ"; - case L2CEVT_L2CAP_DISCONNECT_RSP: /* Peer disconnect response */ - return "PEER_DISCONNECT_RSP"; - case L2CEVT_L2CAP_DATA: /* Peer data */ - return "PEER_DATA"; - - case L2CEVT_L2CA_CONNECT_REQ: /* Upper layer connect request */ - return "UPPER_LAYER_CONNECT_REQ"; - case L2CEVT_L2CA_CONNECT_RSP: /* Upper layer connect response */ - return "UPPER_LAYER_CONNECT_RSP"; - case L2CEVT_L2CA_CONNECT_RSP_NEG: /* Upper layer connect response (failed)*/ - return "UPPER_LAYER_CONNECT_RSP_NEG"; - case L2CEVT_L2CA_CONFIG_REQ: /* Upper layer config request */ - return "UPPER_LAYER_CONFIG_REQ"; - case L2CEVT_L2CA_CONFIG_RSP: /* Upper layer config response */ - return "UPPER_LAYER_CONFIG_RSP"; - case L2CEVT_L2CA_DISCONNECT_REQ: /* Upper layer disconnect request */ - return "UPPER_LAYER_DISCONNECT_REQ"; - case L2CEVT_L2CA_DISCONNECT_RSP: /* Upper layer disconnect response */ - return "UPPER_LAYER_DISCONNECT_RSP"; - case L2CEVT_L2CA_DATA_READ: /* Upper layer data read */ - return "UPPER_LAYER_DATA_READ"; - case L2CEVT_L2CA_DATA_WRITE: /* Upper layer data write */ - return "UPPER_LAYER_DATA_WRITE"; - case L2CEVT_TIMEOUT: /* Timeout */ - return "TIMEOUT"; - case L2CEVT_SEC_RE_SEND_CMD: - return "SEC_RE_SEND_CMD"; - case L2CEVT_L2CAP_INFO_RSP: /* Peer information response */ - return "L2CEVT_L2CAP_INFO_RSP"; - case L2CEVT_ACK_TIMEOUT: - return "L2CEVT_ACK_TIMEOUT"; - case L2CEVT_L2CA_SEND_FLOW_CONTROL_CREDIT: /* Upper layer send credit packet - */ - return "SEND_FLOW_CONTROL_CREDIT"; - case L2CEVT_L2CA_CREDIT_BASED_CONNECT_REQ: /* Upper layer credit based - connect request */ - return "SEND_CREDIT_BASED_CONNECT_REQ"; - case L2CEVT_L2CA_CREDIT_BASED_CONNECT_RSP: /* Upper layer credit based - connect response */ - return "SEND_CREDIT_BASED_CONNECT_RSP"; - case L2CEVT_L2CA_CREDIT_BASED_CONNECT_RSP_NEG: /* Upper layer credit based - connect response - (failed)*/ - return "SEND_CREDIT_BASED_CONNECT_RSP_NEG"; - case L2CEVT_L2CA_CREDIT_BASED_RECONFIG_REQ: /* Upper layer credit based - reconfig request */ - return "SEND_CREDIT_BASED_RECONFIG_REQ"; - case L2CEVT_L2CAP_RECV_FLOW_CONTROL_CREDIT: /* Peer send credit packet */ - return "RECV_FLOW_CONTROL_CREDIT"; - case L2CEVT_L2CAP_CREDIT_BASED_CONNECT_REQ: /* Peer send credit based - connect request */ - return "RECV_CREDIT_BASED_CONNECT_REQ"; - case L2CEVT_L2CAP_CREDIT_BASED_CONNECT_RSP: /* Peer send credit based - connect response */ - return "RECV_CREDIT_BASED_CONNECT_RSP"; - case L2CEVT_L2CAP_CREDIT_BASED_CONNECT_RSP_NEG: /* Peer send reject credit - based connect response */ - return "RECV_CREDIT_BASED_CONNECT_RSP_NEG"; - case L2CEVT_L2CAP_CREDIT_BASED_RECONFIG_REQ: /* Peer send credit based - reconfig request */ - return "RECV_CREDIT_BASED_RECONFIG_REQ"; - case L2CEVT_L2CAP_CREDIT_BASED_RECONFIG_RSP: /* Peer send credit based - reconfig response */ - return "RECV_CREDIT_BASED_RECONFIG_RSP"; - default: - return "???? UNKNOWN EVENT"; + CASE_RETURN_STRING(L2CEVT_LP_CONNECT_CFM); + CASE_RETURN_STRING(L2CEVT_LP_CONNECT_CFM_NEG); + CASE_RETURN_STRING(L2CEVT_LP_CONNECT_IND); + CASE_RETURN_STRING(L2CEVT_LP_DISCONNECT_IND); + CASE_RETURN_STRING(L2CEVT_SEC_COMP); + CASE_RETURN_STRING(L2CEVT_SEC_COMP_NEG); + CASE_RETURN_STRING(L2CEVT_L2CAP_CONNECT_REQ); + CASE_RETURN_STRING(L2CEVT_L2CAP_CONNECT_RSP); + CASE_RETURN_STRING(L2CEVT_L2CAP_CONNECT_RSP_PND); + CASE_RETURN_STRING(L2CEVT_L2CAP_CONNECT_RSP_NEG); + CASE_RETURN_STRING(L2CEVT_L2CAP_CONFIG_REQ); + CASE_RETURN_STRING(L2CEVT_L2CAP_CONFIG_RSP); + CASE_RETURN_STRING(L2CEVT_L2CAP_CONFIG_RSP_NEG); + CASE_RETURN_STRING(L2CEVT_L2CAP_DISCONNECT_REQ); + CASE_RETURN_STRING(L2CEVT_L2CAP_DISCONNECT_RSP); + CASE_RETURN_STRING(L2CEVT_L2CAP_DATA); + + CASE_RETURN_STRING(L2CEVT_L2CA_CONNECT_REQ); + CASE_RETURN_STRING(L2CEVT_L2CA_CONNECT_RSP); + CASE_RETURN_STRING(L2CEVT_L2CA_CONNECT_RSP_NEG); + CASE_RETURN_STRING(L2CEVT_L2CA_CONFIG_REQ); + CASE_RETURN_STRING(L2CEVT_L2CA_CONFIG_RSP); + CASE_RETURN_STRING(L2CEVT_L2CA_DISCONNECT_REQ); + CASE_RETURN_STRING(L2CEVT_L2CA_DISCONNECT_RSP); + CASE_RETURN_STRING(L2CEVT_L2CA_DATA_READ); + CASE_RETURN_STRING(L2CEVT_L2CA_DATA_WRITE); + CASE_RETURN_STRING(L2CEVT_TIMEOUT); + CASE_RETURN_STRING(L2CEVT_SEC_RE_SEND_CMD); + CASE_RETURN_STRING(L2CEVT_L2CAP_INFO_RSP); + CASE_RETURN_STRING(L2CEVT_ACK_TIMEOUT); + CASE_RETURN_STRING(L2CEVT_L2CA_SEND_FLOW_CONTROL_CREDIT); + CASE_RETURN_STRING(L2CEVT_L2CA_CREDIT_BASED_CONNECT_REQ); + CASE_RETURN_STRING(L2CEVT_L2CA_CREDIT_BASED_CONNECT_RSP); + CASE_RETURN_STRING(L2CEVT_L2CA_CREDIT_BASED_CONNECT_RSP_NEG); + CASE_RETURN_STRING(L2CEVT_L2CA_CREDIT_BASED_RECONFIG_REQ); + CASE_RETURN_STRING(L2CEVT_L2CAP_RECV_FLOW_CONTROL_CREDIT); + CASE_RETURN_STRING(L2CEVT_L2CAP_CREDIT_BASED_CONNECT_REQ); + CASE_RETURN_STRING(L2CEVT_L2CAP_CREDIT_BASED_CONNECT_RSP); + CASE_RETURN_STRING(L2CEVT_L2CAP_CREDIT_BASED_CONNECT_RSP_NEG); + CASE_RETURN_STRING(L2CEVT_L2CAP_CREDIT_BASED_RECONFIG_REQ); + CASE_RETURN_STRING(L2CEVT_L2CAP_CREDIT_BASED_RECONFIG_RSP); } + RETURN_UNKNOWN_TYPE_STRING(tL2CEVT, event); } /******************************************************************************* diff --git a/system/stack/l2cap/l2c_fcr.cc b/system/stack/l2cap/l2c_fcr.cc index 96fb453806..b1f931a23e 100644 --- a/system/stack/l2cap/l2c_fcr.cc +++ b/system/stack/l2cap/l2c_fcr.cc @@ -1219,8 +1219,7 @@ static bool do_sar_reassembly(tL2C_CCB* p_ccb, BT_HDR* p_buf, uint16_t ctrl_word if (p_ccb->local_cid < L2CAP_BASE_APPL_CID && (p_ccb->local_cid >= L2CAP_FIRST_FIXED_CHNL && p_ccb->local_cid <= L2CAP_LAST_FIXED_CHNL)) { if (l2cb.fixed_reg[p_ccb->local_cid - L2CAP_FIRST_FIXED_CHNL].pL2CA_FixedData_Cb) { - (*l2cb.fixed_reg[p_ccb->local_cid - L2CAP_FIRST_FIXED_CHNL].pL2CA_FixedData_Cb)( - p_ccb->local_cid, p_ccb->p_lcb->remote_bd_addr, p_buf); + l2cu_fixed_channel_data_cb(p_ccb->p_lcb, p_ccb->local_cid, p_buf); } } else { l2c_csm_execute(p_ccb, L2CEVT_L2CAP_DATA, p_buf); diff --git a/system/stack/l2cap/l2c_int.h b/system/stack/l2cap/l2c_int.h index 9217f2970a..b485c28b79 100644 --- a/system/stack/l2cap/l2c_int.h +++ b/system/stack/l2cap/l2c_int.h @@ -486,6 +486,8 @@ public: } tL2C_CCB* p_fixed_ccbs[L2CAP_NUM_FIXED_CHNLS]; + std::vector<uint16_t> suspended; /* List of fixed channel CIDs which are suspended but not + * removed */ private: tHCI_REASON disc_reason_{HCI_ERR_UNDEFINED}; @@ -693,6 +695,9 @@ void l2cu_change_pri_ccb(tL2C_CCB* p_ccb, tL2CAP_CHNL_PRIORITY priority); tL2C_CCB* l2cu_allocate_ccb(tL2C_LCB* p_lcb, uint16_t cid, bool is_eatt = false); void l2cu_release_ccb(tL2C_CCB* p_ccb); +void l2cu_fixed_channel_restore(tL2C_LCB* p_lcb, uint16_t fixed_cid); +bool l2cu_fixed_channel_suspended(tL2C_LCB* p_lcb, uint16_t fixed_cid); +void l2cu_fixed_channel_data_cb(tL2C_LCB* p_lcb, uint16_t fixed_cid, BT_HDR* p_buf); tL2C_CCB* l2cu_find_ccb_by_cid(tL2C_LCB* p_lcb, uint16_t local_cid); tL2C_CCB* l2cu_find_ccb_by_remote_cid(tL2C_LCB* p_lcb, uint16_t remote_cid); bool l2c_is_cmd_rejected(uint8_t cmd_code, uint8_t id, tL2C_LCB* p_lcb); diff --git a/system/stack/l2cap/l2c_link.cc b/system/stack/l2cap/l2c_link.cc index c772361a15..a9fef06bc0 100644 --- a/system/stack/l2cap/l2c_link.cc +++ b/system/stack/l2cap/l2c_link.cc @@ -32,11 +32,13 @@ #include "device/include/device_iot_config.h" #include "internal_include/bt_target.h" +#include "l2c_api.h" #include "osi/include/allocator.h" #include "stack/btm/btm_int_types.h" #include "stack/include/acl_api.h" #include "stack/include/bt_hdr.h" #include "stack/include/bt_types.h" +#include "stack/include/btm_status.h" #include "stack/include/hci_error_code.h" #include "stack/include/l2cap_acl_interface.h" #include "stack/include/l2cap_hci_link_interface.h" @@ -191,8 +193,8 @@ void l2c_link_sec_comp(RawAddress p_bda, tBT_TRANSPORT transport, void* p_ref_da log::debug("btm_status={}, BD_ADDR={}, transport={}", btm_status_text(btm_status), p_bda, bt_transport_text(transport)); - if (btm_status == BTM_SUCCESS_NO_SECURITY) { - btm_status = BTM_SUCCESS; + if (btm_status == tBTM_STATUS::BTM_SUCCESS_NO_SECURITY) { + btm_status = tBTM_STATUS::BTM_SUCCESS; } /* Save the parameters */ @@ -229,11 +231,11 @@ void l2c_link_sec_comp(RawAddress p_bda, tBT_TRANSPORT transport, void* p_ref_da } switch (btm_status) { - case BTM_SUCCESS: + case tBTM_STATUS::BTM_SUCCESS: l2c_csm_execute(p_ccb, L2CEVT_SEC_COMP, &ci); break; - case BTM_DELAY_CHECK: + case tBTM_STATUS::BTM_DELAY_CHECK: /* start a timer - encryption change not received before L2CAP connect * req */ alarm_set_on_mloop(p_ccb->l2c_ccb_timer, L2CAP_DELAY_CHECK_SM4_TIMEOUT_MS, @@ -251,11 +253,11 @@ void l2c_link_sec_comp(RawAddress p_bda, tBT_TRANSPORT transport, void* p_ref_da if (p_ccb == p_ref_data) { switch (btm_status) { - case BTM_SUCCESS: + case tBTM_STATUS::BTM_SUCCESS: l2c_csm_execute(p_ccb, L2CEVT_SEC_COMP, &ci); break; - case BTM_DELAY_CHECK: + case tBTM_STATUS::BTM_DELAY_CHECK: /* start a timer - encryption change not received before L2CAP * connect req */ alarm_set_on_mloop(p_ccb->l2c_ccb_timer, L2CAP_DELAY_CHECK_SM4_TIMEOUT_MS, @@ -471,16 +473,16 @@ void l2c_link_timeout(tL2C_LCB* p_lcb) { /* Security Manager will take care of disconnecting, state will be * updated at that time */ start_timeout = false; - } else if (rc == BTM_CMD_STARTED) { + } else if (rc == tBTM_STATUS::BTM_CMD_STARTED) { p_lcb->link_state = LST_DISCONNECTING; timeout_ms = L2CAP_LINK_DISCONNECT_TIMEOUT_MS; - } else if (rc == BTM_SUCCESS) { + } else if (rc == tBTM_STATUS::BTM_SUCCESS) { l2cu_process_fixed_disc_cback(p_lcb); /* BTM SEC will make sure that link is release (probably after pairing * is done) */ p_lcb->link_state = LST_DISCONNECTING; start_timeout = false; - } else if (rc == BTM_BUSY) { + } else if (rc == tBTM_STATUS::BTM_BUSY) { /* BTM is still executing security process. Let lcb stay as connected */ start_timeout = false; } else if (p_lcb->IsBonding()) { @@ -792,6 +794,11 @@ void l2c_pin_code_request(const RawAddress& bd_addr) { * ******************************************************************************/ static bool l2c_link_check_power_mode(tL2C_LCB* p_lcb) { + if (com::android::bluetooth::flags::transmit_smp_packets_before_release()) { + // TODO: Remove this function when flag transmit_smp_packets_before_release is released + return false; + } + bool need_to_active = false; // Return false as LM modes are applicable for BREDR transport @@ -1052,6 +1059,45 @@ static void l2c_link_send_to_lower(tL2C_LCB* p_lcb, BT_HDR* p_buf, if (p_cbi) { l2cu_tx_complete(p_cbi); } + + if (!com::android::bluetooth::flags::transmit_smp_packets_before_release() || + p_lcb->suspended.empty()) { + return; + } + + auto it = p_lcb->suspended.begin(); + while (it != p_lcb->suspended.end()) { + bool erase = false; + uint16_t fixed_cid = *it; + + if (fixed_cid < L2CAP_FIRST_FIXED_CHNL || fixed_cid > L2CAP_LAST_FIXED_CHNL) { + log::warn("Unknown channel was marked for removal, CID: 0x{:04x} BDA: {}", fixed_cid, + p_lcb->remote_bd_addr); + erase = true; + } else { + auto p_ccb = p_lcb->p_fixed_ccbs[fixed_cid - L2CAP_FIRST_FIXED_CHNL]; + if (p_ccb == nullptr || !p_ccb->in_use) { + log::warn( + "Fixed channel control block not active but was marked for removal, CID: 0x{:04x} " + "BDA: {}", + fixed_cid, p_lcb->remote_bd_addr); + erase = true; + } else if (fixed_queue_is_empty(p_ccb->xmit_hold_q)) { + if (L2CA_RemoveFixedChnl(fixed_cid, p_lcb->remote_bd_addr)) { + log::info("Finally removed CID: 0x{:04x} BDA: {}", fixed_cid, p_lcb->remote_bd_addr); + } else { + log::error("Failed to remove CID: 0x{:04x} BDA: {}", fixed_cid, p_lcb->remote_bd_addr); + } + erase = true; + } + } + + if (erase) { + it = p_lcb->suspended.erase(it); + } else { + it++; + } + } } void l2c_packets_completed(uint16_t handle, uint16_t num_sent) { @@ -1142,7 +1188,7 @@ tBTM_STATUS l2cu_ConnectAclForSecurity(const RawAddress& bd_addr) { tL2C_LCB* p_lcb = l2cu_find_lcb_by_bd_addr(bd_addr, BT_TRANSPORT_BR_EDR); if (p_lcb && (p_lcb->link_state == LST_CONNECTED || p_lcb->link_state == LST_CONNECTING)) { log::warn("Connection already exists"); - return BTM_CMD_STARTED; + return tBTM_STATUS::BTM_CMD_STARTED; } /* Make sure an L2cap link control block is available */ @@ -1152,7 +1198,7 @@ tBTM_STATUS l2cu_ConnectAclForSecurity(const RawAddress& bd_addr) { } l2cu_create_conn_br_edr(p_lcb); - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } void l2cble_update_sec_act(const RawAddress& bd_addr, uint16_t sec_act) { diff --git a/system/stack/l2cap/l2c_main.cc b/system/stack/l2cap/l2c_main.cc index 782afd367e..c136a5c52e 100644 --- a/system/stack/l2cap/l2c_main.cc +++ b/system/stack/l2cap/l2c_main.cc @@ -168,8 +168,7 @@ void l2c_rcv_acl_data(BT_HDR* p_msg) { if (p_ccb->peer_cfg.fcr.mode != L2CAP_FCR_BASIC_MODE) { l2c_fcr_proc_pdu(p_ccb, p_msg); } else { - (*l2cb.fixed_reg[rcv_cid - L2CAP_FIRST_FIXED_CHNL].pL2CA_FixedData_Cb)( - rcv_cid, p_lcb->remote_bd_addr, p_msg); + l2cu_fixed_channel_data_cb(p_lcb, rcv_cid, p_msg); } return; } diff --git a/system/stack/l2cap/l2c_utils.cc b/system/stack/l2cap/l2c_utils.cc index 13a557db51..dd67155181 100644 --- a/system/stack/l2cap/l2c_utils.cc +++ b/system/stack/l2cap/l2c_utils.cc @@ -24,8 +24,11 @@ #define LOG_TAG "l2c_utils" #include <bluetooth/log.h> +#include <com_android_bluetooth_flags.h> #include <string.h> +#include <algorithm> + #include "hal/snoop_logger.h" #include "hci/controller_interface.h" #include "internal_include/bt_target.h" @@ -37,6 +40,7 @@ #include "stack/include/bt_hdr.h" #include "stack/include/bt_types.h" #include "stack/include/btm_client_interface.h" +#include "stack/include/btm_status.h" #include "stack/include/hci_error_code.h" #include "stack/include/hcidefs.h" #include "stack/include/l2c_api.h" @@ -71,7 +75,7 @@ tL2C_LCB* l2cu_allocate_lcb(const RawAddress& p_bd_addr, bool is_bonding, tBT_TR if (!p_lcb->in_use) { alarm_free(p_lcb->l2c_lcb_timer); alarm_free(p_lcb->info_resp_timer); - memset(p_lcb, 0, sizeof(tL2C_LCB)); + *p_lcb = {}; p_lcb->remote_bd_addr = p_bd_addr; @@ -161,7 +165,7 @@ void l2cu_release_lcb(tL2C_LCB* p_lcb) { p_lcb->info_resp_timer = NULL; if (p_lcb->transport == BT_TRANSPORT_BR_EDR) { /* Release all SCO links */ - BTM_RemoveSco(p_lcb->remote_bd_addr); + get_btm_client_interface().sco.BTM_RemoveScoByBdaddr(p_lcb->remote_bd_addr); } if (p_lcb->sent_not_acked > 0) { @@ -216,6 +220,8 @@ void l2cu_release_lcb(tL2C_LCB* p_lcb) { l2c_link_adjust_allocation(); } + p_lcb->suspended.clear(); + /* Check and release all the LE COC connections waiting for security */ if (p_lcb->le_sec_pending_q) { while (!fixed_queue_is_empty(p_lcb->le_sec_pending_q)) { @@ -1624,6 +1630,37 @@ void l2cu_release_ccb(tL2C_CCB* p_ccb) { } } +void l2cu_fixed_channel_restore(tL2C_LCB* p_lcb, uint16_t fixed_cid) { + if (!com::android::bluetooth::flags::transmit_smp_packets_before_release()) { + return; + } + auto it = p_lcb->suspended.begin(); + while (it != p_lcb->suspended.end()) { + if (*it == fixed_cid) { + it = p_lcb->suspended.erase(it); + } else { + it++; + } + } +} + +bool l2cu_fixed_channel_suspended(tL2C_LCB* p_lcb, uint16_t fixed_cid) { + if (!com::android::bluetooth::flags::transmit_smp_packets_before_release()) { + return false; + } + return std::find(p_lcb->suspended.begin(), p_lcb->suspended.end(), fixed_cid) != + p_lcb->suspended.end(); +} + +void l2cu_fixed_channel_data_cb(tL2C_LCB* p_lcb, uint16_t fixed_cid, BT_HDR* p_buf) { + if (l2cu_fixed_channel_suspended(p_lcb, fixed_cid)) { + log::warn("Packet received for disconnecting fixed CID: 0x{:04x} BDA: {}", fixed_cid, + p_lcb->remote_bd_addr); + } + (*l2cb.fixed_reg[fixed_cid - L2CAP_FIRST_FIXED_CHNL].pL2CA_FixedData_Cb)( + fixed_cid, p_lcb->remote_bd_addr, p_buf); +} + /******************************************************************************* * * Function l2cu_find_ccb_by_remote_cid @@ -2119,7 +2156,8 @@ void l2cu_create_conn_br_edr(tL2C_LCB* p_lcb) { p_lcb->link_state = LST_CONNECTING_WAIT_SWITCH; p_lcb->SetLinkRoleAsCentral(); - if (BTM_SwitchRoleToCentral(p_lcb_cur->remote_bd_addr) == BTM_CMD_STARTED) { + if (get_btm_client_interface().link_policy.BTM_SwitchRoleToCentral( + p_lcb_cur->remote_bd_addr) == tBTM_STATUS::BTM_CMD_STARTED) { alarm_set_on_mloop(p_lcb->l2c_lcb_timer, L2CAP_LINK_ROLE_SWITCH_TIMEOUT_MS, l2c_lcb_timer_timeout, p_lcb); return; @@ -2751,11 +2789,11 @@ void l2cu_no_dynamic_ccbs(tL2C_LCB* p_lcb) { rc = btm_sec_disconnect(p_lcb->Handle(), HCI_ERR_PEER_USER, "stack::l2cap::l2c_utils::l2cu_no_dynamic_ccbs Idle timer popped"); - if (rc == BTM_CMD_STARTED) { + if (rc == tBTM_STATUS::BTM_CMD_STARTED) { l2cu_process_fixed_disc_cback(p_lcb); p_lcb->link_state = LST_DISCONNECTING; timeout_ms = L2CAP_LINK_DISCONNECT_TIMEOUT_MS; - } else if (rc == BTM_SUCCESS) { + } else if (rc == tBTM_STATUS::BTM_SUCCESS) { l2cu_process_fixed_disc_cback(p_lcb); /* BTM SEC will make sure that link is release (probably after pairing is * done) */ diff --git a/system/stack/rfcomm/rfc_event.h b/system/stack/rfcomm/rfc_event.h index 5ba2ad639a..64c4e79d12 100644 --- a/system/stack/rfcomm/rfc_event.h +++ b/system/stack/rfcomm/rfc_event.h @@ -22,13 +22,8 @@ #include "macros.h" -/* - * Events that can be received by multiplexer as well as port state machines - */ +// Events that can be received by both multiplexer or port state machines enum tRFC_EVENT : uint16_t { - /* - * Events that can be received by multiplexer as well as port state machines - */ RFC_EVENT_SABME = 0, RFC_EVENT_UA = 1, RFC_EVENT_DM = 2, @@ -38,13 +33,8 @@ enum tRFC_EVENT : uint16_t { RFC_EVENT_BAD_FRAME = 50, }; -/* - * Multiplexer events - */ +// Multiplexer events enum tRFC_MX_EVENT : uint16_t { - /* - * Multiplexer events - */ RFC_MX_EVENT_SABME = RFC_EVENT_SABME, RFC_MX_EVENT_UA = RFC_EVENT_UA, RFC_MX_EVENT_DM = RFC_EVENT_DM, @@ -62,13 +52,8 @@ enum tRFC_MX_EVENT : uint16_t { RFC_MX_EVENT_DISC_IND = 14, }; -/* - * Port events - */ +// Port events enum tRFC_PORT_EVENT : uint16_t { - /* - * Port events - */ RFC_PORT_EVENT_SABME = RFC_EVENT_SABME, RFC_PORT_EVENT_UA = RFC_EVENT_UA, RFC_PORT_EVENT_DM = RFC_EVENT_DM, diff --git a/system/stack/rfcomm/rfc_mx_fsm.cc b/system/stack/rfcomm/rfc_mx_fsm.cc index 17e82ef091..93db778d1b 100644 --- a/system/stack/rfcomm/rfc_mx_fsm.cc +++ b/system/stack/rfcomm/rfc_mx_fsm.cc @@ -67,8 +67,8 @@ static void rfc_mx_conf_cnf(tRFC_MCB* p_mcb, uint16_t result); void rfc_mx_sm_execute(tRFC_MCB* p_mcb, tRFC_MX_EVENT event, void* p_data) { log::assert_that(p_mcb != nullptr, "NULL mcb for event {}", event); - log::info("RFCOMM peer:{} event:{} state:{}", p_mcb->bd_addr, event, - rfcomm_mx_state_text(static_cast<tRFC_MX_STATE>(p_mcb->state))); + log::info("RFCOMM peer:{} event:{} state:{}", p_mcb->bd_addr, rfcomm_mx_event_text(event), + rfcomm_mx_state_text(p_mcb->state)); switch (p_mcb->state) { case RFC_MX_STATE_IDLE: @@ -100,7 +100,8 @@ void rfc_mx_sm_execute(tRFC_MCB* p_mcb, tRFC_MX_EVENT event, void* p_data) { break; default: - log::error("Received unexpected event:{} in state:{}", event, p_mcb->state); + log::error("Received unexpected event:{} in state:{}", rfcomm_mx_event_text(event), + rfcomm_mx_state_text(p_mcb->state)); } } @@ -160,10 +161,12 @@ void rfc_mx_sm_state_idle(tRFC_MCB* p_mcb, tRFC_MX_EVENT event, void* /* p_data return; default: - log::error("Mx error state {} event {}", p_mcb->state, event); + log::error("Mx error state {} event {}", rfcomm_mx_state_text(p_mcb->state), + rfcomm_mx_event_text(event)); return; } - log::verbose("RFCOMM MX ignored - evt:{} in state:{}", event, p_mcb->state); + log::verbose("RFCOMM MX ignored - evt:{} in state:{}", rfcomm_mx_event_text(event), + rfcomm_mx_state_text(p_mcb->state)); } /******************************************************************************* @@ -177,10 +180,10 @@ void rfc_mx_sm_state_idle(tRFC_MCB* p_mcb, tRFC_MX_EVENT event, void* /* p_data * ******************************************************************************/ void rfc_mx_sm_state_wait_conn_cnf(tRFC_MCB* p_mcb, tRFC_MX_EVENT event, void* p_data) { - log::verbose("evt {}", event); switch (event) { case RFC_MX_EVENT_START_REQ: - log::error("Mx error state {} event {}", p_mcb->state, event); + log::error("Mx error state:{} event:{}", rfcomm_mx_state_text(p_mcb->state), + rfcomm_mx_event_text(event)); return; /* There is some new timing so that Config Ind comes before security is @@ -210,15 +213,15 @@ void rfc_mx_sm_state_wait_conn_cnf(tRFC_MCB* p_mcb, tRFC_MX_EVENT event, void* p if (!L2CA_DisconnectReq(p_mcb->lcid)) { log::warn("Unable to send L2CAP disconnect request peer:{} cid:{}", p_mcb->bd_addr, p_mcb->lcid); - }; + } /* we gave up outgoing connection request then try peer's request */ if (p_mcb->pending_lcid) { uint16_t i; uint8_t handle; - log::verbose("RFCOMM MX retry as acceptor in collision case - evt:{} in state:{}", event, - p_mcb->state); + log::verbose("RFCOMM MX retry as acceptor in collision case - evt:{} in state:{}", + rfcomm_mx_event_text(event), rfcomm_mx_state_text(p_mcb->state)); rfc_save_lcid_mcb(NULL, p_mcb->lcid); p_mcb->lcid = p_mcb->pending_lcid; @@ -243,9 +246,11 @@ void rfc_mx_sm_state_wait_conn_cnf(tRFC_MCB* p_mcb, tRFC_MX_EVENT event, void* p } return; default: - log::error("Received unexpected event:{} in state:{}", event, p_mcb->state); + log::error("Received unexpected event:{} in state:{}", rfcomm_mx_event_text(event), + rfcomm_mx_state_text(p_mcb->state)); } - log::verbose("RFCOMM MX ignored - evt:{} in state:{}", event, p_mcb->state); + log::verbose("RFCOMM MX ignored - evt:{} in state:{}", rfcomm_mx_event_text(event), + rfcomm_mx_state_text(p_mcb->state)); } /******************************************************************************* @@ -259,7 +264,6 @@ void rfc_mx_sm_state_wait_conn_cnf(tRFC_MCB* p_mcb, tRFC_MX_EVENT event, void* p * ******************************************************************************/ void rfc_mx_sm_state_configure(tRFC_MCB* p_mcb, tRFC_MX_EVENT event, void* p_data) { - log::verbose("event {}", event); switch (event) { case RFC_MX_EVENT_START_REQ: case RFC_MX_EVENT_CONN_CNF: @@ -286,14 +290,16 @@ void rfc_mx_sm_state_configure(tRFC_MCB* p_mcb, tRFC_MX_EVENT event, void* p_dat if (!L2CA_DisconnectReq(p_mcb->lcid)) { log::warn("Unable to send L2CAP disconnect request peer:{} cid:{}", p_mcb->bd_addr, p_mcb->lcid); - }; + } PORT_StartCnf(p_mcb, RFCOMM_ERROR); return; default: - log::error("Received unexpected event:{} in state:{}", event, p_mcb->state); + log::error("Received unexpected event:{} in state:{}", rfcomm_mx_event_text(event), + rfcomm_mx_state_text(p_mcb->state)); } - log::verbose("RFCOMM MX ignored - evt:{} in state:{}", event, p_mcb->state); + log::verbose("RFCOMM MX ignored - evt:{} in state:{}", rfcomm_mx_event_text(event), + rfcomm_mx_state_text(p_mcb->state)); } /******************************************************************************* @@ -307,7 +313,6 @@ void rfc_mx_sm_state_configure(tRFC_MCB* p_mcb, tRFC_MX_EVENT event, void* p_dat * ******************************************************************************/ void rfc_mx_sm_sabme_wait_ua(tRFC_MCB* p_mcb, tRFC_MX_EVENT event, void* /* p_data */) { - log::verbose("event {}", event); switch (event) { case RFC_MX_EVENT_START_REQ: case RFC_MX_EVENT_CONN_CNF: @@ -350,14 +355,16 @@ void rfc_mx_sm_sabme_wait_ua(tRFC_MCB* p_mcb, tRFC_MX_EVENT event, void* /* p_da if (!L2CA_DisconnectReq(p_mcb->lcid)) { log::warn("Unable to send L2CAP disconnect request peer:{} cid:{}", p_mcb->bd_addr, p_mcb->lcid); - }; + } PORT_StartCnf(p_mcb, RFCOMM_ERROR); return; default: - log::error("Received unexpected event:{} in state:{}", event, p_mcb->state); + log::error("Received unexpected event:{} in state:{}", rfcomm_mx_event_text(event), + rfcomm_mx_state_text(p_mcb->state)); } - log::verbose("RFCOMM MX ignored - evt:{} in state:{}", event, p_mcb->state); + log::verbose("RFCOMM MX ignored - evt:{} in state:{}", rfcomm_mx_event_text(event), + rfcomm_mx_state_text(p_mcb->state)); } /******************************************************************************* @@ -371,7 +378,6 @@ void rfc_mx_sm_sabme_wait_ua(tRFC_MCB* p_mcb, tRFC_MX_EVENT event, void* /* p_da * ******************************************************************************/ void rfc_mx_sm_state_wait_sabme(tRFC_MCB* p_mcb, tRFC_MX_EVENT event, void* p_data) { - log::verbose("event {}", event); switch (event) { case RFC_MX_EVENT_DISC_IND: p_mcb->state = RFC_MX_STATE_IDLE; @@ -379,8 +385,9 @@ void rfc_mx_sm_state_wait_sabme(tRFC_MCB* p_mcb, tRFC_MX_EVENT event, void* p_da return; case RFC_MX_EVENT_SABME: - /* if we gave up outgoing connection request */ if (p_mcb->pending_lcid) { + // Channel collision case - at this point we gave up as initiator + // and are trying again as acceptor p_mcb->pending_lcid = 0; rfc_send_ua(p_mcb, RFCOMM_MX_DLCI); @@ -416,15 +423,17 @@ void rfc_mx_sm_state_wait_sabme(tRFC_MCB* p_mcb, tRFC_MX_EVENT event, void* p_da if (!L2CA_DisconnectReq(p_mcb->lcid)) { log::warn("Unable to send L2CAP disconnect request peer:{} cid:{}", p_mcb->bd_addr, p_mcb->lcid); - }; + } PORT_CloseInd(p_mcb); return; default: - log::warn("RFCOMM MX ignored - evt:{} in state:{}", event, p_mcb->state); + log::warn("Received unexpected event:{} in state:{}", rfcomm_mx_event_text(event), + rfcomm_mx_state_text(p_mcb->state)); } - log::verbose("RFCOMM MX ignored - evt:{} in state:{}", event, p_mcb->state); + log::verbose("RFCOMM MX ignored - evt:{} in state:{}", rfcomm_mx_event_text(event), + rfcomm_mx_state_text(p_mcb->state)); } /******************************************************************************* @@ -438,8 +447,6 @@ void rfc_mx_sm_state_wait_sabme(tRFC_MCB* p_mcb, tRFC_MX_EVENT event, void* p_da * ******************************************************************************/ void rfc_mx_sm_state_connected(tRFC_MCB* p_mcb, tRFC_MX_EVENT event, void* /* p_data */) { - log::verbose("event {}", event); - switch (event) { case RFC_MX_EVENT_TIMEOUT: case RFC_MX_EVENT_CLOSE_REQ: @@ -461,15 +468,17 @@ void rfc_mx_sm_state_connected(tRFC_MCB* p_mcb, tRFC_MX_EVENT event, void* /* p_ if (!L2CA_DisconnectReq(p_mcb->lcid)) { log::warn("Unable to send L2CAP disconnect request peer:{} cid:{}", p_mcb->bd_addr, p_mcb->lcid); - }; + } } /* notify all ports that connection is gone */ PORT_CloseInd(p_mcb); return; default: - log::error("Received unexpected event:{} in state:{}", event, p_mcb->state); + log::error("Received unexpected event:{} in state:{}", rfcomm_mx_event_text(event), + rfcomm_mx_state_text(p_mcb->state)); } - log::verbose("RFCOMM MX ignored - evt:{} in state:{}", event, p_mcb->state); + log::verbose("RFCOMM MX ignored - evt:{} in state:{}", rfcomm_mx_event_text(event), + rfcomm_mx_state_text(p_mcb->state)); } /******************************************************************************* @@ -484,8 +493,6 @@ void rfc_mx_sm_state_connected(tRFC_MCB* p_mcb, tRFC_MX_EVENT event, void* /* p_ ******************************************************************************/ void rfc_mx_sm_state_disc_wait_ua(tRFC_MCB* p_mcb, tRFC_MX_EVENT event, void* p_data) { BT_HDR* p_buf; - - log::verbose("event {}", event); switch (event) { case RFC_MX_EVENT_UA: case RFC_MX_EVENT_DM: @@ -493,7 +500,7 @@ void rfc_mx_sm_state_disc_wait_ua(tRFC_MCB* p_mcb, tRFC_MX_EVENT event, void* p_ if (!L2CA_DisconnectReq(p_mcb->lcid)) { log::warn("Unable to send L2CAP disconnect request peer:{} cid:{}", p_mcb->bd_addr, p_mcb->lcid); - }; + } if (p_mcb->restart_required) { /* Start Request was received while disconnecting. Execute it again */ @@ -548,9 +555,11 @@ void rfc_mx_sm_state_disc_wait_ua(tRFC_MCB* p_mcb, tRFC_MX_EVENT event, void* p_ case RFC_MX_EVENT_QOS_VIOLATION_IND: break; default: - log::error("Received unexpected event:{} in state:{}", event, p_mcb->state); + log::error("Received unexpected event:{} in state:{}", rfcomm_mx_event_text(event), + rfcomm_mx_state_text(p_mcb->state)); } - log::verbose("RFCOMM MX ignored - evt:{} in state:{}", event, p_mcb->state); + log::verbose("RFCOMM MX ignored - evt:{} in state:{}", rfcomm_mx_event_text(event), + rfcomm_mx_state_text(p_mcb->state)); } void rfc_on_l2cap_error(uint16_t lcid, uint16_t result) { @@ -608,7 +617,7 @@ void rfc_on_l2cap_error(uint16_t lcid, uint16_t result) { if (!L2CA_DisconnectReq(p_mcb->lcid)) { log::warn("Unable to send L2CAP disconnect request peer:{} cid:{}", p_mcb->bd_addr, p_mcb->lcid); - }; + } } rfc_release_multiplexer_channel(p_mcb); } @@ -632,9 +641,9 @@ static void rfc_mx_conf_cnf(tRFC_MCB* p_mcb, uint16_t /* result */) { rfc_timer_start(p_mcb, RFC_T1_TIMEOUT); } else { p_mcb->state = RFC_MX_STATE_WAIT_SABME; - rfc_timer_start(p_mcb, RFCOMM_CONN_TIMEOUT); /* - increased from T2=20 to CONN=120 - to allow the user more than 10 sec to type in the - pin which can be e.g. 16 digits */ + /* increased from T2=20 to CONN=120 to allow user more than 10 sec to type in + * the pin, which can be e.d. 16 digits */ + rfc_timer_start(p_mcb, RFCOMM_CONN_TIMEOUT); } } } diff --git a/system/stack/rfcomm/rfc_port_fsm.cc b/system/stack/rfcomm/rfc_port_fsm.cc index 49d33eec18..f8bffa36cb 100644 --- a/system/stack/rfcomm/rfc_port_fsm.cc +++ b/system/stack/rfcomm/rfc_port_fsm.cc @@ -36,6 +36,7 @@ #include "stack/btm/btm_sec.h" #include "stack/include/bt_hdr.h" #include "stack/include/bt_uuid16.h" +#include "stack/include/btm_status.h" #include "stack/l2cap/l2c_int.h" #include "stack/rfcomm/port_int.h" #include "stack/rfcomm/rfc_int.h" @@ -77,8 +78,8 @@ void rfc_port_sm_execute(tPORT* p_port, tRFC_PORT_EVENT event, void* p_data) { // logs for state RFC_STATE_OPENED handled in rfc_port_sm_opened() if (p_port->rfc.state != RFC_STATE_OPENED) { - log::info("bd_addr:{}, index:{}, state:{}, event:{}", p_port->bd_addr, p_port->handle, - p_port->rfc.state, event); + log::info("bd_addr:{}, handle:{}, state:{}, event:{}", p_port->bd_addr, p_port->handle, + rfcomm_port_state_text(p_port->rfc.state), rfcomm_port_event_text(event)); } switch (p_port->rfc.state) { case RFC_STATE_CLOSED: @@ -151,7 +152,7 @@ void rfc_port_sm_state_closed(tPORT* p_port, tRFC_PORT_EVENT event, void* p_data return; case RFC_PORT_EVENT_DM: - log::warn("RFC_EVENT_DM, index={}", p_port->handle); + log::warn("RFC_EVENT_DM, handle:{}", p_port->handle); rfc_port_closed(p_port); return; @@ -169,10 +170,11 @@ void rfc_port_sm_state_closed(tPORT* p_port, tRFC_PORT_EVENT event, void* p_data log::error("Port error state {} event {}", p_port->rfc.state, event); return; default: - log::error("Received unexpected event:{} in state:{}", event, p_port->rfc.state); + log::error("Received unexpected event:{} in state:{}", rfcomm_port_event_text(event), + rfcomm_port_state_text(p_port->rfc.state)); } - log::warn("Port state closed Event ignored {}", event); + log::warn("Event ignored {}", rfcomm_port_event_text(event)); return; } @@ -190,7 +192,7 @@ void rfc_port_sm_sabme_wait_ua(tPORT* p_port, tRFC_PORT_EVENT event, void* p_dat switch (event) { case RFC_PORT_EVENT_OPEN: case RFC_PORT_EVENT_ESTABLISH_RSP: - log::error("Port error state {} event {}", p_port->rfc.state, event); + log::error("Port error event:{}", event); return; case RFC_PORT_EVENT_CLOSE: @@ -201,7 +203,7 @@ void rfc_port_sm_sabme_wait_ua(tPORT* p_port, tRFC_PORT_EVENT event, void* p_dat return; case RFC_PORT_EVENT_CLEAR: - log::warn("RFC_PORT_EVENT_CLEAR, index={}", p_port->handle); + log::warn("RFC_PORT_EVENT_CLEAR, handle:{}", p_port->handle); rfc_port_closed(p_port); return; @@ -240,7 +242,7 @@ void rfc_port_sm_sabme_wait_ua(tPORT* p_port, tRFC_PORT_EVENT event, void* p_dat return; case RFC_PORT_EVENT_DM: - log::warn("RFC_EVENT_DM, index={}", p_port->handle); + log::warn("RFC_EVENT_DM, handle:{}", p_port->handle); p_port->rfc.p_mcb->is_disc_initiator = true; PORT_DlcEstablishCnf(p_port->rfc.p_mcb, p_port->dlci, p_port->rfc.p_mcb->peer_l2cap_mtu, RFCOMM_ERROR); @@ -248,7 +250,7 @@ void rfc_port_sm_sabme_wait_ua(tPORT* p_port, tRFC_PORT_EVENT event, void* p_dat return; case RFC_PORT_EVENT_DISC: - log::warn("RFC_EVENT_DISC, index={}", p_port->handle); + log::warn("RFC_EVENT_DISC, handle:{}", p_port->handle); rfc_send_ua(p_port->rfc.p_mcb, p_port->dlci); PORT_DlcEstablishCnf(p_port->rfc.p_mcb, p_port->dlci, p_port->rfc.p_mcb->peer_l2cap_mtu, RFCOMM_ERROR); @@ -270,9 +272,10 @@ void rfc_port_sm_sabme_wait_ua(tPORT* p_port, tRFC_PORT_EVENT event, void* p_dat RFCOMM_ERROR); return; default: - log::error("Received unexpected event:{} in state:{}", event, p_port->rfc.state); + log::error("Received unexpected event:{} in state:{}", rfcomm_port_event_text(event), + rfcomm_port_state_text(static_cast<tRFC_PORT_STATE>(p_port->rfc.state))); } - log::warn("Port state sabme_wait_ua Event ignored {}", event); + log::warn("Event ignored {}", rfcomm_port_event_text(event)); } /******************************************************************************* @@ -290,7 +293,7 @@ void rfc_port_sm_sabme_wait_ua(tPORT* p_port, tRFC_PORT_EVENT event, void* p_dat void rfc_port_sm_term_wait_sec_check(tPORT* p_port, tRFC_PORT_EVENT event, void* p_data) { switch (event) { case RFC_PORT_EVENT_SEC_COMPLETE: - if (*((tBTM_STATUS*)p_data) != BTM_SUCCESS) { + if (*((tBTM_STATUS*)p_data) != tBTM_STATUS::BTM_SUCCESS) { log::error("Security check failed result:{} state:{} port_handle:{}", btm_status_text(*((tBTM_STATUS*)p_data)), rfcomm_port_state_text(p_port->rfc.state), p_port->handle); @@ -303,24 +306,25 @@ void rfc_port_sm_term_wait_sec_check(tPORT* p_port, tRFC_PORT_EVENT event, void* } } else { log::debug("Security check succeeded state:{} port_handle:{}", - rfcomm_port_state_text(p_port->rfc.state), p_port->handle); + rfcomm_port_state_text(static_cast<tRFC_PORT_STATE>(p_port->rfc.state)), + p_port->handle); PORT_DlcEstablishInd(p_port->rfc.p_mcb, p_port->dlci, p_port->rfc.p_mcb->peer_l2cap_mtu); } return; case RFC_PORT_EVENT_OPEN: case RFC_PORT_EVENT_CLOSE: - log::error("Port error state {} event {}", p_port->rfc.state, event); + log::error("Port error event {}", rfcomm_port_event_text(event)); return; case RFC_PORT_EVENT_CLEAR: - log::warn("RFC_PORT_EVENT_CLEAR, index={}", p_port->handle); + log::warn("RFC_PORT_EVENT_CLEAR, handle:{}", p_port->handle); btm_sec_abort_access_req(p_port->rfc.p_mcb->bd_addr); rfc_port_closed(p_port); return; case RFC_PORT_EVENT_DATA: - log::error("Port error state Term Wait Sec event Data"); + log::error("Port error event {}", rfcomm_port_event_text(event)); osi_free(p_data); return; @@ -373,9 +377,10 @@ void rfc_port_sm_term_wait_sec_check(tPORT* p_port, tRFC_PORT_EVENT event, void* } return; default: - log::error("Received unexpected event:{} in state:{}", event, p_port->rfc.state); + log::error("Received unexpected event:{} in state:{}", rfcomm_port_event_text(event), + rfcomm_port_state_text(p_port->rfc.state)); } - log::warn("Port state term_wait_sec_check Event ignored {}", event); + log::warn("Event ignored {}", event); } /******************************************************************************* @@ -392,15 +397,15 @@ void rfc_port_sm_term_wait_sec_check(tPORT* p_port, tRFC_PORT_EVENT event, void* void rfc_port_sm_orig_wait_sec_check(tPORT* p_port, tRFC_PORT_EVENT event, void* p_data) { switch (event) { case RFC_PORT_EVENT_SEC_COMPLETE: - if (*((tBTM_STATUS*)p_data) != BTM_SUCCESS) { - log::error("Security check failed result:{} state:{} port_handle:{}", + if (*((tBTM_STATUS*)p_data) != tBTM_STATUS::BTM_SUCCESS) { + log::error("Security check failed result:{} state:{} handle:{}", btm_status_text(*((tBTM_STATUS*)p_data)), rfcomm_port_state_text(p_port->rfc.state), p_port->handle); p_port->rfc.p_mcb->is_disc_initiator = true; PORT_DlcEstablishCnf(p_port->rfc.p_mcb, p_port->dlci, 0, RFCOMM_SECURITY_ERR); rfc_port_closed(p_port); } else { - log::debug("Security check succeeded state:{} port_handle:{}", + log::debug("Security check succeeded state:{} handle:{}", rfcomm_port_state_text(p_port->rfc.state), p_port->handle); rfc_send_sabme(p_port->rfc.p_mcb, p_port->dlci); rfc_port_timer_start(p_port, RFC_PORT_T1_TIMEOUT); @@ -410,17 +415,17 @@ void rfc_port_sm_orig_wait_sec_check(tPORT* p_port, tRFC_PORT_EVENT event, void* case RFC_PORT_EVENT_OPEN: case RFC_PORT_EVENT_SABME: /* Peer should not use the same dlci */ - log::error("Port error state {} event {}", p_port->rfc.state, event); + log::error("Port error event {}", rfcomm_port_event_text(event)); return; case RFC_PORT_EVENT_CLOSE: - log::warn("RFC_PORT_EVENT_CLOSE, index={}", p_port->handle); + log::warn("RFC_PORT_EVENT_CLOSE, handle:{}", p_port->handle); btm_sec_abort_access_req(p_port->rfc.p_mcb->bd_addr); rfc_port_closed(p_port); return; case RFC_PORT_EVENT_DATA: - log::error("Port error state Orig Wait Sec event Data"); + log::error("Port error {}", rfcomm_port_event_text(event)); osi_free(p_data); return; @@ -428,9 +433,10 @@ void rfc_port_sm_orig_wait_sec_check(tPORT* p_port, tRFC_PORT_EVENT event, void* osi_free(p_data); return; default: - log::error("Received unexpected event:{} in state:{}", event, p_port->rfc.state); + log::error("Received unexpected event:{} in state:{}", rfcomm_port_event_text(event), + rfcomm_port_state_text(p_port->rfc.state)); } - log::warn("Port state orig_wait_sec_check Event ignored {}", event); + log::warn("Event ignored {}", rfcomm_port_event_text(event)); } /******************************************************************************* @@ -466,11 +472,9 @@ void rfc_port_sm_opened(tPORT* p_port, tRFC_PORT_EVENT event, void* p_data) { return; case RFC_PORT_EVENT_DATA: - /* Send credits in the frame. Pass them in the layer specific member of - * the hdr. */ - /* There might be an initial case when we reduced rx_max and credit_rx is - * still */ - /* bigger. Make sure that we do not send 255 */ + // Send credits in the frame. Pass them in the layer specific member of the hdr. + // There might be an initial case when we reduced rx_max and credit_rx is still bigger. + // Make sure that we do not send 255 log::verbose("RFC_PORT_EVENT_DATA bd_addr:{} handle:{} dlci:{} scn:{}", p_port->bd_addr, p_port->handle, p_port->dlci, p_port->scn); if ((p_port->rfc.p_mcb->flow == PORT_FC_CREDIT) && @@ -530,11 +534,12 @@ void rfc_port_sm_opened(tPORT* p_port, tRFC_PORT_EVENT event, void* p_data) { return; default: + log::error("Received unexpected event:{} bd_addr:{} handle:{} dlci:{} scn:{}", + rfcomm_port_event_text(event), p_port->bd_addr, p_port->handle, p_port->dlci, + p_port->scn); break; } - log::error("Received unexpected event:{} bd_addr:{} handle:{} dlci:{} scn:{}", - rfcomm_port_event_text(event), p_port->bd_addr, p_port->handle, p_port->dlci, - p_port->scn); + log::warn("Event ignored {}", rfcomm_port_event_text(event)); } /******************************************************************************* @@ -551,11 +556,11 @@ void rfc_port_sm_disc_wait_ua(tPORT* p_port, tRFC_PORT_EVENT event, void* p_data switch (event) { case RFC_PORT_EVENT_OPEN: case RFC_PORT_EVENT_ESTABLISH_RSP: - log::error("Port error state {} event {}", p_port->rfc.state, event); + log::error("Port error event {}", rfcomm_port_event_text(event)); return; case RFC_PORT_EVENT_CLEAR: - log::warn("RFC_PORT_EVENT_CLEAR, index={}", p_port->handle); + log::warn("RFC_PORT_EVENT_CLEAR, handle:{}", p_port->handle); rfc_port_closed(p_port); return; @@ -568,7 +573,7 @@ void rfc_port_sm_disc_wait_ua(tPORT* p_port, tRFC_PORT_EVENT event, void* p_data FALLTHROUGH_INTENDED; /* FALLTHROUGH */ case RFC_PORT_EVENT_DM: - log::warn("RFC_EVENT_DM|RFC_EVENT_UA[{}], index={}", event, p_port->handle); + log::warn("RFC_EVENT_DM|RFC_EVENT_UA[{}], handle:{}", event, p_port->handle); if (com::android::bluetooth::flags::rfcomm_always_disc_initiator_in_disc_wait_ua()) { // If we got a DM in RFC_STATE_DISC_WAIT_UA, it's likely that both ends // attempt to DISC at the same time and both get a DM. @@ -597,14 +602,15 @@ void rfc_port_sm_disc_wait_ua(tPORT* p_port, tRFC_PORT_EVENT event, void* p_data return; case RFC_PORT_EVENT_TIMEOUT: - log::error("RFC_EVENT_TIMEOUT, index={}", p_port->handle); + log::error("RFC_EVENT_TIMEOUT, handle:{}", p_port->handle); rfc_port_closed(p_port); return; default: - log::error("Received unexpected event:{} in state:{}", event, p_port->rfc.state); + log::error("Received unexpected event:{} in state:{}", rfcomm_port_event_text(event), + rfcomm_port_state_text(p_port->rfc.state)); } - log::warn("Port state disc_wait_ua Event ignored {}", event); + log::warn("Event ignored {}", rfcomm_port_event_text(event)); } /******************************************************************************* @@ -696,15 +702,14 @@ void rfc_process_rpn(tRFC_MCB* p_mcb, bool is_command, bool is_request, MX_FRAME return; } - /* If we are not awaiting response just ignore it */ + // If we are not awaiting response just ignore it p_port = port_find_mcb_dlci_port(p_mcb, p_frame->dlci); if ((p_port == nullptr) || !(p_port->rfc.expected_rsp & (RFC_RSP_RPN | RFC_RSP_RPN_REPLY))) { log::warn("ignore DLC parameter negotiation as we are not waiting for any"); return; } - /* If we sent a request for port parameters to the peer it is replying with */ - /* mask 0. */ + // If we sent a request for port parameters to the peer it is replying with mask 0. rfc_port_timer_stop(p_port); if (p_port->rfc.expected_rsp & RFC_RSP_RPN_REPLY) { diff --git a/system/stack/rfcomm/rfc_state.h b/system/stack/rfcomm/rfc_state.h index eb74746960..32afa29967 100644 --- a/system/stack/rfcomm/rfc_state.h +++ b/system/stack/rfcomm/rfc_state.h @@ -20,9 +20,7 @@ #include "macros.h" -/* - * Define states and events for the RFC multiplexer state machine - */ +// Multiplexer states typedef enum : uint16_t { RFC_MX_STATE_IDLE = 0, RFC_MX_STATE_WAIT_CONN_CNF = 1, @@ -33,9 +31,7 @@ typedef enum : uint16_t { RFC_MX_STATE_DISC_WAIT_UA = 6, } tRFC_MX_STATE; -/* - * Define port states - */ +// Port states typedef enum : uint8_t { RFC_STATE_CLOSED = 0, RFC_STATE_SABME_WAIT_UA = 1, diff --git a/system/stack/rnr/remote_name_request.cc b/system/stack/rnr/remote_name_request.cc index f71cd8fd18..acb938ef38 100644 --- a/system/stack/rnr/remote_name_request.cc +++ b/system/stack/rnr/remote_name_request.cc @@ -19,13 +19,22 @@ #include <bluetooth/log.h> #include <com_android_bluetooth_flags.h> +#include "btif/include/btif_config.h" +#include "main/shim/acl_api.h" #include "stack/btm/btm_dev.h" #include "stack/btm/btm_int_types.h" +#include "stack/btm/btm_sec.h" #include "stack/btm/security_device_record.h" +#include "stack/include/btm_client_interface.h" extern tBTM_CB btm_cb; using namespace bluetooth; +tBTM_STATUS btm_ble_read_remote_name(const RawAddress& remote_bda, tBTM_NAME_CMPL_CB* p_cb); +bool btm_ble_cancel_remote_name(const RawAddress& remote_bda); +void btm_ble_read_remote_name_cmpl(bool status, const RawAddress& bda, uint16_t length, + char* p_name); + bool BTM_SecAddRmtNameNotifyCallback(tBTM_RMT_NAME_CALLBACK* p_callback) { int i; @@ -56,3 +65,267 @@ bool BTM_IsRemoteNameKnown(const RawAddress& bd_addr, tBT_TRANSPORT /* transport tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev(bd_addr); return (p_dev_rec == nullptr) ? false : p_dev_rec->sec_rec.is_name_known(); } + +/******************************************************************************* + * + * Function btm_inq_rmt_name_failed_cancelled + * + * Description This function is if timeout expires or request is cancelled + * while getting remote name. This is done for devices that + * incorrectly do not report operation failure + * + * Returns void + * + ******************************************************************************/ +void btm_inq_rmt_name_failed_cancelled(void) { + log::error("remname_active={}", btm_cb.rnr.remname_active); + + if (btm_cb.rnr.remname_active) { + btm_process_remote_name(&btm_cb.rnr.remname_bda, NULL, 0, HCI_ERR_UNSPECIFIED); + } + + btm_sec_rmt_name_request_complete(NULL, NULL, HCI_ERR_UNSPECIFIED); +} + +void btm_inq_remote_name_timer_timeout(void* /* data */) { btm_inq_rmt_name_failed_cancelled(); } + +/******************************************************************************* + * + * Function btm_initiate_rem_name + * + * Description This function looks initiates a remote name request. It is + * called either by GAP or by the API call + * BTM_ReadRemoteDeviceName. + * + * Input Params: remote_bda: Remote address to execute RNR + * timeout_ms: Internal timeout to await response + * * p_cb: Callback function called when + * tBTM_STATUS::BTM_CMD_STARTED is returned. + * A pointer to tBTM_REMOTE_DEV_NAME is + * passed to the callback. + * + * Returns + * tBTM_STATUS::BTM_CMD_STARTED is returned if the request was sent to HCI. + * and the callback will be called. + * BTM_BUSY if already in progress + * BTM_NO_RESOURCES if could not allocate resources to start + * the command + * BTM_WRONG_MODE if the device is not up. + * + ******************************************************************************/ +static uint16_t get_clock_offset_from_storage(const RawAddress& remote_bda) { + int clock_offset_in_cfg = 0; + return btif_get_device_clockoffset(remote_bda, &clock_offset_in_cfg) + ? static_cast<uint16_t>(clock_offset_in_cfg) + : 0; +} + +tBTM_STATUS btm_initiate_rem_name(const RawAddress& remote_bda, uint64_t timeout_ms, + tBTM_NAME_CMPL_CB* p_cb) { + /*** Make sure the device is ready ***/ + if (!get_btm_client_interface().local.BTM_IsDeviceUp()) { + return BTM_WRONG_MODE; + } + if (btm_cb.rnr.remname_active) { + return BTM_BUSY; + } + + uint16_t clock_offset = get_clock_offset_from_storage(remote_bda); + uint8_t page_scan_rep_mode = HCI_PAGE_SCAN_REP_MODE_R1; + uint8_t page_scan_mode = HCI_MANDATARY_PAGE_SCAN_MODE; + + /* If the database entry exists for the device, use its clock offset */ + tINQ_DB_ENT* p_i = btm_inq_db_find(remote_bda); + if (p_i && (p_i->inq_info.results.inq_result_type & BT_DEVICE_TYPE_BREDR)) { + tBTM_INQ_INFO* p_cur = &p_i->inq_info; + clock_offset = p_cur->results.clock_offset | BTM_CLOCK_OFFSET_VALID; + if (0 == (p_cur->results.clock_offset & BTM_CLOCK_OFFSET_VALID)) { + clock_offset = get_clock_offset_from_storage(remote_bda); + } + page_scan_rep_mode = p_cur->results.page_scan_rep_mode; + if (com::android::bluetooth::flags::rnr_validate_page_scan_repetition_mode() && + page_scan_rep_mode >= HCI_PAGE_SCAN_REP_MODE_RESERVED_START) { + log::info( + "Invalid page scan repetition mode {} from remote_bda:{}, " + "fallback to R1", + page_scan_rep_mode, remote_bda); + page_scan_rep_mode = HCI_PAGE_SCAN_REP_MODE_R1; + } + page_scan_mode = p_cur->results.page_scan_mode; + } + + bluetooth::shim::ACL_RemoteNameRequest(remote_bda, page_scan_rep_mode, page_scan_mode, + clock_offset); + + btm_cb.rnr.p_remname_cmpl_cb = p_cb; + btm_cb.rnr.remname_bda = remote_bda; + btm_cb.rnr.remname_dev_type = BT_DEVICE_TYPE_BREDR; + btm_cb.rnr.remname_active = true; + + alarm_set_on_mloop(btm_cb.rnr.remote_name_timer, timeout_ms, btm_inq_remote_name_timer_timeout, + NULL); + + return tBTM_STATUS::BTM_CMD_STARTED; +} + +/******************************************************************************* + * + * Function btm_process_remote_name + * + * Description This function is called when a remote name is received from + * the device. If remote names are cached, it updates the + * inquiry database. + * + * Returns void + * + ******************************************************************************/ +void btm_process_remote_name(const RawAddress* bda, const BD_NAME bdn, uint16_t /* evt_len */, + tHCI_STATUS hci_status) { + tBTM_REMOTE_DEV_NAME rem_name = { + .btm_status = BTM_BAD_VALUE_RET, + .bd_addr = bda ? *bda : RawAddress::kEmpty, + .remote_bd_name = {}, + .hci_status = hci_status, + }; + + bool on_le_link; + if (com::android::bluetooth::flags::rnr_store_device_type()) { + on_le_link = (btm_cb.rnr.remname_dev_type == BT_DEVICE_TYPE_BLE); + } else { + on_le_link = get_btm_client_interface().ble.BTM_UseLeLink(btm_cb.rnr.remname_bda); + } + + /* If the inquire BDA and remote DBA are the same, then stop the timer and set + * the active to false */ + if (btm_cb.rnr.remname_active) { + if (rem_name.bd_addr == RawAddress::kEmpty || rem_name.bd_addr == btm_cb.rnr.remname_bda) { + log::info("RNR received expected name bd_addr:{} hci_status:{} le_link:{}", + rem_name.bd_addr.ToRedactedStringForLogging(), hci_status_code_text(hci_status), + on_le_link); + + if (on_le_link && hci_status == HCI_ERR_UNSPECIFIED) { + btm_ble_cancel_remote_name(btm_cb.rnr.remname_bda); + } + alarm_cancel(btm_cb.rnr.remote_name_timer); + /* Clean up and return the status if the command was not successful */ + /* Note: If part of the inquiry, the name is not stored, and the */ + /* inquiry complete callback is called. */ + + if (hci_status == HCI_SUCCESS) { + /* Copy the name from the data stream into the return structure */ + /* Note that even if it is not being returned, it is used as a */ + /* temporary buffer. */ + rem_name.btm_status = BTM_SUCCESS; + if (bdn) { + bd_name_copy(rem_name.remote_bd_name, bdn); + } else { + log::warn("Received null name from remote device bd_addr:{}", + rem_name.bd_addr.ToRedactedStringForLogging()); + } + } + /* Reset the remote BDA and call callback if possible */ + btm_cb.rnr.remname_active = false; + btm_cb.rnr.remname_bda = RawAddress::kEmpty; + btm_cb.rnr.remname_dev_type = BT_DEVICE_TYPE_UNKNOWN; + + tBTM_NAME_CMPL_CB* p_cb = btm_cb.rnr.p_remname_cmpl_cb; + btm_cb.rnr.p_remname_cmpl_cb = nullptr; + if (p_cb) { + (p_cb)(&rem_name); + } + } else { + log::warn("RNR received UNKNOWN name bd_addr:{} hci_status:{} le_link:{}", + rem_name.bd_addr.ToRedactedStringForLogging(), hci_status_code_text(hci_status), + on_le_link); + } + } else { + log::info( + "RNR received UNEXPECTED name bd_addr:{} inq_addr:{} hci_status:{} " + "le_link:{} rnr_active:{}", + rem_name.bd_addr.ToRedactedStringForLogging(), + btm_cb.rnr.remname_bda.ToRedactedStringForLogging(), hci_status_code_text(hci_status), + on_le_link, btm_cb.rnr.remname_active); + } +} + +/******************************************************************************* + * + * Function BTM_ReadRemoteDeviceName + * + * Description This function initiates a remote device HCI command to the + * controller and calls the callback when the process has + * completed. + * + * Input Params: remote_bda - device address of name to retrieve + * p_cb - callback function called when + * tBTM_STATUS::BTM_CMD_STARTED is returned. + * A pointer to tBTM_REMOTE_DEV_NAME is + * passed to the callback. + * + * Returns + * tBTM_STATUS::BTM_CMD_STARTED is returned if the request was successfully + * sent to HCI. + * BTM_BUSY if already in progress + * BTM_UNKNOWN_ADDR if device address is bad + * BTM_NO_RESOURCES if could not allocate resources to start + * the command + * BTM_WRONG_MODE if the device is not up. + * + ******************************************************************************/ +#define BTM_EXT_RMT_NAME_TIMEOUT_MS (40 * 1000) /* 40 seconds */ +tBTM_STATUS BTM_ReadRemoteDeviceName(const RawAddress& remote_bda, tBTM_NAME_CMPL_CB* p_cb, + tBT_TRANSPORT transport) { + log::verbose("bd addr {}", remote_bda); + /* Use LE transport when LE is the only available option */ + if (transport == BT_TRANSPORT_LE) { + return btm_ble_read_remote_name(remote_bda, p_cb); + } + /* Use classic transport for BR/EDR and Dual Mode devices */ + return btm_initiate_rem_name(remote_bda, BTM_EXT_RMT_NAME_TIMEOUT_MS, p_cb); +} + +/******************************************************************************* + * + * Function BTM_CancelRemoteDeviceName + * + * Description This function initiates the cancel request for the specified + * remote device. + * + * Input Params: None + * + * Returns + * tBTM_STATUS::BTM_CMD_STARTED is returned if the request was successfully + * sent to HCI. + * BTM_NO_RESOURCES if could not allocate resources to start + * the command + * BTM_WRONG_MODE if there is not an active remote name + * request. + * + ******************************************************************************/ +tBTM_STATUS BTM_CancelRemoteDeviceName(void) { + log::verbose(""); + bool is_le; + + /* Make sure there is not already one in progress */ + if (!btm_cb.rnr.remname_active) { + return BTM_WRONG_MODE; + } + + if (com::android::bluetooth::flags::rnr_store_device_type()) { + is_le = (btm_cb.rnr.remname_dev_type == BT_DEVICE_TYPE_BLE); + } else { + is_le = get_btm_client_interface().ble.BTM_UseLeLink(btm_cb.rnr.remname_bda); + } + + if (is_le) { + /* Cancel remote name request for LE device, and process remote name + * callback. */ + btm_inq_rmt_name_failed_cancelled(); + } else { + bluetooth::shim::ACL_CancelRemoteNameRequest(btm_cb.rnr.remname_bda); + if (com::android::bluetooth::flags::rnr_reset_state_at_cancel()) { + btm_process_remote_name(&btm_cb.rnr.remname_bda, nullptr, 0, HCI_ERR_UNSPECIFIED); + } + } + return tBTM_STATUS::BTM_CMD_STARTED; +} diff --git a/system/stack/rnr/remote_name_request.h b/system/stack/rnr/remote_name_request.h index 165d1dccd9..c4d1f0b9e4 100644 --- a/system/stack/rnr/remote_name_request.h +++ b/system/stack/rnr/remote_name_request.h @@ -24,12 +24,12 @@ #include "types/raw_address.h" /* Structure returned with remote name request */ -typedef struct { - tBTM_STATUS status; +struct tBTM_REMOTE_DEV_NAME { + tBTM_STATUS btm_status; RawAddress bd_addr; BD_NAME remote_bd_name; tHCI_STATUS hci_status; -} tBTM_REMOTE_DEV_NAME; +}; typedef void(tBTM_NAME_CMPL_CB)(const tBTM_REMOTE_DEV_NAME*); @@ -96,3 +96,64 @@ bool BTM_SecDeleteRmtNameNotifyCallback(tBTM_RMT_NAME_CALLBACK* p_callback); * ******************************************************************************/ bool BTM_IsRemoteNameKnown(const RawAddress& bd_addr, tBT_TRANSPORT transport); + +/******************************************************************************* + * + * Function BTM_ReadRemoteDeviceName + * + * Description This function initiates a remote device HCI command to the + * controller and calls the callback when the process has + * completed. + * + * Input Params: remote_bda - bluetooth device address of name to + * retrieve + * p_cb - callback function called when + * remote name is received or when procedure + * timed out. + * transport - transport used to query the remote name + * Returns + * tBTM_STATUS::BTM_CMD_STARTED is returned if the request was successfully + * sent to HCI. + * BTM_BUSY if already in progress + * BTM_UNKNOWN_ADDR if device address is bad + * BTM_NO_RESOURCES if could not allocate resources to start + * the command + * BTM_WRONG_MODE if the device is not up. + * + ******************************************************************************/ +tBTM_STATUS BTM_ReadRemoteDeviceName(const RawAddress& remote_bda, tBTM_NAME_CMPL_CB* p_cb, + tBT_TRANSPORT transport); + +/******************************************************************************* + * + * Function BTM_CancelRemoteDeviceName + * + * Description This function initiates the cancel request for the specified + * remote device. + * + * Input Params: None + * + * Returns + * tBTM_STATUS::BTM_CMD_STARTED is returned if the request was successfully + * sent to HCI. + * BTM_NO_RESOURCES if could not allocate resources to start + * the command + * BTM_WRONG_MODE if there is not an active remote name + * request. + * + ******************************************************************************/ +tBTM_STATUS BTM_CancelRemoteDeviceName(void); + +/******************************************************************************* + * + * Function btm_process_remote_name + * + * Description This function is called when a remote name is received from + * the device. If remote names are cached, it updates the + * inquiry database. + * + * Returns void + * + ******************************************************************************/ +void btm_process_remote_name(const RawAddress* bda, const BD_NAME bdn, uint16_t /* evt_len */, + tHCI_STATUS hci_status); diff --git a/system/stack/sdp/internal/sdp_api.h b/system/stack/sdp/internal/sdp_api.h index 85e34bfb4a..f803923972 100644 --- a/system/stack/sdp/internal/sdp_api.h +++ b/system/stack/sdp/internal/sdp_api.h @@ -382,7 +382,7 @@ bool SDP_AddServiceClassIdList(uint32_t handle, uint16_t num_services, uint16_t* * * Description This function adds a DI record to the local SDP database. * - * Returns Returns SDP_SUCCESS if record added successfully, else error + * Returns Returns tSDP_STATUS::SDP_SUCCESS if record added successfully, else error * ******************************************************************************/ tSDP_STATUS SDP_SetLocalDiRecord(const tSDP_DI_RECORD* device_info, uint32_t* p_handle); @@ -393,7 +393,7 @@ tSDP_STATUS SDP_SetLocalDiRecord(const tSDP_DI_RECORD* device_info, uint32_t* p_ * * Description This function queries a remote device for DI information. * - * Returns SDP_SUCCESS if query started successfully, else error + * Returns tSDP_STATUS::SDP_SUCCESS if query started successfully, else error * ******************************************************************************/ tSDP_STATUS SDP_DiDiscover(const RawAddress& remote_device, tSDP_DISCOVERY_DB* p_db, uint32_t len, diff --git a/system/stack/sdp/sdp_api.cc b/system/stack/sdp/sdp_api.cc index 391b285698..fdb753ae02 100644 --- a/system/stack/sdp/sdp_api.cc +++ b/system/stack/sdp/sdp_api.cc @@ -126,7 +126,7 @@ bool SDP_CancelServiceSearch(const tSDP_DISCOVERY_DB* p_db) { return false; } - sdp_disconnect(p_ccb, SDP_CANCEL); + sdp_disconnect(p_ccb, tSDP_STATUS::SDP_CANCEL); p_ccb->disc_state = SDP_DISC_WAIT_CANCEL; return true; } @@ -731,12 +731,12 @@ bool SDP_FindProfileVersionInRec(const tSDP_DISC_REC* p_rec, uint16_t profile_uu * * Description This function queries a remote device for DI information. * - * Returns SDP_SUCCESS if query started successfully, else error + * Returns tSDP_STATUS::SDP_SUCCESS if query started successfully, else error * ******************************************************************************/ tSDP_STATUS SDP_DiDiscover(const RawAddress& remote_device, tSDP_DISCOVERY_DB* p_db, uint32_t len, tSDP_DISC_CMPL_CB* p_cb) { - tSDP_STATUS result = SDP_DI_DISC_FAILED; + tSDP_STATUS result = tSDP_STATUS::SDP_DI_DISC_FAILED; uint16_t num_uuids = 1; uint16_t di_uuid = UUID_SERVCLASS_PNP_INFORMATION; @@ -745,7 +745,7 @@ tSDP_STATUS SDP_DiDiscover(const RawAddress& remote_device, tSDP_DISCOVERY_DB* p if (SDP_InitDiscoveryDb(p_db, len, num_uuids, &init_uuid, 0, NULL)) { if (SDP_ServiceSearchRequest(remote_device, p_db, p_cb)) { - result = SDP_SUCCESS; + result = tSDP_STATUS::SDP_SUCCESS; } } @@ -818,12 +818,12 @@ static void SDP_AttrStringCopy(char* dst, const tSDP_DISC_ATTR* p_attr, uint16_t * Description This function retrieves a remote device's DI record from * the specified database. * - * Returns SDP_SUCCESS if record retrieved, else error + * Returns tSDP_STATUS::SDP_SUCCESS if record retrieved, else error * ******************************************************************************/ tSDP_STATUS SDP_GetDiRecord(uint8_t get_record_index, tSDP_DI_GET_RECORD* p_device_info, const tSDP_DISCOVERY_DB* p_db) { - tSDP_STATUS result = SDP_NO_DI_RECORD_FOUND; + tSDP_STATUS result = tSDP_STATUS::SDP_NO_DI_RECORD_FOUND; uint8_t curr_record_index = 1; tSDP_DISC_REC* p_curr_record = NULL; @@ -833,13 +833,13 @@ tSDP_STATUS SDP_GetDiRecord(uint8_t get_record_index, tSDP_DI_GET_RECORD* p_devi p_curr_record = SDP_FindServiceInDb(p_db, UUID_SERVCLASS_PNP_INFORMATION, p_curr_record); if (p_curr_record) { if (curr_record_index++ == get_record_index) { - result = SDP_SUCCESS; + result = tSDP_STATUS::SDP_SUCCESS; break; } } } while (p_curr_record); - if (result == SDP_SUCCESS) { + if (result == tSDP_STATUS::SDP_SUCCESS) { /* copy the information from the SDP record to the DI record */ tSDP_DISC_ATTR* p_curr_attr = NULL; @@ -864,7 +864,7 @@ tSDP_STATUS SDP_GetDiRecord(uint8_t get_record_index, tSDP_DI_GET_RECORD* p_devi SDP_DISC_ATTR_LEN(p_curr_attr->attr_len_type) >= 2) { p_device_info->spec_id = p_curr_attr->attr_value.v.u16; } else { - result = SDP_ERR_ATTR_NOT_PRESENT; + result = tSDP_STATUS::SDP_ERR_ATTR_NOT_PRESENT; } p_curr_attr = SDP_FindAttributeInRec(p_curr_record, ATTR_ID_VENDOR_ID); @@ -872,7 +872,7 @@ tSDP_STATUS SDP_GetDiRecord(uint8_t get_record_index, tSDP_DI_GET_RECORD* p_devi SDP_DISC_ATTR_LEN(p_curr_attr->attr_len_type) >= 2) { p_device_info->rec.vendor = p_curr_attr->attr_value.v.u16; } else { - result = SDP_ERR_ATTR_NOT_PRESENT; + result = tSDP_STATUS::SDP_ERR_ATTR_NOT_PRESENT; } p_curr_attr = SDP_FindAttributeInRec(p_curr_record, ATTR_ID_VENDOR_ID_SOURCE); @@ -880,7 +880,7 @@ tSDP_STATUS SDP_GetDiRecord(uint8_t get_record_index, tSDP_DI_GET_RECORD* p_devi SDP_DISC_ATTR_LEN(p_curr_attr->attr_len_type) >= 2) { p_device_info->rec.vendor_id_source = p_curr_attr->attr_value.v.u16; } else { - result = SDP_ERR_ATTR_NOT_PRESENT; + result = tSDP_STATUS::SDP_ERR_ATTR_NOT_PRESENT; } p_curr_attr = SDP_FindAttributeInRec(p_curr_record, ATTR_ID_PRODUCT_ID); @@ -888,7 +888,7 @@ tSDP_STATUS SDP_GetDiRecord(uint8_t get_record_index, tSDP_DI_GET_RECORD* p_devi SDP_DISC_ATTR_LEN(p_curr_attr->attr_len_type) >= 2) { p_device_info->rec.product = p_curr_attr->attr_value.v.u16; } else { - result = SDP_ERR_ATTR_NOT_PRESENT; + result = tSDP_STATUS::SDP_ERR_ATTR_NOT_PRESENT; } p_curr_attr = SDP_FindAttributeInRec(p_curr_record, ATTR_ID_PRODUCT_VERSION); @@ -896,7 +896,7 @@ tSDP_STATUS SDP_GetDiRecord(uint8_t get_record_index, tSDP_DI_GET_RECORD* p_devi SDP_DISC_ATTR_LEN(p_curr_attr->attr_len_type) >= 2) { p_device_info->rec.version = p_curr_attr->attr_value.v.u16; } else { - result = SDP_ERR_ATTR_NOT_PRESENT; + result = tSDP_STATUS::SDP_ERR_ATTR_NOT_PRESENT; } p_curr_attr = SDP_FindAttributeInRec(p_curr_record, ATTR_ID_PRIMARY_RECORD); @@ -904,7 +904,7 @@ tSDP_STATUS SDP_GetDiRecord(uint8_t get_record_index, tSDP_DI_GET_RECORD* p_devi SDP_DISC_ATTR_LEN(p_curr_attr->attr_len_type) >= 1) { p_device_info->rec.primary_record = (bool)p_curr_attr->attr_value.v.u8; } else { - result = SDP_ERR_ATTR_NOT_PRESENT; + result = tSDP_STATUS::SDP_ERR_ATTR_NOT_PRESENT; } } @@ -923,11 +923,11 @@ tSDP_STATUS SDP_GetDiRecord(uint8_t get_record_index, tSDP_DI_GET_RECORD* p_devi * * * - * Returns Returns SDP_SUCCESS if record added successfully, else error + * Returns Returns tSDP_STATUS::SDP_SUCCESS if record added successfully, else error * ******************************************************************************/ tSDP_STATUS SDP_SetLocalDiRecord(const tSDP_DI_RECORD* p_device_info, uint32_t* p_handle) { - tSDP_STATUS result = SDP_SUCCESS; + tSDP_STATUS result = tSDP_STATUS::SDP_SUCCESS; uint32_t handle; uint16_t di_uuid = UUID_SERVCLASS_PNP_INFORMATION; uint16_t di_specid = BLUETOOTH_DI_SPECIFICATION; @@ -937,7 +937,7 @@ tSDP_STATUS SDP_SetLocalDiRecord(const tSDP_DI_RECORD* p_device_info, uint32_t* *p_handle = 0; if (p_device_info == NULL) { - return SDP_ILLEGAL_PARAMETER; + return tSDP_STATUS::SDP_ILLEGAL_PARAMETER; } /* if record is to be primary record, get handle to replace old primary */ @@ -946,7 +946,7 @@ tSDP_STATUS SDP_SetLocalDiRecord(const tSDP_DI_RECORD* p_device_info, uint32_t* } else { handle = SDP_CreateRecord(); if (handle == 0) { - return SDP_NO_RESOURCES; + return tSDP_STATUS::SDP_NO_RESOURCES; } } @@ -955,104 +955,104 @@ tSDP_STATUS SDP_SetLocalDiRecord(const tSDP_DI_RECORD* p_device_info, uint32_t* /* build the SDP entry */ /* Add the UUID to the Service Class ID List */ if (!(SDP_AddServiceClassIdList(handle, 1, &di_uuid))) { - result = SDP_DI_REG_FAILED; + result = tSDP_STATUS::SDP_DI_REG_FAILED; } /* mandatory */ - if (result == SDP_SUCCESS) { + if (result == tSDP_STATUS::SDP_SUCCESS) { p_temp = temp_u16; UINT16_TO_BE_STREAM(p_temp, di_specid); if (!(SDP_AddAttribute(handle, ATTR_ID_SPECIFICATION_ID, UINT_DESC_TYPE, sizeof(di_specid), temp_u16))) { - result = SDP_DI_REG_FAILED; + result = tSDP_STATUS::SDP_DI_REG_FAILED; } } /* optional - if string is null, do not add attribute */ - if (result == SDP_SUCCESS) { + if (result == tSDP_STATUS::SDP_SUCCESS) { if (p_device_info->client_executable_url[0] != '\0') { if (!((strlen(p_device_info->client_executable_url) + 1 <= SDP_MAX_ATTR_LEN) && SDP_AddAttribute(handle, ATTR_ID_CLIENT_EXE_URL, URL_DESC_TYPE, (uint32_t)(strlen(p_device_info->client_executable_url) + 1), (uint8_t*)p_device_info->client_executable_url))) { - result = SDP_DI_REG_FAILED; + result = tSDP_STATUS::SDP_DI_REG_FAILED; } } } /* optional - if string is null, do not add attribute */ - if (result == SDP_SUCCESS) { + if (result == tSDP_STATUS::SDP_SUCCESS) { if (p_device_info->service_description[0] != '\0') { if (!((strlen(p_device_info->service_description) + 1 <= SDP_MAX_ATTR_LEN) && SDP_AddAttribute(handle, ATTR_ID_SERVICE_DESCRIPTION, TEXT_STR_DESC_TYPE, (uint32_t)(strlen(p_device_info->service_description) + 1), (uint8_t*)p_device_info->service_description))) { - result = SDP_DI_REG_FAILED; + result = tSDP_STATUS::SDP_DI_REG_FAILED; } } } /* optional - if string is null, do not add attribute */ - if (result == SDP_SUCCESS) { + if (result == tSDP_STATUS::SDP_SUCCESS) { if (p_device_info->documentation_url[0] != '\0') { if (!((strlen(p_device_info->documentation_url) + 1 <= SDP_MAX_ATTR_LEN) && SDP_AddAttribute(handle, ATTR_ID_DOCUMENTATION_URL, URL_DESC_TYPE, (uint32_t)(strlen(p_device_info->documentation_url) + 1), (uint8_t*)p_device_info->documentation_url))) { - result = SDP_DI_REG_FAILED; + result = tSDP_STATUS::SDP_DI_REG_FAILED; } } } /* mandatory */ - if (result == SDP_SUCCESS) { + if (result == tSDP_STATUS::SDP_SUCCESS) { p_temp = temp_u16; UINT16_TO_BE_STREAM(p_temp, p_device_info->vendor); if (!(SDP_AddAttribute(handle, ATTR_ID_VENDOR_ID, UINT_DESC_TYPE, sizeof(p_device_info->vendor), temp_u16))) { - result = SDP_DI_REG_FAILED; + result = tSDP_STATUS::SDP_DI_REG_FAILED; } } /* mandatory */ - if (result == SDP_SUCCESS) { + if (result == tSDP_STATUS::SDP_SUCCESS) { p_temp = temp_u16; UINT16_TO_BE_STREAM(p_temp, p_device_info->product); if (!(SDP_AddAttribute(handle, ATTR_ID_PRODUCT_ID, UINT_DESC_TYPE, sizeof(p_device_info->product), temp_u16))) { - result = SDP_DI_REG_FAILED; + result = tSDP_STATUS::SDP_DI_REG_FAILED; } } /* mandatory */ - if (result == SDP_SUCCESS) { + if (result == tSDP_STATUS::SDP_SUCCESS) { p_temp = temp_u16; UINT16_TO_BE_STREAM(p_temp, p_device_info->version); if (!(SDP_AddAttribute(handle, ATTR_ID_PRODUCT_VERSION, UINT_DESC_TYPE, sizeof(p_device_info->version), temp_u16))) { - result = SDP_DI_REG_FAILED; + result = tSDP_STATUS::SDP_DI_REG_FAILED; } } /* mandatory */ - if (result == SDP_SUCCESS) { + if (result == tSDP_STATUS::SDP_SUCCESS) { u8 = (uint8_t)p_device_info->primary_record; if (!(SDP_AddAttribute(handle, ATTR_ID_PRIMARY_RECORD, BOOLEAN_DESC_TYPE, 1, &u8))) { - result = SDP_DI_REG_FAILED; + result = tSDP_STATUS::SDP_DI_REG_FAILED; } } /* mandatory */ - if (result == SDP_SUCCESS) { + if (result == tSDP_STATUS::SDP_SUCCESS) { p_temp = temp_u16; UINT16_TO_BE_STREAM(p_temp, p_device_info->vendor_id_source); if (!(SDP_AddAttribute(handle, ATTR_ID_VENDOR_ID_SOURCE, UINT_DESC_TYPE, sizeof(p_device_info->vendor_id_source), temp_u16))) { - result = SDP_DI_REG_FAILED; + result = tSDP_STATUS::SDP_DI_REG_FAILED; } } - if (result != SDP_SUCCESS) { + if (result != tSDP_STATUS::SDP_SUCCESS) { SDP_DeleteRecord(handle); } else if (p_device_info->primary_record) { sdp_cb.server_db.di_primary_handle = handle; diff --git a/system/stack/sdp/sdp_discovery.cc b/system/stack/sdp/sdp_discovery.cc index dbdc8a6d5c..25b65b90b0 100644 --- a/system/stack/sdp/sdp_discovery.cc +++ b/system/stack/sdp/sdp_discovery.cc @@ -150,6 +150,8 @@ static void sdp_snd_service_search_req(tCONN_CB* p_ccb, uint8_t cont_len, uint8_ bytes_left -= base_bytes; + log::assert_that(p_ccb->p_db != nullptr, "SDP database has not been set"); + /* Build the UID sequence. */ p = sdpu_build_uuid_seq(p, p_ccb->p_db->num_uuid_filters, p_ccb->p_db->uuid_filters, bytes_left); @@ -590,7 +592,7 @@ static void process_service_search_attr_rsp(tCONN_CB* p_ccb, uint8_t* p_reply, /* If p_reply is NULL, we were called for the initial read */ if (p_reply) { if (p_reply + 4 /* transaction ID and length */ + sizeof(lists_byte_count) > p_reply_end) { - sdp_disconnect(p_ccb, SDP_INVALID_PDU_SIZE); + sdp_disconnect(p_ccb, tSDP_STATUS::SDP_INVALID_PDU_SIZE); return; } @@ -602,12 +604,12 @@ static void process_service_search_attr_rsp(tCONN_CB* p_ccb, uint8_t* p_reply, /* Copy the response to the scratchpad. First, a safety check on the length */ if ((p_ccb->list_len + lists_byte_count) > SDP_MAX_LIST_BYTE_COUNT) { - sdp_disconnect(p_ccb, SDP_INVALID_PDU_SIZE); + sdp_disconnect(p_ccb, tSDP_STATUS::SDP_INVALID_PDU_SIZE); return; } if (p_reply + lists_byte_count + 1 /* continuation */ > p_reply_end) { - sdp_disconnect(p_ccb, SDP_INVALID_PDU_SIZE); + sdp_disconnect(p_ccb, tSDP_STATUS::SDP_INVALID_PDU_SIZE); return; } @@ -619,7 +621,7 @@ static void process_service_search_attr_rsp(tCONN_CB* p_ccb, uint8_t* p_reply, p_reply += lists_byte_count; if (*p_reply) { if (*p_reply > SDP_MAX_CONTINUATION_LEN) { - sdp_disconnect(p_ccb, SDP_INVALID_CONT_STATE); + sdp_disconnect(p_ccb, tSDP_STATUS::SDP_INVALID_CONT_STATE); return; } @@ -654,7 +656,7 @@ static void process_service_search_attr_rsp(tCONN_CB* p_ccb, uint8_t* p_reply, ((p_reply) ? (*p_reply) : 0)); if (base_bytes > bytes_left) { - sdp_disconnect(p_ccb, SDP_INVALID_CONT_STATE); + sdp_disconnect(p_ccb, tSDP_STATUS::SDP_INVALID_CONT_STATE); return; } @@ -707,8 +709,7 @@ static void process_service_search_attr_rsp(tCONN_CB* p_ccb, uint8_t* p_reply, /*******************************************************************/ if (!sdp_copy_raw_data(p_ccb, true)) { - log::error("sdp_copy_raw_data failed"); - sdp_disconnect(p_ccb, SDP_ILLEGAL_PARAMETER); + sdp_disconnect(p_ccb, tSDP_STATUS::SDP_ILLEGAL_PARAMETER); return; } @@ -718,34 +719,32 @@ static void process_service_search_attr_rsp(tCONN_CB* p_ccb, uint8_t* p_reply, type = *p++; if ((type >> 3) != DATA_ELE_SEQ_DESC_TYPE) { - log::warn("Wrong element in attr_rsp type:0x{:02x}", type); - sdp_disconnect(p_ccb, SDP_ILLEGAL_PARAMETER); + sdp_disconnect(p_ccb, tSDP_STATUS::SDP_ILLEGAL_PARAMETER); return; } p = sdpu_get_len_from_type(p, p + p_ccb->list_len, type, &seq_len); if (p == NULL || (p + seq_len) > (p + p_ccb->list_len)) { - log::warn("Illegal search attribute length"); - sdp_disconnect(p_ccb, SDP_ILLEGAL_PARAMETER); + sdp_disconnect(p_ccb, tSDP_STATUS::SDP_ILLEGAL_PARAMETER); return; } p_end = &p_ccb->rsp_list[p_ccb->list_len]; if ((p + seq_len) != p_end) { - sdp_disconnect(p_ccb, SDP_INVALID_CONT_STATE); + sdp_disconnect(p_ccb, tSDP_STATUS::SDP_INVALID_CONT_STATE); return; } while (p < p_end) { p = save_attr_seq(p_ccb, p, &p_ccb->rsp_list[p_ccb->list_len]); if (!p) { - sdp_disconnect(p_ccb, SDP_DB_FULL); + sdp_disconnect(p_ccb, tSDP_STATUS::SDP_DB_FULL); return; } } /* Since we got everything we need, disconnect the call */ sdpu_log_attribute_metrics(p_ccb->device_address, p_ccb->p_db); - sdp_disconnect(p_ccb, SDP_SUCCESS); + sdp_disconnect(p_ccb, tSDP_STATUS::SDP_SUCCESS); } /******************************************************************************* @@ -766,7 +765,7 @@ static void process_service_attr_rsp(tCONN_CB* p_ccb, uint8_t* p_reply, uint8_t* /* If p_reply is NULL, we were called after the records handles were read */ if (p_reply) { if (p_reply + 4 /* transaction ID and length */ + sizeof(list_byte_count) > p_reply_end) { - sdp_disconnect(p_ccb, SDP_INVALID_PDU_SIZE); + sdp_disconnect(p_ccb, tSDP_STATUS::SDP_INVALID_PDU_SIZE); return; } @@ -778,12 +777,12 @@ static void process_service_attr_rsp(tCONN_CB* p_ccb, uint8_t* p_reply, uint8_t* /* Copy the response to the scratchpad. First, a safety check on the length */ if ((p_ccb->list_len + list_byte_count) > SDP_MAX_LIST_BYTE_COUNT) { - sdp_disconnect(p_ccb, SDP_INVALID_PDU_SIZE); + sdp_disconnect(p_ccb, tSDP_STATUS::SDP_INVALID_PDU_SIZE); return; } if (p_reply + list_byte_count + 1 /* continuation */ > p_reply_end) { - sdp_disconnect(p_ccb, SDP_INVALID_PDU_SIZE); + sdp_disconnect(p_ccb, tSDP_STATUS::SDP_INVALID_PDU_SIZE); return; } @@ -795,21 +794,20 @@ static void process_service_attr_rsp(tCONN_CB* p_ccb, uint8_t* p_reply, uint8_t* p_reply += list_byte_count; if (*p_reply) { if (*p_reply > SDP_MAX_CONTINUATION_LEN) { - sdp_disconnect(p_ccb, SDP_INVALID_CONT_STATE); + sdp_disconnect(p_ccb, tSDP_STATUS::SDP_INVALID_CONT_STATE); return; } cont_request_needed = true; } else { log::warn("process_service_attr_rsp"); if (!sdp_copy_raw_data(p_ccb, false)) { - log::error("sdp_copy_raw_data failed"); - sdp_disconnect(p_ccb, SDP_ILLEGAL_PARAMETER); + sdp_disconnect(p_ccb, tSDP_STATUS::SDP_ILLEGAL_PARAMETER); return; } /* Save the response in the database. Stop on any error */ if (!save_attr_seq(p_ccb, &p_ccb->rsp_list[0], &p_ccb->rsp_list[p_ccb->list_len])) { - sdp_disconnect(p_ccb, SDP_DB_FULL); + sdp_disconnect(p_ccb, tSDP_STATUS::SDP_DB_FULL); return; } p_ccb->list_len = 0; @@ -872,7 +870,7 @@ static void process_service_attr_rsp(tCONN_CB* p_ccb, uint8_t* p_reply, uint8_t* alarm_set_on_mloop(p_ccb->sdp_conn_timer, SDP_INACT_TIMEOUT_MS, sdp_conn_timer_timeout, p_ccb); } else { sdpu_log_attribute_metrics(p_ccb->device_address, p_ccb->p_db); - sdp_disconnect(p_ccb, SDP_SUCCESS); + sdp_disconnect(p_ccb, tSDP_STATUS::SDP_SUCCESS); return; } } @@ -893,7 +891,7 @@ static void process_service_search_rsp(tCONN_CB* p_ccb, uint8_t* p_reply, uint8_ uint8_t cont_len; if (p_reply + 8 > p_reply_end) { - sdp_disconnect(p_ccb, SDP_GENERIC_ERROR); + sdp_disconnect(p_ccb, tSDP_STATUS::SDP_GENERIC_ERROR); return; } /* Skip transaction, and param len */ @@ -905,7 +903,7 @@ static void process_service_search_rsp(tCONN_CB* p_ccb, uint8_t* p_reply, uint8_ p_ccb->num_handles += cur_handles; if (p_ccb->num_handles == 0 || p_ccb->num_handles < orig) { log::warn("SDP - Rcvd ServiceSearchRsp, no matches"); - sdp_disconnect(p_ccb, SDP_NO_RECS_MATCH); + sdp_disconnect(p_ccb, tSDP_STATUS::SDP_NO_RECS_MATCH); return; } @@ -918,7 +916,7 @@ static void process_service_search_rsp(tCONN_CB* p_ccb, uint8_t* p_reply, uint8_ } if (p_reply + ((p_ccb->num_handles - orig) * 4) + 1 > p_reply_end) { - sdp_disconnect(p_ccb, SDP_GENERIC_ERROR); + sdp_disconnect(p_ccb, tSDP_STATUS::SDP_GENERIC_ERROR); return; } @@ -929,11 +927,11 @@ static void process_service_search_rsp(tCONN_CB* p_ccb, uint8_t* p_reply, uint8_ BE_STREAM_TO_UINT8(cont_len, p_reply); if (cont_len != 0) { if (cont_len > SDP_MAX_CONTINUATION_LEN) { - sdp_disconnect(p_ccb, SDP_INVALID_CONT_STATE); + sdp_disconnect(p_ccb, tSDP_STATUS::SDP_INVALID_CONT_STATE); return; } if (p_reply + cont_len > p_reply_end) { - sdp_disconnect(p_ccb, SDP_INVALID_CONT_STATE); + sdp_disconnect(p_ccb, tSDP_STATUS::SDP_INVALID_CONT_STATE); return; } /* stay in the same state */ @@ -994,7 +992,7 @@ void sdp_disc_server_rsp(tCONN_CB* p_ccb, BT_HDR* p_msg) { uint8_t* p_end = p + p_msg->len; if (p_msg->len < 1) { - sdp_disconnect(p_ccb, SDP_GENERIC_ERROR); + sdp_disconnect(p_ccb, tSDP_STATUS::SDP_GENERIC_ERROR); return; } @@ -1027,6 +1025,6 @@ void sdp_disc_server_rsp(tCONN_CB* p_ccb, BT_HDR* p_msg) { if (invalid_pdu) { log::warn("SDP - Unexp. PDU: {} in state: {}", rsp_pdu, p_ccb->disc_state); - sdp_disconnect(p_ccb, SDP_GENERIC_ERROR); + sdp_disconnect(p_ccb, tSDP_STATUS::SDP_GENERIC_ERROR); } } diff --git a/system/stack/sdp/sdp_main.cc b/system/stack/sdp/sdp_main.cc index b85486505c..0060c8d178 100644 --- a/system/stack/sdp/sdp_main.cc +++ b/system/stack/sdp/sdp_main.cc @@ -79,7 +79,7 @@ static void sdp_on_l2cap_error(uint16_t l2cap_cid, uint16_t /* result */) { sdpu_dump_all_ccb(); return; } - sdp_disconnect(p_ccb, SDP_CFG_FAILED); + sdp_disconnect(p_ccb, tSDP_STATUS::SDP_CFG_FAILED); } /******************************************************************************* @@ -199,8 +199,9 @@ static void sdp_disconnect_ind(uint16_t l2cap_cid, bool ack_needed) { } tCONN_CB& ccb = *p_ccb; - const tSDP_REASON reason = - (ccb.con_state == tSDP_STATE::CONNECTED) ? SDP_SUCCESS : SDP_CONN_FAILED; + const tSDP_REASON reason = (ccb.con_state == tSDP_STATE::CONNECTED) + ? tSDP_STATUS::SDP_SUCCESS + : tSDP_STATUS::SDP_CONN_FAILED; sdpu_callback(ccb, reason); if (ack_needed) { @@ -317,7 +318,7 @@ void sdp_disconnect(tCONN_CB* p_ccb, tSDP_REASON reason) { /* Check if we have a connection ID */ if (ccb.connection_id != 0) { ccb.disconnect_reason = reason; - if (SDP_SUCCESS == reason && sdpu_process_pend_ccb_same_cid(*p_ccb)) { + if (tSDP_STATUS::SDP_SUCCESS == reason && sdpu_process_pend_ccb_same_cid(*p_ccb)) { sdpu_callback(ccb, reason); sdpu_release_ccb(ccb); return; @@ -384,7 +385,7 @@ void sdp_conn_timer_timeout(void* data) { log::warn("Unable to disconnect L2CAP peer:{} cid:{}", ccb.device_address, ccb.connection_id); } - sdpu_callback(ccb, SDP_CONN_FAILED); + sdpu_callback(ccb, tSDP_STATUS::SDP_CONN_FAILED); sdpu_clear_pend_ccb(ccb); sdpu_release_ccb(ccb); } diff --git a/system/stack/sdp/sdp_server.cc b/system/stack/sdp/sdp_server.cc index ba0593a416..8f95a79424 100644 --- a/system/stack/sdp/sdp_server.cc +++ b/system/stack/sdp/sdp_server.cc @@ -191,13 +191,14 @@ static void process_service_search(tCONN_CB* p_ccb, uint16_t trans_num, uint16_t p_req = sdpu_extract_uid_seq(p_req, param_len, &uid_seq); if ((!p_req) || (!uid_seq.num_uids)) { - sdpu_build_n_send_error(p_ccb, trans_num, SDP_INVALID_REQ_SYNTAX, SDP_TEXT_BAD_UUID_LIST); + sdpu_build_n_send_error(p_ccb, trans_num, tSDP_STATUS::SDP_INVALID_REQ_SYNTAX, + SDP_TEXT_BAD_UUID_LIST); return; } /* Get the max replies we can send. Cap it at our max anyways. */ if (p_req + sizeof(max_replies) + sizeof(uint8_t) > p_req_end) { - sdpu_build_n_send_error(p_ccb, trans_num, SDP_INVALID_REQ_SYNTAX, + sdpu_build_n_send_error(p_ccb, trans_num, tSDP_STATUS::SDP_INVALID_REQ_SYNTAX, SDP_TEXT_BAD_MAX_RECORDS_LIST); return; } @@ -220,18 +221,21 @@ static void process_service_search(tCONN_CB* p_ccb, uint16_t trans_num, uint16_t /* Check if this is a continuation request */ if (p_req + 1 > p_req_end) { - sdpu_build_n_send_error(p_ccb, trans_num, SDP_INVALID_CONT_STATE, SDP_TEXT_BAD_CONT_LEN); + sdpu_build_n_send_error(p_ccb, trans_num, tSDP_STATUS::SDP_INVALID_CONT_STATE, + SDP_TEXT_BAD_CONT_LEN); return; } if (*p_req) { if (*p_req++ != SDP_CONTINUATION_LEN || (p_req + sizeof(cont_offset) > p_req_end)) { - sdpu_build_n_send_error(p_ccb, trans_num, SDP_INVALID_CONT_STATE, SDP_TEXT_BAD_CONT_LEN); + sdpu_build_n_send_error(p_ccb, trans_num, tSDP_STATUS::SDP_INVALID_CONT_STATE, + SDP_TEXT_BAD_CONT_LEN); return; } BE_STREAM_TO_UINT16(cont_offset, p_req); if (cont_offset != p_ccb->cont_offset || num_rsp_handles < cont_offset) { - sdpu_build_n_send_error(p_ccb, trans_num, SDP_INVALID_CONT_STATE, SDP_TEXT_BAD_CONT_INX); + sdpu_build_n_send_error(p_ccb, trans_num, tSDP_STATUS::SDP_INVALID_CONT_STATE, + SDP_TEXT_BAD_CONT_INX); return; } @@ -325,7 +329,8 @@ static void process_service_attr_req(tCONN_CB* p_ccb, uint16_t trans_num, uint16 uint16_t attr_len; if (p_req + sizeof(rec_handle) + sizeof(max_list_len) > p_req_end) { - sdpu_build_n_send_error(p_ccb, trans_num, SDP_INVALID_SERV_REC_HDL, SDP_TEXT_BAD_HANDLE); + sdpu_build_n_send_error(p_ccb, trans_num, tSDP_STATUS::SDP_INVALID_SERV_REC_HDL, + SDP_TEXT_BAD_HANDLE); return; } @@ -344,7 +349,8 @@ static void process_service_attr_req(tCONN_CB* p_ccb, uint16_t trans_num, uint16 p_req = sdpu_extract_attr_seq(p_req, param_len, &attr_seq); if ((!p_req) || (!attr_seq.num_attr) || (p_req + sizeof(uint8_t) > p_req_end)) { - sdpu_build_n_send_error(p_ccb, trans_num, SDP_INVALID_REQ_SYNTAX, SDP_TEXT_BAD_ATTR_LIST); + sdpu_build_n_send_error(p_ccb, trans_num, tSDP_STATUS::SDP_INVALID_REQ_SYNTAX, + SDP_TEXT_BAD_ATTR_LIST); return; } @@ -353,12 +359,13 @@ static void process_service_attr_req(tCONN_CB* p_ccb, uint16_t trans_num, uint16 /* Find a record with the record handle */ p_rec = sdp_db_find_record(rec_handle); if (!p_rec) { - sdpu_build_n_send_error(p_ccb, trans_num, SDP_INVALID_SERV_REC_HDL, SDP_TEXT_BAD_HANDLE); + sdpu_build_n_send_error(p_ccb, trans_num, tSDP_STATUS::SDP_INVALID_SERV_REC_HDL, + SDP_TEXT_BAD_HANDLE); return; } if (max_list_len < 4) { - sdpu_build_n_send_error(p_ccb, trans_num, SDP_ILLEGAL_PARAMETER, NULL); + sdpu_build_n_send_error(p_ccb, trans_num, tSDP_STATUS::SDP_ILLEGAL_PARAMETER, NULL); return; } @@ -368,18 +375,21 @@ static void process_service_attr_req(tCONN_CB* p_ccb, uint16_t trans_num, uint16 /* Check if this is a continuation request */ if (p_req + 1 > p_req_end) { - sdpu_build_n_send_error(p_ccb, trans_num, SDP_INVALID_CONT_STATE, SDP_TEXT_BAD_CONT_LEN); + sdpu_build_n_send_error(p_ccb, trans_num, tSDP_STATUS::SDP_INVALID_CONT_STATE, + SDP_TEXT_BAD_CONT_LEN); return; } if (*p_req) { if (*p_req++ != SDP_CONTINUATION_LEN || (p_req + sizeof(cont_offset) > p_req_end)) { - sdpu_build_n_send_error(p_ccb, trans_num, SDP_INVALID_CONT_STATE, SDP_TEXT_BAD_CONT_LEN); + sdpu_build_n_send_error(p_ccb, trans_num, tSDP_STATUS::SDP_INVALID_CONT_STATE, + SDP_TEXT_BAD_CONT_LEN); return; } BE_STREAM_TO_UINT16(cont_offset, p_req); if (cont_offset != p_ccb->cont_offset) { - sdpu_build_n_send_error(p_ccb, trans_num, SDP_INVALID_CONT_STATE, SDP_TEXT_BAD_CONT_INX); + sdpu_build_n_send_error(p_ccb, trans_num, tSDP_STATUS::SDP_INVALID_CONT_STATE, + SDP_TEXT_BAD_CONT_INX); return; } is_cont = true; @@ -438,7 +448,8 @@ static void process_service_attr_req(tCONN_CB* p_ccb, uint16_t trans_num, uint16 if (p_ccb->cont_info.attr_offset) { if (attr_len < p_ccb->cont_info.attr_offset) { log::error("offset is bigger than attribute length"); - sdpu_build_n_send_error(p_ccb, trans_num, SDP_INVALID_CONT_STATE, SDP_TEXT_BAD_CONT_LEN); + sdpu_build_n_send_error(p_ccb, trans_num, tSDP_STATUS::SDP_INVALID_CONT_STATE, + SDP_TEXT_BAD_CONT_LEN); return; } p_rsp = sdpu_build_partial_attrib_entry(p_rsp, p_attr, rem_len, @@ -454,7 +465,7 @@ static void process_service_attr_req(tCONN_CB* p_ccb, uint16_t trans_num, uint16 { if (attr_len >= SDP_MAX_ATTR_LEN) { log::error("SDP attr too big: max_list_len={},attr_len={}", max_list_len, attr_len); - sdpu_build_n_send_error(p_ccb, trans_num, SDP_NO_RESOURCES, NULL); + sdpu_build_n_send_error(p_ccb, trans_num, tSDP_STATUS::SDP_NO_RESOURCES, NULL); return; } @@ -588,7 +599,8 @@ static void process_service_search_attr_req(tCONN_CB* p_ccb, uint16_t trans_num, p_req = sdpu_extract_uid_seq(p_req, param_len, &uid_seq); if ((!p_req) || (!uid_seq.num_uids) || (p_req + sizeof(uint16_t) > p_req_end)) { - sdpu_build_n_send_error(p_ccb, trans_num, SDP_INVALID_REQ_SYNTAX, SDP_TEXT_BAD_UUID_LIST); + sdpu_build_n_send_error(p_ccb, trans_num, tSDP_STATUS::SDP_INVALID_REQ_SYNTAX, + SDP_TEXT_BAD_UUID_LIST); return; } @@ -603,14 +615,15 @@ static void process_service_search_attr_req(tCONN_CB* p_ccb, uint16_t trans_num, p_req = sdpu_extract_attr_seq(p_req, param_len, &attr_seq); if ((!p_req) || (!attr_seq.num_attr) || (p_req + sizeof(uint8_t) > p_req_end)) { - sdpu_build_n_send_error(p_ccb, trans_num, SDP_INVALID_REQ_SYNTAX, SDP_TEXT_BAD_ATTR_LIST); + sdpu_build_n_send_error(p_ccb, trans_num, tSDP_STATUS::SDP_INVALID_REQ_SYNTAX, + SDP_TEXT_BAD_ATTR_LIST); return; } memcpy(&attr_seq_sav, &attr_seq, sizeof(tSDP_ATTR_SEQ)); if (max_list_len < 4) { - sdpu_build_n_send_error(p_ccb, trans_num, SDP_ILLEGAL_PARAMETER, NULL); + sdpu_build_n_send_error(p_ccb, trans_num, tSDP_STATUS::SDP_ILLEGAL_PARAMETER, NULL); return; } @@ -620,18 +633,21 @@ static void process_service_search_attr_req(tCONN_CB* p_ccb, uint16_t trans_num, /* Check if this is a continuation request */ if (p_req + 1 > p_req_end) { - sdpu_build_n_send_error(p_ccb, trans_num, SDP_INVALID_CONT_STATE, SDP_TEXT_BAD_CONT_LEN); + sdpu_build_n_send_error(p_ccb, trans_num, tSDP_STATUS::SDP_INVALID_CONT_STATE, + SDP_TEXT_BAD_CONT_LEN); return; } if (*p_req) { if (*p_req++ != SDP_CONTINUATION_LEN || (p_req + sizeof(uint16_t) > p_req_end)) { - sdpu_build_n_send_error(p_ccb, trans_num, SDP_INVALID_CONT_STATE, SDP_TEXT_BAD_CONT_LEN); + sdpu_build_n_send_error(p_ccb, trans_num, tSDP_STATUS::SDP_INVALID_CONT_STATE, + SDP_TEXT_BAD_CONT_LEN); return; } BE_STREAM_TO_UINT16(cont_offset, p_req); if (cont_offset != p_ccb->cont_offset) { - sdpu_build_n_send_error(p_ccb, trans_num, SDP_INVALID_CONT_STATE, SDP_TEXT_BAD_CONT_INX); + sdpu_build_n_send_error(p_ccb, trans_num, tSDP_STATUS::SDP_INVALID_CONT_STATE, + SDP_TEXT_BAD_CONT_INX); return; } is_cont = true; @@ -713,7 +729,7 @@ static void process_service_search_attr_req(tCONN_CB* p_ccb, uint16_t trans_num, if (p_ccb->cont_info.attr_offset) { if (attr_len < p_ccb->cont_info.attr_offset) { log::error("offset is bigger than attribute length"); - sdpu_build_n_send_error(p_ccb, trans_num, SDP_INVALID_CONT_STATE, + sdpu_build_n_send_error(p_ccb, trans_num, tSDP_STATUS::SDP_INVALID_CONT_STATE, SDP_TEXT_BAD_CONT_LEN); return; } @@ -731,7 +747,7 @@ static void process_service_search_attr_req(tCONN_CB* p_ccb, uint16_t trans_num, { if (attr_len >= SDP_MAX_ATTR_LEN) { log::error("SDP attr too big: max_list_len={},attr_len={}", max_list_len, attr_len); - sdpu_build_n_send_error(p_ccb, trans_num, SDP_NO_RESOURCES, NULL); + sdpu_build_n_send_error(p_ccb, trans_num, tSDP_STATUS::SDP_NO_RESOURCES, NULL); return; } @@ -820,7 +836,7 @@ static void process_service_search_attr_req(tCONN_CB* p_ccb, uint16_t trans_num, // // TODO(sharvil): rewrite SDP server. if (is_cont && len_to_send == 0) { - sdpu_build_n_send_error(p_ccb, trans_num, SDP_INVALID_CONT_STATE, NULL); + sdpu_build_n_send_error(p_ccb, trans_num, tSDP_STATUS::SDP_INVALID_CONT_STATE, NULL); return; } @@ -928,7 +944,8 @@ void sdp_server_handle_client_req(tCONN_CB* p_ccb, BT_HDR* p_msg) { if (p_req + sizeof(pdu_id) + sizeof(trans_num) > p_req_end) { trans_num = 0; - sdpu_build_n_send_error(p_ccb, trans_num, SDP_INVALID_REQ_SYNTAX, SDP_TEXT_BAD_HEADER); + sdpu_build_n_send_error(p_ccb, trans_num, tSDP_STATUS::SDP_INVALID_REQ_SYNTAX, + SDP_TEXT_BAD_HEADER); return; } @@ -939,14 +956,16 @@ void sdp_server_handle_client_req(tCONN_CB* p_ccb, BT_HDR* p_msg) { BE_STREAM_TO_UINT16(trans_num, p_req); if (p_req + sizeof(param_len) > p_req_end) { - sdpu_build_n_send_error(p_ccb, trans_num, SDP_INVALID_REQ_SYNTAX, SDP_TEXT_BAD_HEADER); + sdpu_build_n_send_error(p_ccb, trans_num, tSDP_STATUS::SDP_INVALID_REQ_SYNTAX, + SDP_TEXT_BAD_HEADER); return; } BE_STREAM_TO_UINT16(param_len, p_req); if ((p_req + param_len) != p_req_end) { - sdpu_build_n_send_error(p_ccb, trans_num, SDP_INVALID_PDU_SIZE, SDP_TEXT_BAD_HEADER); + sdpu_build_n_send_error(p_ccb, trans_num, tSDP_STATUS::SDP_INVALID_PDU_SIZE, + SDP_TEXT_BAD_HEADER); return; } @@ -964,7 +983,8 @@ void sdp_server_handle_client_req(tCONN_CB* p_ccb, BT_HDR* p_msg) { break; default: - sdpu_build_n_send_error(p_ccb, trans_num, SDP_INVALID_REQ_SYNTAX, SDP_TEXT_BAD_PDU); + sdpu_build_n_send_error(p_ccb, trans_num, tSDP_STATUS::SDP_INVALID_REQ_SYNTAX, + SDP_TEXT_BAD_PDU); log::warn("SDP - server got unknown PDU: 0x{:x}", pdu_id); break; } diff --git a/system/stack/sdp/sdp_utils.cc b/system/stack/sdp/sdp_utils.cc index d66dc0ea51..9ab89e9fe9 100644 --- a/system/stack/sdp/sdp_utils.cc +++ b/system/stack/sdp/sdp_utils.cc @@ -275,7 +275,7 @@ void sdpu_log_attribute_metrics(const RawAddress& bda, tSDP_DISCOVERY_DB* p_db) // Log the first DI record if there is one if (has_di_record) { tSDP_DI_GET_RECORD di_record = {}; - if (SDP_GetDiRecord(1, &di_record, p_db) == SDP_SUCCESS) { + if (SDP_GetDiRecord(1, &di_record, p_db) == tSDP_STATUS::SDP_SUCCESS) { auto version_array = to_little_endian_array(di_record.spec_id); log_sdp_attribute(bda, UUID_SERVCLASS_PNP_INFORMATION, ATTR_ID_SPECIFICATION_ID, version_array.size(), version_array.data()); @@ -386,7 +386,7 @@ tCONN_CB* sdpu_allocate_ccb(void) { * Returns void * ******************************************************************************/ -void sdpu_callback(tCONN_CB& ccb, tSDP_REASON reason) { +void sdpu_callback(const tCONN_CB& ccb, tSDP_REASON reason) { if (ccb.p_cb) { (ccb.p_cb)(ccb.device_address, reason); } else if (ccb.complete_callback) { @@ -415,7 +415,7 @@ void sdpu_release_ccb(tCONN_CB& ccb) { if (ccb.rsp_list) { log::verbose("releasing SDP rsp_list"); } - osi_free_and_reset((void**)&ccb.rsp_list); + osi_free_and_reset(reinterpret_cast<void**>(&ccb.rsp_list)); } /******************************************************************************* @@ -480,7 +480,7 @@ uint16_t sdpu_get_active_ccb_cid(const RawAddress& bd_addr) { * Returns returns true if any pending ccb, else false. * ******************************************************************************/ -bool sdpu_process_pend_ccb_same_cid(tCONN_CB& ccb) { +bool sdpu_process_pend_ccb_same_cid(const tCONN_CB& ccb) { uint16_t xx; tCONN_CB* p_ccb{}; @@ -509,7 +509,7 @@ bool sdpu_process_pend_ccb_same_cid(tCONN_CB& ccb) { * Returns returns true if any pending ccb, else false. * ******************************************************************************/ -bool sdpu_process_pend_ccb_new_cid(tCONN_CB& ccb) { +bool sdpu_process_pend_ccb_new_cid(const tCONN_CB& ccb) { uint16_t xx; tCONN_CB* p_ccb{}; uint16_t new_cid = 0; @@ -530,7 +530,7 @@ bool sdpu_process_pend_ccb_new_cid(tCONN_CB& ccb) { // update alls cid to the new one for future reference p_ccb->connection_id = new_cid; } else { - sdpu_callback(*p_ccb, SDP_CONN_FAILED); + sdpu_callback(*p_ccb, tSDP_STATUS::SDP_CONN_FAILED); sdpu_release_ccb(*p_ccb); } } @@ -549,7 +549,7 @@ bool sdpu_process_pend_ccb_new_cid(tCONN_CB& ccb) { * Returns returns none. * ******************************************************************************/ -void sdpu_clear_pend_ccb(tCONN_CB& ccb) { +void sdpu_clear_pend_ccb(const tCONN_CB& ccb) { uint16_t xx; tCONN_CB* p_ccb{}; @@ -557,7 +557,7 @@ void sdpu_clear_pend_ccb(tCONN_CB& ccb) { for (xx = 0, p_ccb = sdp_cb.ccb; xx < SDP_MAX_CONNECTIONS; xx++, p_ccb++) { if ((p_ccb->con_state == tSDP_STATE::CONN_PEND) && (p_ccb->connection_id == ccb.connection_id) && (p_ccb->con_flags & SDP_FLAGS_IS_ORIG)) { - sdpu_callback(*p_ccb, SDP_CONN_FAILED); + sdpu_callback(*p_ccb, tSDP_STATUS::SDP_CONN_FAILED); sdpu_release_ccb(*p_ccb); } } @@ -700,14 +700,14 @@ void sdpu_build_n_send_error(tCONN_CB* p_ccb, uint16_t trans_num, tSDP_STATUS er char* p_error_text) { uint8_t *p_rsp, *p_rsp_start, *p_rsp_param_len; uint16_t rsp_param_len; - BT_HDR* p_buf = (BT_HDR*)osi_malloc(SDP_DATA_BUF_SIZE); + BT_HDR* p_buf = reinterpret_cast<BT_HDR*>(osi_malloc(SDP_DATA_BUF_SIZE)); log::warn("SDP - sdpu_build_n_send_error code: 0x{:x} CID: 0x{:x}", error_code, p_ccb->connection_id); /* Send the packet to L2CAP */ p_buf->offset = L2CAP_MIN_OFFSET; - p_rsp = p_rsp_start = (uint8_t*)(p_buf + 1) + L2CAP_MIN_OFFSET; + p_rsp = p_rsp_start = reinterpret_cast<uint8_t*>(p_buf + 1) + L2CAP_MIN_OFFSET; UINT8_TO_BE_STREAM(p_rsp, SDP_PDU_ERROR_RESPONSE); UINT16_TO_BE_STREAM(p_rsp, trans_num); @@ -1128,7 +1128,7 @@ bool sdpu_compare_uuid_arrays(const uint8_t* p_uuid1, uint32_t len1, const uint8 return (p_uuid1[0] == p_uuid2[0]) && (p_uuid1[1] == p_uuid2[1]) && (p_uuid1[2] == p_uuid2[2]) && (p_uuid1[3] == p_uuid2[3]); } else { - return memcmp(p_uuid1, p_uuid2, (size_t)len1) == 0; + return memcmp(p_uuid1, p_uuid2, static_cast<size_t>(len1)) == 0; } } else if (len1 > len2) { /* If the len1 was 4-byte, (so len2 is 2-byte), compare on the fly */ @@ -1160,9 +1160,9 @@ bool sdpu_compare_uuid_arrays(const uint8_t* p_uuid1, uint32_t len1, const uint8 memcpy(nu1, sdp_base_uuid, Uuid::kNumBytes128); if (len1 == 4) { - memcpy(nu1, p_uuid1, (size_t)len1); + memcpy(nu1, p_uuid1, static_cast<size_t>(len1)); } else if (len1 == 2) { - memcpy(nu1 + 2, p_uuid1, (size_t)len1); + memcpy(nu1 + 2, p_uuid1, static_cast<size_t>(len1)); } return memcmp(nu1, nu2, Uuid::kNumBytes128) == 0; @@ -1210,8 +1210,8 @@ bool sdpu_compare_uuid_with_attr(const Uuid& uuid, tSDP_DISC_ATTR* p_attr) { return false; } - if (memcmp(uuid.To128BitBE().data(), (void*)p_attr->attr_value.v.array, Uuid::kNumBytes128) == - 0) { + if (memcmp(uuid.To128BitBE().data(), static_cast<void*>(p_attr->attr_value.v.array), + Uuid::kNumBytes128) == 0) { return true; } @@ -1399,7 +1399,7 @@ uint16_t sdpu_get_attrib_entry_len(const tSDP_ATTRIBUTE* p_attr) { ******************************************************************************/ uint8_t* sdpu_build_partial_attrib_entry(uint8_t* p_out, const tSDP_ATTRIBUTE* p_attr, uint16_t len, uint16_t* offset) { - uint8_t* p_attr_buff = (uint8_t*)osi_malloc(sizeof(uint8_t) * SDP_MAX_ATTR_LEN); + uint8_t* p_attr_buff = reinterpret_cast<uint8_t*>(osi_malloc(sizeof(uint8_t) * SDP_MAX_ATTR_LEN)); sdpu_build_attrib_entry(p_attr_buff, p_attr); uint16_t attr_len = sdpu_get_attrib_entry_len(p_attr); @@ -1561,7 +1561,7 @@ void sdpu_set_avrc_target_version(const tSDP_ATTRIBUTE* p_attr, const RawAddress } if (!btif_config_get_bin(bdaddr->ToString(), BTIF_STORAGE_KEY_AVRCP_CONTROLLER_VERSION, - (uint8_t*)&cached_version, &version_value_size)) { + reinterpret_cast<uint8_t*>(&cached_version), &version_value_size)) { log::info( "no cached AVRC Controller version for {}. Reply default AVRC Target " "version {:x}.DUT AVRC Target version {:x}.", @@ -1630,7 +1630,7 @@ void sdpu_set_avrc_target_features(const tSDP_ATTRIBUTE* p_attr, const RawAddres } if (!btif_config_get_bin(bdaddr->ToString(), BTIF_STORAGE_KEY_AV_REM_CTRL_FEATURES, - (uint8_t*)&avrcp_peer_features, &version_value_size)) { + reinterpret_cast<uint8_t*>(&avrcp_peer_features), &version_value_size)) { log::error("Unable to fetch cached AVRC features"); return; } diff --git a/system/stack/sdp/sdpint.h b/system/stack/sdp/sdpint.h index 8bf3db65ef..0c4169c70b 100644 --- a/system/stack/sdp/sdpint.h +++ b/system/stack/sdp/sdpint.h @@ -22,16 +22,16 @@ * ******************************************************************************/ -#ifndef SDP_INT_H -#define SDP_INT_H +#pragma once #include <base/functional/callback.h> #include <base/strings/stringprintf.h> #include <cstdint> +#include <string> +#include "include/macros.h" #include "internal_include/bt_target.h" -#include "macros.h" #include "osi/include/alarm.h" #include "stack/include/bt_hdr.h" #include "stack/include/l2c_api.h" @@ -116,15 +116,15 @@ struct tSDP_DB { /* Continuation information for the SDP server response */ struct tSDP_CONT_INFO { - uint16_t next_attr_index; /* attr index for next continuation response */ - uint16_t next_attr_start_id; /* attr id to start with for the attr index in - next cont. response */ - const tSDP_RECORD* prev_sdp_rec; /* last sdp record that was completely sent - in the response */ - bool last_attr_seq_desc_sent; /* whether attr seq length has been sent - previously */ - uint16_t attr_offset; /* offset within the attr to keep trak of partial - attributes in the responses */ + uint16_t next_attr_index; // attr index for next continuation response + uint16_t next_attr_start_id; // attr id to start with for the attr index in + // next cont. response + const tSDP_RECORD* prev_sdp_rec; // last sdp record that was completely sent + // in the response + bool last_attr_seq_desc_sent; // whether attr seq length has been sent + // previously + uint16_t attr_offset; // offset within the attr to keep trak of partial + // attributes in the responses }; enum class tSDP_STATE : uint8_t { @@ -147,6 +147,7 @@ inline std::string sdp_state_text(const tSDP_STATE& state) { } enum : uint8_t { + SDP_FLAGS_NONE = 0x00, SDP_FLAGS_IS_ORIG = 0x01, SDP_FLAGS_HIS_CFG_DONE = 0x02, SDP_FLAGS_MY_CFG_DONE = 0x04, @@ -175,16 +176,16 @@ typedef uint8_t tSDP_DISC_WAIT; /* Define the SDP Connection Control Block */ struct tCONN_CB { - tSDP_STATE con_state; - uint8_t con_flags; + tSDP_STATE con_state{tSDP_STATE::IDLE}; + tSDP_FLAGS con_flags{SDP_FLAGS_NONE}; RawAddress device_address; alarm_t* sdp_conn_timer; uint16_t rem_mtu_size; uint16_t connection_id; uint16_t list_len; /* length of the response in the GKI buffer */ - uint16_t pse_dynamic_attributes_len; /* length of the attributes need to be - added in final sdp response len */ + uint16_t pse_dynamic_attributes_len; // length of the attributes need to be + // added in final sdp response len uint8_t* rsp_list; /* pointer to GKI buffer holding response */ tSDP_DISCOVERY_DB* p_db; /* Database to save info into */ @@ -199,12 +200,12 @@ struct tCONN_CB { uint16_t transaction_id; tSDP_REASON disconnect_reason; /* Disconnect reason */ - uint8_t disc_state; - bool is_attr_search; + tSDP_DISC_WAIT disc_state{SDP_DISC_WAIT_CONN}; + bool is_attr_search{false}; uint16_t cont_offset; /* Continuation state data in the server response */ - tSDP_CONT_INFO cont_info; /* structure to hold continuation information for - the server response */ + tSDP_CONT_INFO cont_info; // structure to hold continuation information for + // the server response tCONN_CB() = default; private: @@ -286,10 +287,10 @@ void sdpu_set_avrc_target_version(const tSDP_ATTRIBUTE* p_attr, const RawAddress void sdpu_set_avrc_target_features(const tSDP_ATTRIBUTE* p_attr, const RawAddress* bdaddr, uint16_t profile_version); uint16_t sdpu_get_active_ccb_cid(const RawAddress& bd_addr); -bool sdpu_process_pend_ccb_same_cid(tCONN_CB& ccb); -bool sdpu_process_pend_ccb_new_cid(tCONN_CB& ccb); -void sdpu_clear_pend_ccb(tCONN_CB& ccb); -void sdpu_callback(tCONN_CB& ccb, tSDP_REASON reason); +bool sdpu_process_pend_ccb_same_cid(const tCONN_CB& ccb); +bool sdpu_process_pend_ccb_new_cid(const tCONN_CB& ccb); +void sdpu_clear_pend_ccb(const tCONN_CB& ccb); +void sdpu_callback(const tCONN_CB& ccb, tSDP_REASON reason); /* Functions provided by sdp_db.cc */ @@ -315,5 +316,3 @@ void sdp_save_local_pse_record_attributes(int32_t rfcomm_channel_number, int32_t size_t sdp_get_num_records(const tSDP_DISCOVERY_DB& db); size_t sdp_get_num_attributes(const tSDP_DISC_REC& sdp_disc_rec); - -#endif diff --git a/system/stack/smp/smp_act.cc b/system/stack/smp/smp_act.cc index 38e94e2cae..35c1b67f29 100644 --- a/system/stack/smp/smp_act.cc +++ b/system/stack/smp/smp_act.cc @@ -38,6 +38,7 @@ #include "stack/include/bt_types.h" #include "stack/include/btm_client_interface.h" #include "stack/include/btm_log_history.h" +#include "stack/include/btm_status.h" #include "stack/include/smp_api_types.h" #include "types/raw_address.h" @@ -157,7 +158,7 @@ void smp_send_app_cback(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { callback_rc = (*p_cb->p_callback)(p_cb->cb_evt, p_cb->pairing_bda, &cb_data); - if (callback_rc == BTM_SUCCESS) { + if (callback_rc == tBTM_STATUS::BTM_SUCCESS) { switch (p_cb->cb_evt) { case SMP_IO_CAP_REQ_EVT: p_cb->loc_auth_req = cb_data.io_req.auth_req; @@ -1166,7 +1167,7 @@ void smp_start_enc(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { cmd = btm_ble_start_encrypt(p_cb->pairing_bda, false, NULL); } - if (cmd != BTM_CMD_STARTED && cmd != BTM_BUSY) { + if (cmd != tBTM_STATUS::BTM_CMD_STARTED && cmd != tBTM_STATUS::BTM_BUSY) { tSMP_INT_DATA smp_int_data; smp_int_data.status = SMP_ENC_FAIL; smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &smp_int_data); @@ -1226,7 +1227,7 @@ void smp_sirk_verify(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { callback_rc = (*p_cb->p_callback)(p_cb->cb_evt, p_cb->pairing_bda, nullptr); /* There is no member validator callback - device is by default valid */ - if (callback_rc == BTM_SUCCESS_NO_SECURITY) { + if (callback_rc == tBTM_STATUS::BTM_SUCCESS_NO_SECURITY) { BTM_LogHistory(kBtmLogTag, p_cb->pairing_bda, "SIRK verification", base::StringPrintf("Device validated due to no security")); @@ -1512,7 +1513,9 @@ void smp_process_io_response(tSMP_CB* p_cb, tSMP_INT_DATA* /* p_data */) { switch (p_cb->loc_oob_flag) { case SMP_OOB_NONE: log::info("SMP_MODEL_SEC_CONN_OOB with SMP_OOB_NONE"); - smp_send_pair_rsp(p_cb, NULL); + if (!com::android::bluetooth::flags::remove_dup_pairing_response_in_oob_pairing()) { + smp_send_pair_rsp(p_cb, NULL); + } break; case SMP_OOB_PRESENT: log::info("SMP_MODEL_SEC_CONN_OOB with SMP_OOB_PRESENT"); diff --git a/system/stack/test/btm/stack_btm_inq_test.cc b/system/stack/test/btm/stack_btm_inq_test.cc index f4c8f0a9f4..cad4b328d9 100644 --- a/system/stack/test/btm/stack_btm_inq_test.cc +++ b/system/stack/test/btm/stack_btm_inq_test.cc @@ -27,6 +27,7 @@ #include "hci/hci_packets.h" #include "stack/btm/btm_int_types.h" #include "stack/include/btm_inq.h" +#include "stack/include/btm_status.h" #include "stack/include/hci_error_code.h" #include "stack/include/inq_hci_link_interface.h" #include "stack/include/main_thread.h" @@ -117,7 +118,7 @@ TEST_F(BtmInqActiveTest, btm_process_remote_name__typical) { ASSERT_EQ(1, get_func_call_count("alarm_cancel")); ASSERT_TRUE(gBTM_REMOTE_DEV_NAME_sent); - ASSERT_EQ(BTM_SUCCESS, gBTM_REMOTE_DEV_NAME.status); + ASSERT_EQ(tBTM_STATUS::BTM_SUCCESS, gBTM_REMOTE_DEV_NAME.btm_status); ASSERT_EQ(HCI_SUCCESS, gBTM_REMOTE_DEV_NAME.hci_status); ASSERT_EQ(kRawAddress, gBTM_REMOTE_DEV_NAME.bd_addr); ASSERT_STREQ((char*)kBdName, (char*)gBTM_REMOTE_DEV_NAME.remote_bd_name); @@ -132,7 +133,7 @@ TEST_F(BtmInqActiveTest, btm_process_remote_name__no_name) { ASSERT_EQ(1, get_func_call_count("alarm_cancel")); ASSERT_TRUE(gBTM_REMOTE_DEV_NAME_sent); - ASSERT_EQ(BTM_SUCCESS, gBTM_REMOTE_DEV_NAME.status); + ASSERT_EQ(tBTM_STATUS::BTM_SUCCESS, gBTM_REMOTE_DEV_NAME.btm_status); ASSERT_EQ(HCI_SUCCESS, gBTM_REMOTE_DEV_NAME.hci_status); ASSERT_EQ(kRawAddress, gBTM_REMOTE_DEV_NAME.bd_addr); ASSERT_STREQ((char*)kEmptyName, (char*)gBTM_REMOTE_DEV_NAME.remote_bd_name); @@ -147,7 +148,7 @@ TEST_F(BtmInqActiveTest, btm_process_remote_name__bad_status) { ASSERT_EQ(1, get_func_call_count("alarm_cancel")); ASSERT_TRUE(gBTM_REMOTE_DEV_NAME_sent); - ASSERT_EQ(BTM_BAD_VALUE_RET, gBTM_REMOTE_DEV_NAME.status); + ASSERT_EQ(tBTM_STATUS::BTM_BAD_VALUE_RET, gBTM_REMOTE_DEV_NAME.btm_status); ASSERT_EQ(HCI_ERR_PAGE_TIMEOUT, gBTM_REMOTE_DEV_NAME.hci_status); ASSERT_EQ(kRawAddress, gBTM_REMOTE_DEV_NAME.bd_addr); ASSERT_STREQ((char*)kEmptyName, (char*)gBTM_REMOTE_DEV_NAME.remote_bd_name); @@ -162,7 +163,7 @@ TEST_F(BtmInqActiveTest, btm_process_remote_name__no_address) { ASSERT_EQ(1, get_func_call_count("alarm_cancel")); ASSERT_TRUE(gBTM_REMOTE_DEV_NAME_sent); - ASSERT_EQ(BTM_SUCCESS, gBTM_REMOTE_DEV_NAME.status); + ASSERT_EQ(tBTM_STATUS::BTM_SUCCESS, gBTM_REMOTE_DEV_NAME.btm_status); ASSERT_EQ(HCI_SUCCESS, gBTM_REMOTE_DEV_NAME.hci_status); ASSERT_EQ(RawAddress::kEmpty, gBTM_REMOTE_DEV_NAME.bd_addr); ASSERT_STREQ((char*)kBdName, (char*)gBTM_REMOTE_DEV_NAME.remote_bd_name); @@ -214,7 +215,7 @@ protected: bluetooth::hci::testing::mock_hci_layer_ = &hci_layer_; // Start Inquiry - EXPECT_EQ(BTM_CMD_STARTED, BTM_StartInquiry(btm_inq_results_cb, btm_inq_cmpl_cb)); + EXPECT_EQ(tBTM_STATUS::BTM_CMD_STARTED, BTM_StartInquiry(btm_inq_results_cb, btm_inq_cmpl_cb)); auto view = hci_layer_.GetCommand(OpCode::INQUIRY); hci_layer_.IncomingEvent( InquiryStatusBuilder::Create(bluetooth::hci::ErrorCode::SUCCESS, kNumCommandPackets)); diff --git a/system/stack/test/btm/stack_btm_power_mode_test.cc b/system/stack/test/btm/stack_btm_power_mode_test.cc index 04db03cd1d..21ce003ff7 100644 --- a/system/stack/test/btm/stack_btm_power_mode_test.cc +++ b/system/stack/test/btm/stack_btm_power_mode_test.cc @@ -21,6 +21,7 @@ #include "hci/controller_interface_mock.h" #include "stack/include/acl_api.h" #include "stack/include/acl_hci_link_interface.h" +#include "stack/include/btm_status.h" #include "stack/include/hci_error_code.h" #include "test/common/mock_functions.h" #include "test/mock/mock_main_shim_entry.h" @@ -52,20 +53,21 @@ protected: bluetooth::hci::testing::mock_controller_ = &controller_; power_mode_callback_queue.clear(); reset_mock_function_count_map(); - ASSERT_EQ(BTM_SUCCESS, BTM_PmRegister(BTM_PM_REG_SET, &pm_id_, - [](const RawAddress& p_bda, tBTM_PM_STATUS status, - uint16_t value, tHCI_STATUS hci_status) { - power_mode_callback_queue.push_back(power_mode_callback{ - .bd_addr = p_bda, - .status = status, - .value = value, - .hci_status = hci_status, - }); - })); + ASSERT_EQ(tBTM_STATUS::BTM_SUCCESS, + BTM_PmRegister(BTM_PM_REG_SET, &pm_id_, + [](const RawAddress& p_bda, tBTM_PM_STATUS status, uint16_t value, + tHCI_STATUS hci_status) { + power_mode_callback_queue.push_back(power_mode_callback{ + .bd_addr = p_bda, + .status = status, + .value = value, + .hci_status = hci_status, + }); + })); } void TearDown() override { - ASSERT_EQ(BTM_SUCCESS, + ASSERT_EQ(tBTM_STATUS::BTM_SUCCESS, BTM_PmRegister(BTM_PM_DEREG, &pm_id_, [](const RawAddress& /* p_bda */, tBTM_PM_STATUS /* status */, uint16_t /* value */, tHCI_STATUS /* hci_status */) {})); @@ -91,19 +93,19 @@ protected: TEST_F(StackBtmPowerMode, BTM_SetPowerMode__Undefined) { tBTM_PM_PWR_MD mode = {}; - ASSERT_EQ(BTM_UNKNOWN_ADDR, BTM_SetPowerMode(pm_id_, kRawAddress, &mode)); + ASSERT_EQ(BTM_UNKNOWN_ADDR, ::BTM_SetPowerMode(pm_id_, kRawAddress, &mode)); } TEST_F(StackBtmPowerModeConnected, BTM_SetPowerMode__AlreadyActive) { tBTM_PM_PWR_MD mode = {}; - ASSERT_EQ(BTM_SUCCESS, BTM_SetPowerMode(pm_id_, kRawAddress, &mode)); + ASSERT_EQ(tBTM_STATUS::BTM_SUCCESS, ::BTM_SetPowerMode(pm_id_, kRawAddress, &mode)); } TEST_F(StackBtmPowerModeConnected, BTM_SetPowerMode__ActiveToSniff) { tBTM_PM_PWR_MD mode = { .mode = BTM_PM_MD_SNIFF, }; - ASSERT_EQ("BTM_CMD_STARTED", btm_status_text(BTM_SetPowerMode(pm_id_, kRawAddress, &mode))); + ASSERT_EQ("BTM_CMD_STARTED", btm_status_text(::BTM_SetPowerMode(pm_id_, kRawAddress, &mode))); ASSERT_EQ(1, get_func_call_count("btsnd_hcic_sniff_mode")); // Respond with successful command status for mode command @@ -154,7 +156,7 @@ TEST_F(StackBtmPowerModeConnected, BTM_SetPowerMode__ActiveToSniffTwice) { tBTM_PM_PWR_MD mode = { .mode = BTM_PM_MD_SNIFF, }; - ASSERT_EQ("BTM_CMD_STARTED", btm_status_text(BTM_SetPowerMode(pm_id_, kRawAddress, &mode))); + ASSERT_EQ("BTM_CMD_STARTED", btm_status_text(::BTM_SetPowerMode(pm_id_, kRawAddress, &mode))); ASSERT_EQ(1, get_func_call_count("btsnd_hcic_sniff_mode")); // Respond with successful command status for mode command @@ -180,7 +182,7 @@ TEST_F(StackBtmPowerModeConnected, BTM_SetPowerMode__ActiveToSniffTwice) { } // Send a second active to sniff command - ASSERT_EQ("BTM_CMD_STORED", btm_status_text(BTM_SetPowerMode(pm_id_, kRawAddress, &mode))); + ASSERT_EQ("BTM_CMD_STORED", btm_status_text(::BTM_SetPowerMode(pm_id_, kRawAddress, &mode))); // No command should be issued ASSERT_EQ(1, get_func_call_count("btsnd_hcic_sniff_mode")); diff --git a/system/stack/test/fuzzers/sdp/sdpFuzzFunctions.h b/system/stack/test/fuzzers/sdp/sdpFuzzFunctions.h index 5d9327069d..411c878fe9 100644 --- a/system/stack/test/fuzzers/sdp/sdpFuzzFunctions.h +++ b/system/stack/test/fuzzers/sdp/sdpFuzzFunctions.h @@ -279,7 +279,7 @@ static const std::vector<std::function<void(FuzzedDataProvider*)>> sdp_operation [](FuzzedDataProvider* fdp) -> void { uint32_t handle; // Output var tSDP_DI_RECORD device_info = generateArbitrarySdpDiRecord(fdp); - [[maybe_unused]] bool rc = + [[maybe_unused]] tSDP_STATUS rc = get_legacy_stack_sdp_api()->device_id.SDP_SetLocalDiRecord(&device_info, &handle); }, @@ -292,7 +292,7 @@ static const std::vector<std::function<void(FuzzedDataProvider*)>> sdp_operation std::shared_ptr<tSDP_DISCOVERY_DB> p_db( reinterpret_cast<tSDP_DISCOVERY_DB*>(malloc(db_size)), free); if (p_db) { - [[maybe_unused]] bool rc = get_legacy_stack_sdp_api()->device_id.SDP_DiDiscover( + [[maybe_unused]] tSDP_STATUS rc = get_legacy_stack_sdp_api()->device_id.SDP_DiDiscover( remote_device, p_db.get(), db_size, &sdp_disc_cmpl_cb); } }, diff --git a/system/stack/test/rfcomm/stack_rfcomm_test.cc b/system/stack/test/rfcomm/stack_rfcomm_test.cc index 86e030cc3e..669836d362 100644 --- a/system/stack/test/rfcomm/stack_rfcomm_test.cc +++ b/system/stack/test/rfcomm/stack_rfcomm_test.cc @@ -26,6 +26,7 @@ #include "osi/include/allocator.h" #include "stack/include/bt_hdr.h" #include "stack/include/bt_psm_types.h" +#include "stack/include/btm_status.h" #include "stack/include/l2c_api.h" #include "stack/include/l2cdefs.h" #include "stack/include/port_api.h" @@ -200,7 +201,7 @@ public: MultiplexingProtocolAccessRequest(peer_addr, BT_PSM_RFCOMM, false, BTM_SEC_PROTO_RFCOMM, scn, NotNull(), NotNull())) .WillOnce(DoAll(SaveArg<5>(&security_callback), SaveArg<6>(&p_port), - Return(BTM_SUCCESS))); + Return(tBTM_STATUS::BTM_SUCCESS))); // sabm_channel_dlci should be freed by this method l2cap_appl_info_.pL2CA_DataInd_Cb(lcid, sabm_channel_dlci); @@ -213,7 +214,7 @@ public: EXPECT_CALL(l2cap_interface_, DataWrite(lcid, BtHdrEqual(ua_channel_dlci))) .WillOnce(Return(tL2CAP_DW_RESULT::SUCCESS)); ASSERT_TRUE(security_callback); - security_callback(peer_addr, BT_TRANSPORT_BR_EDR, p_port, BTM_SUCCESS); + security_callback(peer_addr, BT_TRANSPORT_BR_EDR, p_port, tBTM_STATUS::BTM_SUCCESS); osi_free(ua_channel_dlci); log::verbose("Step 4"); @@ -321,7 +322,7 @@ public: MultiplexingProtocolAccessRequest(peer_addr, BT_PSM_RFCOMM, true, BTM_SEC_PROTO_RFCOMM, scn, NotNull(), NotNull())) .WillOnce(DoAll(SaveArg<5>(&security_callback), SaveArg<6>(&p_port), - Return(BTM_SUCCESS))); + Return(tBTM_STATUS::BTM_SUCCESS))); l2cap_appl_info_.pL2CA_DataInd_Cb(lcid, uih_pn_channel_3_accept); log::verbose("Step 3"); @@ -331,7 +332,7 @@ public: EXPECT_CALL(l2cap_interface_, DataWrite(lcid, BtHdrEqual(sabm_channel_3))) .WillOnce(Return(tL2CAP_DW_RESULT::SUCCESS)); ASSERT_TRUE(security_callback); - security_callback(peer_addr, BT_TRANSPORT_BR_EDR, p_port, BTM_SUCCESS); + security_callback(peer_addr, BT_TRANSPORT_BR_EDR, p_port, tBTM_STATUS::BTM_SUCCESS); osi_free(sabm_channel_3); log::verbose("Step 4"); @@ -737,8 +738,8 @@ TEST_F(StackRfcommTest, DISABLED_TestConnectionCollision) { MultiplexingProtocolAccessRequest(test_address, BT_PSM_RFCOMM, false, BTM_SEC_PROTO_RFCOMM, test_server_scn, NotNull(), NotNull())) - .WillOnce( - DoAll(SaveArg<5>(&security_callback), SaveArg<6>(&p_port), Return(BTM_SUCCESS))); + .WillOnce(DoAll(SaveArg<5>(&security_callback), SaveArg<6>(&p_port), + Return(tBTM_STATUS::BTM_SUCCESS))); l2cap_appl_info_.pL2CA_DataInd_Cb(new_lcid, sabm_server_scn); log::verbose("Step 10"); @@ -751,7 +752,7 @@ TEST_F(StackRfcommTest, DISABLED_TestConnectionCollision) { // Callback should come from server port instead, client port will timeout // in 20 seconds EXPECT_CALL(rfcomm_callback_, PortManagementCallback(PORT_SUCCESS, server_handle, 0)); - security_callback(test_address, BT_TRANSPORT_BR_EDR, p_port, BTM_SUCCESS); + security_callback(test_address, BT_TRANSPORT_BR_EDR, p_port, tBTM_STATUS::BTM_SUCCESS); osi_free(ua_server_scn); log::verbose("Step 11"); diff --git a/system/stack/test/sdp/stack_sdp_test.cc b/system/stack/test/sdp/stack_sdp_test.cc index b69b1db9aa..5a86aa565f 100644 --- a/system/stack/test/sdp/stack_sdp_test.cc +++ b/system/stack/test/sdp/stack_sdp_test.cc @@ -107,7 +107,7 @@ TEST_F(StackSdpInitTest, sdp_service_search_request) { ASSERT_EQ(p_ccb->con_state, tSDP_STATE::CONNECTED); - sdp_disconnect(p_ccb, SDP_SUCCESS); + sdp_disconnect(p_ccb, tSDP_STATUS::SDP_SUCCESS); sdp_cb.reg_info.pL2CA_DisconnectCfm_Cb(p_ccb->connection_id, 0); ASSERT_EQ(p_ccb->con_state, tSDP_STATE::IDLE); @@ -145,13 +145,13 @@ TEST_F(StackSdpInitTest, sdp_service_search_request_queuing) { ASSERT_EQ(p_ccb1->con_state, tSDP_STATE::CONNECTED); ASSERT_EQ(p_ccb2->con_state, tSDP_STATE::CONN_PEND); - p_ccb1->disconnect_reason = SDP_SUCCESS; - sdp_disconnect(p_ccb1, SDP_SUCCESS); + p_ccb1->disconnect_reason = tSDP_STATUS::SDP_SUCCESS; + sdp_disconnect(p_ccb1, tSDP_STATUS::SDP_SUCCESS); ASSERT_EQ(p_ccb1->con_state, tSDP_STATE::IDLE); ASSERT_EQ(p_ccb2->con_state, tSDP_STATE::CONNECTED); - sdp_disconnect(p_ccb2, SDP_SUCCESS); + sdp_disconnect(p_ccb2, tSDP_STATUS::SDP_SUCCESS); sdp_cb.reg_info.pL2CA_DisconnectCfm_Cb(p_ccb2->connection_id, 0); ASSERT_EQ(p_ccb1->con_state, tSDP_STATE::IDLE); @@ -159,7 +159,7 @@ TEST_F(StackSdpInitTest, sdp_service_search_request_queuing) { } void sdp_callback(const RawAddress& /* bd_addr */, tSDP_RESULT result) { - if (result == SDP_SUCCESS) { + if (result == tSDP_STATUS::SDP_SUCCESS) { ASSERT_TRUE(SDP_ServiceSearchRequest(addr, sdp_db, nullptr)); } } @@ -177,7 +177,7 @@ TEST_F(StackSdpInitTest, sdp_service_search_request_queuing_race_condition) { ASSERT_EQ(p_ccb1->con_state, tSDP_STATE::CONNECTED); - sdp_disconnect(p_ccb1, SDP_SUCCESS); + sdp_disconnect(p_ccb1, tSDP_STATUS::SDP_SUCCESS); sdp_cb.reg_info.pL2CA_DisconnectCfm_Cb(p_ccb1->connection_id, 0); const int cid2 = L2CA_ConnectReqWithSecurity_cid; @@ -187,7 +187,7 @@ TEST_F(StackSdpInitTest, sdp_service_search_request_queuing_race_condition) { // If race condition, this will be stuck in PEND ASSERT_EQ(p_ccb2->con_state, tSDP_STATE::CONN_SETUP); - sdp_disconnect(p_ccb2, SDP_SUCCESS); + sdp_disconnect(p_ccb2, tSDP_STATUS::SDP_SUCCESS); } TEST_F(StackSdpInitTest, sdp_disc_wait_text) { @@ -243,26 +243,32 @@ TEST_F(StackSdpInitTest, sdp_flags_text) { TEST_F(StackSdpInitTest, sdp_status_text) { std::vector<std::pair<tSDP_STATUS, std::string>> status = { - std::make_pair(SDP_SUCCESS, "SDP_SUCCESS"), - std::make_pair(SDP_INVALID_VERSION, "SDP_INVALID_VERSION"), - std::make_pair(SDP_INVALID_SERV_REC_HDL, "SDP_INVALID_SERV_REC_HDL"), - std::make_pair(SDP_INVALID_REQ_SYNTAX, "SDP_INVALID_REQ_SYNTAX"), - std::make_pair(SDP_INVALID_PDU_SIZE, "SDP_INVALID_PDU_SIZE"), - std::make_pair(SDP_INVALID_CONT_STATE, "SDP_INVALID_CONT_STATE"), - std::make_pair(SDP_NO_RESOURCES, "SDP_NO_RESOURCES"), - std::make_pair(SDP_DI_REG_FAILED, "SDP_DI_REG_FAILED"), - std::make_pair(SDP_DI_DISC_FAILED, "SDP_DI_DISC_FAILED"), - std::make_pair(SDP_NO_DI_RECORD_FOUND, "SDP_NO_DI_RECORD_FOUND"), - std::make_pair(SDP_ERR_ATTR_NOT_PRESENT, "SDP_ERR_ATTR_NOT_PRESENT"), - std::make_pair(SDP_ILLEGAL_PARAMETER, "SDP_ILLEGAL_PARAMETER"), - std::make_pair(HID_SDP_NO_SERV_UUID, "HID_SDP_NO_SERV_UUID"), - std::make_pair(HID_SDP_MANDATORY_MISSING, "HID_SDP_MANDATORY_MISSING"), - std::make_pair(SDP_NO_RECS_MATCH, "SDP_NO_RECS_MATCH"), - std::make_pair(SDP_CONN_FAILED, "SDP_CONN_FAILED"), - std::make_pair(SDP_CFG_FAILED, "SDP_CFG_FAILED"), - std::make_pair(SDP_GENERIC_ERROR, "SDP_GENERIC_ERROR"), - std::make_pair(SDP_DB_FULL, "SDP_DB_FULL"), - std::make_pair(SDP_CANCEL, "SDP_CANCEL"), + std::make_pair(tSDP_STATUS::SDP_SUCCESS, "tSDP_STATUS::SDP_SUCCESS"), + std::make_pair(tSDP_STATUS::SDP_INVALID_VERSION, "tSDP_STATUS::SDP_INVALID_VERSION"), + std::make_pair(tSDP_STATUS::SDP_INVALID_SERV_REC_HDL, + "tSDP_STATUS::SDP_INVALID_SERV_REC_HDL"), + std::make_pair(tSDP_STATUS::SDP_INVALID_REQ_SYNTAX, + "tSDP_STATUS::SDP_INVALID_REQ_SYNTAX"), + std::make_pair(tSDP_STATUS::SDP_INVALID_PDU_SIZE, "tSDP_STATUS::SDP_INVALID_PDU_SIZE"), + std::make_pair(tSDP_STATUS::SDP_INVALID_CONT_STATE, + "tSDP_STATUS::SDP_INVALID_CONT_STATE"), + std::make_pair(tSDP_STATUS::SDP_NO_RESOURCES, "tSDP_STATUS::SDP_NO_RESOURCES"), + std::make_pair(tSDP_STATUS::SDP_DI_REG_FAILED, "tSDP_STATUS::SDP_DI_REG_FAILED"), + std::make_pair(tSDP_STATUS::SDP_DI_DISC_FAILED, "tSDP_STATUS::SDP_DI_DISC_FAILED"), + std::make_pair(tSDP_STATUS::SDP_NO_DI_RECORD_FOUND, + "tSDP_STATUS::SDP_NO_DI_RECORD_FOUND"), + std::make_pair(tSDP_STATUS::SDP_ERR_ATTR_NOT_PRESENT, + "tSDP_STATUS::SDP_ERR_ATTR_NOT_PRESENT"), + std::make_pair(tSDP_STATUS::SDP_ILLEGAL_PARAMETER, "tSDP_STATUS::SDP_ILLEGAL_PARAMETER"), + std::make_pair(tSDP_STATUS::HID_SDP_NO_SERV_UUID, "tSDP_STATUS::HID_SDP_NO_SERV_UUID"), + std::make_pair(tSDP_STATUS::HID_SDP_MANDATORY_MISSING, + "tSDP_STATUS::HID_SDP_MANDATORY_MISSING"), + std::make_pair(tSDP_STATUS::SDP_NO_RECS_MATCH, "tSDP_STATUS::SDP_NO_RECS_MATCH"), + std::make_pair(tSDP_STATUS::SDP_CONN_FAILED, "tSDP_STATUS::SDP_CONN_FAILED"), + std::make_pair(tSDP_STATUS::SDP_CFG_FAILED, "tSDP_STATUS::SDP_CFG_FAILED"), + std::make_pair(tSDP_STATUS::SDP_GENERIC_ERROR, "tSDP_STATUS::SDP_GENERIC_ERROR"), + std::make_pair(tSDP_STATUS::SDP_DB_FULL, "tSDP_STATUS::SDP_DB_FULL"), + std::make_pair(tSDP_STATUS::SDP_CANCEL, "tSDP_STATUS::SDP_CANCEL"), }; for (const auto& stat : status) { ASSERT_STREQ(stat.second.c_str(), sdp_status_text(stat.first).c_str()); diff --git a/system/test/headless/mode/mode.cc b/system/test/headless/mode/mode.cc index 6b2fefd176..ac16cc98cd 100644 --- a/system/test/headless/mode/mode.cc +++ b/system/test/headless/mode/mode.cc @@ -88,7 +88,7 @@ int do_mode([[maybe_unused]] unsigned int num_loops, [[maybe_unused]] const RawA pwr_command_t pwr_command; pwr_result_t result = client.set_typical_sniff(std::move(pwr_command)); LOG_CONSOLE("Sniff mode command sent"); - if (result.btm_status == BTM_CMD_STARTED) { + if (result.btm_status == tBTM_STATUS::BTM_CMD_STARTED) { // This awaits the command status callback power_mode_callback_t cmd_status = result.cmd_status_future.get(); LOG_CONSOLE("Sniff mode command complete:%s", cmd_status.ToString().c_str()); @@ -109,7 +109,7 @@ int do_mode([[maybe_unused]] unsigned int num_loops, [[maybe_unused]] const RawA pwr_command_t pwr_command; pwr_result_t result = client.set_active(std::move(pwr_command)); LOG_CONSOLE("Active mode command sent"); - if (result.btm_status == BTM_CMD_STARTED) { + if (result.btm_status == tBTM_STATUS::BTM_CMD_STARTED) { power_mode_callback_t cmd_status = result.cmd_status_future.get(); LOG_CONSOLE("Active mode command complete:%s", cmd_status.ToString().c_str()); if (cmd_status.status == BTM_PM_STS_PENDING) { diff --git a/system/test/headless/read/name.cc b/system/test/headless/read/name.cc index 32e013715b..06d4df311b 100644 --- a/system/test/headless/read/name.cc +++ b/system/test/headless/read/name.cc @@ -23,6 +23,7 @@ #include "stack/btm/neighbor_inquiry.h" #include "stack/include/bt_name.h" #include "stack/include/btm_client_interface.h" +#include "stack/include/btm_status.h" #include "test/headless/get_options.h" #include "test/headless/headless.h" #include "types/raw_address.h" @@ -52,25 +53,26 @@ int bluetooth::test::headless::Name::Run() { tBTM_STATUS status = get_btm_client_interface().peer.BTM_ReadRemoteDeviceName( raw_address, &RemoteNameCallback, BT_TRANSPORT_BR_EDR); - if (status != BTM_CMD_STARTED) { + if (status != tBTM_STATUS::BTM_CMD_STARTED) { fprintf(stdout, "Failure to start read remote device\n"); return -1; } tBTM_REMOTE_DEV_NAME name_packet = future.get(); - switch (name_packet.status) { - case BTM_SUCCESS: { + switch (name_packet.btm_status) { + case tBTM_STATUS::BTM_SUCCESS: { char buf[BD_NAME_LEN]; memcpy(buf, name_packet.remote_bd_name, BD_NAME_LEN); std::string name(buf); fprintf(stdout, "Name result mac:%s name:%s\n", raw_address.ToString().c_str(), name.c_str()); } break; - case BTM_BAD_VALUE_RET: + case tBTM_STATUS::BTM_BAD_VALUE_RET: fprintf(stdout, "Name Timeout or other failure"); return -2; default: - fprintf(stdout, "Unexpected remote name request failure status:%hd", name_packet.status); + fprintf(stdout, "Unexpected remote name request failure status:%hd", + name_packet.btm_status); return -2; } return 0; diff --git a/system/test/headless/sdp/sdp.cc b/system/test/headless/sdp/sdp.cc index 7e081b6444..9070f3c3ca 100644 --- a/system/test/headless/sdp/sdp.cc +++ b/system/test/headless/sdp/sdp.cc @@ -69,9 +69,9 @@ int sdp_query_uuid([[maybe_unused]] unsigned int num_loops, LOG_CONSOLE("Started service search for uuid:%s", uuid.ToString().c_str()); const tSDP_STATUS result = future.get(); - if (result != SDP_SUCCESS) { + if (result != tSDP_STATUS::SDP_SUCCESS) { fprintf(stdout, "Failed search discovery result:%s\n", sdp_status_text(result).c_str()); - return result; + return static_cast<int>(result); } LOG_CONSOLE("Found records peer:%s uuid:%s", raw_address.ToString().c_str(), diff --git a/system/test/headless/utils/power_mode_client.h b/system/test/headless/utils/power_mode_client.h index 90e7372d48..994aeea21d 100644 --- a/system/test/headless/utils/power_mode_client.h +++ b/system/test/headless/utils/power_mode_client.h @@ -181,7 +181,7 @@ public: }); }); - log::assert_that(BTM_SUCCESS == btm_status, "Failed to register power mode:{}", + log::assert_that(tBTM_STATUS::BTM_SUCCESS == btm_status, "Failed to register power mode:{}", btm_status_text(btm_status)); } @@ -190,7 +190,7 @@ public: BTM_PM_DEREG, &pm_id_, []([[maybe_unused]] const RawAddress& bd_addr, [[maybe_unused]] tBTM_PM_STATUS status, [[maybe_unused]] uint16_t value, [[maybe_unused]] tHCI_STATUS hci_status) {}); - log::assert_that(BTM_SUCCESS == status, "assert failed: BTM_SUCCESS == status"); + log::assert_that(tBTM_STATUS::BTM_SUCCESS == status, "assert failed: BTM_SUCCESS == status"); } Client GetClient(const RawAddress bd_addr) { return Client(pm_id_, bd_addr); } diff --git a/system/test/mock/mock_bta_hh_api.cc b/system/test/mock/mock_bta_hh_api.cc index e201324175..0eecdc6d67 100644 --- a/system/test/mock/mock_bta_hh_api.cc +++ b/system/test/mock/mock_bta_hh_api.cc @@ -72,3 +72,4 @@ void BTA_HhSetReport(uint8_t /* dev_handle */, tBTA_HH_RPT_TYPE /* r_type */, BT_HDR* /* p_data */) { inc_func_call_count(__func__); } +void BTA_HhDump(int /* fd */) { inc_func_call_count(__func__); } diff --git a/system/test/mock/mock_bta_hh_utils.cc b/system/test/mock/mock_bta_hh_utils.cc index b48524f4fb..e45da05966 100644 --- a/system/test/mock/mock_bta_hh_utils.cc +++ b/system/test/mock/mock_bta_hh_utils.cc @@ -38,7 +38,6 @@ namespace bta_hh_utils { struct bta_hh_add_device_to_list bta_hh_add_device_to_list; struct bta_hh_clean_up_kdev bta_hh_clean_up_kdev; struct bta_hh_cleanup_disable bta_hh_cleanup_disable; -struct bta_hh_dev_handle_to_cb_idx bta_hh_dev_handle_to_cb_idx; struct bta_hh_find_cb bta_hh_find_cb; struct bta_hh_get_cb bta_hh_get_cb; struct bta_hh_read_ssr_param bta_hh_read_ssr_param; @@ -67,11 +66,7 @@ void bta_hh_cleanup_disable(tBTA_HH_STATUS status) { inc_func_call_count(__func__); test::mock::bta_hh_utils::bta_hh_cleanup_disable(status); } -uint8_t bta_hh_dev_handle_to_cb_idx(uint8_t dev_handle) { - inc_func_call_count(__func__); - return test::mock::bta_hh_utils::bta_hh_dev_handle_to_cb_idx(dev_handle); -} -uint8_t bta_hh_find_cb(const tAclLinkSpec& link_spec) { +tBTA_HH_DEV_CB* bta_hh_find_cb(const tAclLinkSpec& link_spec) { inc_func_call_count(__func__); return test::mock::bta_hh_utils::bta_hh_find_cb(link_spec); } diff --git a/system/test/mock/mock_bta_hh_utils.h b/system/test/mock/mock_bta_hh_utils.h index 2e587af1dd..a46d616732 100644 --- a/system/test/mock/mock_bta_hh_utils.h +++ b/system/test/mock/mock_bta_hh_utils.h @@ -73,25 +73,14 @@ struct bta_hh_cleanup_disable { }; extern struct bta_hh_cleanup_disable bta_hh_cleanup_disable; -// Name: bta_hh_dev_handle_to_cb_idx -// Params: uint8_t dev_handle -// Return: uint8_t -struct bta_hh_dev_handle_to_cb_idx { - uint8_t return_value{0}; - std::function<uint8_t(uint8_t dev_handle)> body{ - [this](uint8_t /* dev_handle */) { return return_value; }}; - uint8_t operator()(uint8_t dev_handle) { return body(dev_handle); } -}; -extern struct bta_hh_dev_handle_to_cb_idx bta_hh_dev_handle_to_cb_idx; - // Name: bta_hh_find_cb // Params: const tAclLinkSpec& link_spec // Return: uint8_t struct bta_hh_find_cb { - uint8_t return_value{0}; - std::function<uint8_t(const tAclLinkSpec& link_spec)> body{ + tBTA_HH_DEV_CB* return_value{nullptr}; + std::function<tBTA_HH_DEV_CB*(const tAclLinkSpec& link_spec)> body{ [this](const tAclLinkSpec& /* link_spec */) { return return_value; }}; - uint8_t operator()(const tAclLinkSpec& link_spec) { return body(link_spec); } + tBTA_HH_DEV_CB* operator()(const tAclLinkSpec& link_spec) { return body(link_spec); } }; extern struct bta_hh_find_cb bta_hh_find_cb; diff --git a/system/test/mock/mock_btif_co_bta_av_co.cc b/system/test/mock/mock_btif_co_bta_av_co.cc index af45a3dc11..2c7f9f39fe 100644 --- a/system/test/mock/mock_btif_co_bta_av_co.cc +++ b/system/test/mock/mock_btif_co_bta_av_co.cc @@ -153,13 +153,13 @@ void bta_av_co_audio_update_mtu(tBTA_AV_HNDL bta_av_handle, const RawAddress& pe inc_func_call_count(__func__); test::mock::btif_co_bta_av_co::bta_av_co_audio_update_mtu(bta_av_handle, peer_address, mtu); } -int bta_av_co_get_encoder_effective_frame_size() { +int bta_av_co_get_encoder_effective_frame_size(const RawAddress& peer_address) { inc_func_call_count(__func__); - return test::mock::btif_co_bta_av_co::bta_av_co_get_encoder_effective_frame_size(); + return test::mock::btif_co_bta_av_co::bta_av_co_get_encoder_effective_frame_size(peer_address); } -const tA2DP_ENCODER_INTERFACE* bta_av_co_get_encoder_interface(void) { +const tA2DP_ENCODER_INTERFACE* bta_av_co_get_encoder_interface(const RawAddress& peer_address) { inc_func_call_count(__func__); - return test::mock::btif_co_bta_av_co::bta_av_co_get_encoder_interface(); + return test::mock::btif_co_bta_av_co::bta_av_co_get_encoder_interface(peer_address); } void bta_av_co_get_peer_params(const RawAddress& peer_address, tA2DP_ENCODER_INIT_PEER_PARAMS* p_peer_params) { diff --git a/system/test/mock/mock_btif_co_bta_av_co.h b/system/test/mock/mock_btif_co_bta_av_co.h index b52c91ed86..1ac6c6d0f4 100644 --- a/system/test/mock/mock_btif_co_bta_av_co.h +++ b/system/test/mock/mock_btif_co_bta_av_co.h @@ -230,8 +230,9 @@ extern struct bta_av_co_audio_update_mtu bta_av_co_audio_update_mtu; // Return: int struct bta_av_co_get_encoder_effective_frame_size { static int return_value; - std::function<int()> body{[]() { return return_value; }}; - int operator()() { return body(); } + std::function<int(const RawAddress& peer_address)> body{ + [](const RawAddress& /* peer_address */) { return return_value; }}; + int operator()(const RawAddress& peer_address) { return body(peer_address); } }; extern struct bta_av_co_get_encoder_effective_frame_size bta_av_co_get_encoder_effective_frame_size; @@ -240,8 +241,11 @@ extern struct bta_av_co_get_encoder_effective_frame_size bta_av_co_get_encoder_e // Return: const tA2DP_ENCODER_INTERFACE* struct bta_av_co_get_encoder_interface { static const tA2DP_ENCODER_INTERFACE* return_value; - std::function<const tA2DP_ENCODER_INTERFACE*(void)> body{[](void) { return return_value; }}; - const tA2DP_ENCODER_INTERFACE* operator()(void) { return body(); } + std::function<const tA2DP_ENCODER_INTERFACE*(const RawAddress& peer_address)> body{ + [](const RawAddress& /* peer_address */) { return return_value; }}; + const tA2DP_ENCODER_INTERFACE* operator()(const RawAddress& peer_address) { + return body(peer_address); + } }; extern struct bta_av_co_get_encoder_interface bta_av_co_get_encoder_interface; diff --git a/system/test/mock/mock_main_shim.cc b/system/test/mock/mock_main_shim.cc index ccb175cf1b..8e26aaeecd 100644 --- a/system/test/mock/mock_main_shim.cc +++ b/system/test/mock/mock_main_shim.cc @@ -24,10 +24,6 @@ #include "main/shim/shim.h" #include "test/common/mock_functions.h" -bool bluetooth::shim::is_classic_discovery_only_enabled() { - inc_func_call_count(__func__); - return false; -} namespace test { namespace mock { bool bluetooth_shim_is_gd_stack_started_up = false; diff --git a/system/test/mock/mock_main_shim_btm_api.cc b/system/test/mock/mock_main_shim_btm_api.cc index 9f2ba178f5..e65ea2e136 100644 --- a/system/test/mock/mock_main_shim_btm_api.cc +++ b/system/test/mock/mock_main_shim_btm_api.cc @@ -22,64 +22,62 @@ #include <cstdint> #include "main/shim/btm_api.h" -#include "stack/include/bt_octets.h" -#include "stack/include/btm_ble_api_types.h" +#include "stack/include/btm_status.h" #include "test/common/mock_functions.h" -#include "types/bt_transport.h" #include "types/raw_address.h" tBTM_STATUS bluetooth::shim::BTM_ClearEventFilter() { inc_func_call_count(__func__); - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } tBTM_STATUS bluetooth::shim::BTM_ClearEventMask() { inc_func_call_count(__func__); - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } tBTM_STATUS bluetooth::shim::BTM_ClearFilterAcceptList() { inc_func_call_count(__func__); - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } tBTM_STATUS bluetooth::shim::BTM_DisconnectAllAcls() { inc_func_call_count(__func__); - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } tBTM_STATUS bluetooth::shim::BTM_SetEventFilterConnectionSetupAllDevices() { inc_func_call_count(__func__); - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } tBTM_STATUS bluetooth::shim::BTM_AllowWakeByHid( std::vector<RawAddress> /* classic_hid_devices */, std::vector<std::pair<RawAddress, uint8_t>> /* le_hid_devices */) { inc_func_call_count(__func__); - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } tBTM_STATUS bluetooth::shim::BTM_RestoreFilterAcceptList( std::vector<std::pair<RawAddress, uint8_t>> /* le_devices */) { inc_func_call_count(__func__); - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } tBTM_STATUS bluetooth::shim::BTM_SetDefaultEventMaskExcept(uint64_t /* mask */, uint64_t /* le_mask */) { inc_func_call_count(__func__); - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } tBTM_STATUS bluetooth::shim::BTM_SetEventFilterInquiryResultAllDevices() { inc_func_call_count(__func__); - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } tBTM_STATUS bluetooth::shim::BTM_BleResetId() { inc_func_call_count(__func__); - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } size_t bluetooth::shim::BTM_BleGetNumberOfAdvertisingInstancesInUse() { inc_func_call_count(__func__); diff --git a/system/test/mock/mock_stack_acl.cc b/system/test/mock/mock_stack_acl.cc index fa4209499a..89ad3da5f0 100644 --- a/system/test/mock/mock_stack_acl.cc +++ b/system/test/mock/mock_stack_acl.cc @@ -68,7 +68,6 @@ struct acl_get_connection_from_handle acl_get_connection_from_handle; struct BTM_ReadFailedContactCounter BTM_ReadFailedContactCounter; struct BTM_ReadTxPower BTM_ReadTxPower; struct BTM_SetLinkSuperTout BTM_SetLinkSuperTout; -struct BTM_SwitchRoleToCentral BTM_SwitchRoleToCentral; struct btm_remove_acl btm_remove_acl; struct btm_get_acl_disc_reason_code btm_get_acl_disc_reason_code; struct btm_is_acl_locally_initiated btm_is_acl_locally_initiated; @@ -77,11 +76,8 @@ struct acl_get_supported_packet_types acl_get_supported_packet_types; struct acl_link_role_from_handle acl_link_role_from_handle; struct btm_handle_to_acl_index btm_handle_to_acl_index; struct BTM_ReadConnectionAddr BTM_ReadConnectionAddr; -struct BTM_RequestPeerSCA BTM_RequestPeerSCA; struct BTM_acl_after_controller_started BTM_acl_after_controller_started; struct btm_connection_request btm_connection_request; -struct BTM_unblock_role_switch_for BTM_unblock_role_switch_for; -struct BTM_unblock_sniff_mode_for BTM_unblock_sniff_mode_for; struct acl_disconnect_after_role_switch acl_disconnect_after_role_switch; struct acl_disconnect_from_handle acl_disconnect_from_handle; struct acl_packets_completed acl_packets_completed; @@ -247,10 +243,6 @@ tBTM_STATUS BTM_SetLinkSuperTout(const RawAddress& remote_bda, uint16_t timeout) inc_func_call_count(__func__); return test::mock::stack_acl::BTM_SetLinkSuperTout(remote_bda, timeout); } -tBTM_STATUS BTM_SwitchRoleToCentral(const RawAddress& remote_bd_addr) { - inc_func_call_count(__func__); - return test::mock::stack_acl::BTM_SwitchRoleToCentral(remote_bd_addr); -} tBTM_STATUS btm_remove_acl(const RawAddress& bd_addr, tBT_TRANSPORT transport) { inc_func_call_count(__func__); return test::mock::stack_acl::btm_remove_acl(bd_addr, transport); @@ -285,22 +277,10 @@ void BTM_ReadConnectionAddr(const RawAddress& remote_bda, RawAddress& local_conn test::mock::stack_acl::BTM_ReadConnectionAddr(remote_bda, local_conn_addr, p_addr_type, ota_address); } -void BTM_RequestPeerSCA(const RawAddress& remote_bda, tBT_TRANSPORT transport) { - inc_func_call_count(__func__); - test::mock::stack_acl::BTM_RequestPeerSCA(remote_bda, transport); -} void BTM_acl_after_controller_started() { inc_func_call_count(__func__); test::mock::stack_acl::BTM_acl_after_controller_started(); } -void BTM_unblock_role_switch_for(const RawAddress& peer_addr) { - inc_func_call_count(__func__); - test::mock::stack_acl::BTM_unblock_role_switch_for(peer_addr); -} -void BTM_unblock_sniff_mode_for(const RawAddress& peer_addr) { - inc_func_call_count(__func__); - test::mock::stack_acl::BTM_unblock_sniff_mode_for(peer_addr); -} void acl_disconnect_after_role_switch(uint16_t conn_handle, tHCI_STATUS reason, std::string comment) { inc_func_call_count(__func__); diff --git a/system/test/mock/mock_stack_acl.h b/system/test/mock/mock_stack_acl.h index 846f2577e2..d175d230a0 100644 --- a/system/test/mock/mock_stack_acl.h +++ b/system/test/mock/mock_stack_acl.h @@ -29,8 +29,8 @@ #include "hci/class_of_device.h" #include "stack/acl/acl.h" #include "stack/btm/security_device_record.h" -#include "stack/include/acl_client_callbacks.h" #include "stack/include/bt_hdr.h" +#include "stack/include/btm_status.h" #include "types/raw_address.h" // Mocked compile conditionals, if any @@ -278,7 +278,9 @@ extern struct acl_get_connection_from_handle acl_get_connection_from_handle; // Returns: tBTM_STATUS struct BTM_ReadFailedContactCounter { std::function<tBTM_STATUS(const RawAddress& remote_bda, tBTM_CMPL_CB* p_cb)> body{ - [](const RawAddress& /* remote_bda */, tBTM_CMPL_CB* /* p_cb */) { return BTM_SUCCESS; }}; + [](const RawAddress& /* remote_bda */, tBTM_CMPL_CB* /* p_cb */) { + return tBTM_STATUS::BTM_SUCCESS; + }}; tBTM_STATUS operator()(const RawAddress& remote_bda, tBTM_CMPL_CB* p_cb) { return body(remote_bda, p_cb); } @@ -291,7 +293,7 @@ struct BTM_ReadTxPower { std::function<tBTM_STATUS(const RawAddress& remote_bda, tBT_TRANSPORT transport, tBTM_CMPL_CB* p_cb)> body{[](const RawAddress& /* remote_bda */, tBT_TRANSPORT /* transport */, - tBTM_CMPL_CB* /* p_cb */) { return BTM_SUCCESS; }}; + tBTM_CMPL_CB* /* p_cb */) { return tBTM_STATUS::BTM_SUCCESS; }}; tBTM_STATUS operator()(const RawAddress& remote_bda, tBT_TRANSPORT transport, tBTM_CMPL_CB* p_cb) { return body(remote_bda, transport, p_cb); @@ -303,28 +305,21 @@ extern struct BTM_ReadTxPower BTM_ReadTxPower; // Returns: tBTM_STATUS struct BTM_SetLinkSuperTout { std::function<tBTM_STATUS(const RawAddress& remote_bda, uint16_t timeout)> body{ - [](const RawAddress& /* remote_bda */, uint16_t /* timeout */) { return BTM_SUCCESS; }}; + [](const RawAddress& /* remote_bda */, uint16_t /* timeout */) { + return tBTM_STATUS::BTM_SUCCESS; + }}; tBTM_STATUS operator()(const RawAddress& remote_bda, uint16_t timeout) { return body(remote_bda, timeout); } }; extern struct BTM_SetLinkSuperTout BTM_SetLinkSuperTout; -// Name: BTM_SwitchRoleToCentral -// Params: const RawAddress& remote_bd_addr -// Returns: tBTM_STATUS -struct BTM_SwitchRoleToCentral { - std::function<tBTM_STATUS(const RawAddress& remote_bd_addr)> body{ - [](const RawAddress& /* remote_bd_addr */) { return BTM_SUCCESS; }}; - tBTM_STATUS operator()(const RawAddress& remote_bd_addr) { return body(remote_bd_addr); } -}; -extern struct BTM_SwitchRoleToCentral BTM_SwitchRoleToCentral; // Name: btm_remove_acl // Params: const RawAddress& bd_addr, tBT_TRANSPORT transport // Returns: tBTM_STATUS struct btm_remove_acl { std::function<tBTM_STATUS(const RawAddress& bd_addr, tBT_TRANSPORT transport)> body{ [](const RawAddress& /* bd_addr */, tBT_TRANSPORT /* transport */) { - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; }}; tBTM_STATUS operator()(const RawAddress& bd_addr, tBT_TRANSPORT transport) { return body(bd_addr, transport); @@ -393,17 +388,6 @@ struct BTM_ReadConnectionAddr { } }; extern struct BTM_ReadConnectionAddr BTM_ReadConnectionAddr; -// Name: BTM_RequestPeerSCA -// Params: const RawAddress& remote_bda, tBT_TRANSPORT transport -// Returns: void -struct BTM_RequestPeerSCA { - std::function<void(const RawAddress& remote_bda, tBT_TRANSPORT transport)> body{ - [](const RawAddress& /* remote_bda */, tBT_TRANSPORT /* transport */) { ; }}; - void operator()(const RawAddress& remote_bda, tBT_TRANSPORT transport) { - body(remote_bda, transport); - } -}; -extern struct BTM_RequestPeerSCA BTM_RequestPeerSCA; // Name: BTM_acl_after_controller_started // Returns: void struct BTM_acl_after_controller_started { @@ -411,24 +395,6 @@ struct BTM_acl_after_controller_started { void operator()() { body(); } }; extern struct BTM_acl_after_controller_started BTM_acl_after_controller_started; -// Name: BTM_unblock_role_switch_for -// Params: const RawAddress& peer_addr -// Returns: void -struct BTM_unblock_role_switch_for { - std::function<void(const RawAddress& peer_addr)> body{ - [](const RawAddress& /* peer_addr */) { ; }}; - void operator()(const RawAddress& peer_addr) { body(peer_addr); } -}; -extern struct BTM_unblock_role_switch_for BTM_unblock_role_switch_for; -// Name: BTM_unblock_sniff_mode_for -// Params: const RawAddress& peer_addr -// Returns: void -struct BTM_unblock_sniff_mode_for { - std::function<void(const RawAddress& peer_addr)> body{ - [](const RawAddress& /* peer_addr */) { ; }}; - void operator()(const RawAddress& peer_addr) { body(peer_addr); } -}; -extern struct BTM_unblock_sniff_mode_for BTM_unblock_sniff_mode_for; // Name: acl_disconnect_after_role_switch // Params: uint16_t conn_handle, tHCI_STATUS reason // Returns: void diff --git a/system/test/mock/mock_stack_acl_btm_pm.cc b/system/test/mock/mock_stack_acl_btm_pm.cc index 133f963cc0..f57dbf641c 100644 --- a/system/test/mock/mock_stack_acl_btm_pm.cc +++ b/system/test/mock/mock_stack_acl_btm_pm.cc @@ -54,16 +54,6 @@ uint32_t BTM_PM_ReadBleScanDutyCycle(void) { inc_func_call_count(__func__); return 0; } -tBTM_STATUS BTM_SetPowerMode(uint8_t /* pm_id */, const RawAddress& /* remote_bda */, - const tBTM_PM_PWR_MD* /* p_mode */) { - inc_func_call_count(__func__); - return BTM_SUCCESS; -} -tBTM_STATUS BTM_SetSsrParams(const RawAddress& /* remote_bda */, uint16_t /* max_lat */, - uint16_t /* min_rmt_to */, uint16_t /* min_loc_to */) { - inc_func_call_count(__func__); - return BTM_SUCCESS; -} void BTM_PM_OnConnected(uint16_t /* handle */, const RawAddress& /* remote_bda */) { inc_func_call_count(__func__); } diff --git a/system/gd/discovery/device/data_parser.h b/system/test/mock/mock_stack_ais_ble.cc index 75ebe88118..29630207b4 100644 --- a/system/gd/discovery/device/data_parser.h +++ b/system/test/mock/mock_stack_ais_ble.cc @@ -14,28 +14,7 @@ * limitations under the License. */ -#pragma once +#include "stack/include/ais_api.h" +#include "test/common/mock_functions.h" -#include <vector> - -#include "hci/hci_packets.h" - -namespace bluetooth { -namespace discovery { -namespace device { - -class DataParser { -public: - DataParser(const std::vector<uint8_t>& data); - - std::vector<hci::GapData> GetData() const; - std::vector<hci::GapDataType> GetDataTypes() const; - size_t GetNumGapData() const; - -protected: - std::vector<hci::GapData> gap_data_; -}; - -} // namespace device -} // namespace discovery -} // namespace bluetooth +void AIS_Init(void) { inc_func_call_count(__func__); } diff --git a/system/test/mock/mock_stack_btm_ble.cc b/system/test/mock/mock_stack_btm_ble.cc index 7bf217c4a6..72873911af 100644 --- a/system/test/mock/mock_stack_btm_ble.cc +++ b/system/test/mock/mock_stack_btm_ble.cc @@ -56,9 +56,8 @@ struct BTM_GetRemoteDeviceName BTM_GetRemoteDeviceName; struct BTM_SecAddBleDevice BTM_SecAddBleDevice; struct BTM_SecAddBleKey BTM_SecAddBleKey; struct BTM_SecurityGrant BTM_SecurityGrant; -struct BTM_SetBleDataLength BTM_SetBleDataLength; -struct BTM_UseLeLink BTM_UseLeLink; struct btm_ble_connected btm_ble_connected; +struct btm_ble_connection_established btm_ble_connection_established; struct btm_ble_get_acl_remote_addr btm_ble_get_acl_remote_addr; struct btm_ble_get_enc_key_type btm_ble_get_enc_key_type; struct btm_ble_link_encrypted btm_ble_link_encrypted; @@ -100,23 +99,21 @@ const Octet16 BTM_GetDeviceEncRoot::return_value{0xd5, 0xcb, 0x84, 0x54, 0xd1, 0 0xff, 0xff, 0xb2, 0xec, 0x71, 0x2b, 0xae, 0xab}; const Octet16 BTM_GetDeviceIDRoot::return_value{0xd5, 0xcb, 0x84, 0x54, 0xd1, 0x77, 0x73, 0x3e, 0xff, 0xff, 0xb2, 0xec, 0x71, 0x2b, 0xae, 0xab}; -tBTM_STATUS BTM_SetBleDataLength::return_value = BTM_SUCCESS; -bool BTM_UseLeLink::return_value = false; bool btm_ble_get_acl_remote_addr::return_value = false; bool btm_ble_get_enc_key_type::return_value = false; uint8_t btm_ble_read_sec_key_size::return_value = 0; -tBTM_STATUS btm_ble_set_encryption::return_value = BTM_SUCCESS; -tBTM_STATUS btm_ble_start_encrypt::return_value = BTM_SUCCESS; -tBTM_STATUS btm_ble_start_sec_check::return_value = BTM_SUCCESS; +tBTM_STATUS btm_ble_set_encryption::return_value = tBTM_STATUS::BTM_SUCCESS; +tBTM_STATUS btm_ble_start_encrypt::return_value = tBTM_STATUS::BTM_SUCCESS; +tBTM_STATUS btm_ble_start_sec_check::return_value = tBTM_STATUS::BTM_SUCCESS; bool btm_get_local_div::return_value = false; -tBTM_STATUS btm_proc_smp_cback::return_value = BTM_SUCCESS; +tBTM_STATUS btm_proc_smp_cback::return_value = tBTM_STATUS::BTM_SUCCESS; } // namespace stack_btm_ble } // namespace mock } // namespace test // Mocked functions, if any -void BTM_BleConfirmReply(const RawAddress& bd_addr, uint8_t res) { +void BTM_BleConfirmReply(const RawAddress& bd_addr, tBTM_STATUS res) { inc_func_call_count(__func__); test::mock::stack_btm_ble::BTM_BleConfirmReply(bd_addr, res); } @@ -129,11 +126,11 @@ void BTM_BleLoadLocalKeys(uint8_t key_type, tBTM_BLE_LOCAL_KEYS* p_key) { inc_func_call_count(__func__); test::mock::stack_btm_ble::BTM_BleLoadLocalKeys(key_type, p_key); } -void BTM_BleOobDataReply(const RawAddress& bd_addr, uint8_t res, uint8_t len, uint8_t* p_data) { +void BTM_BleOobDataReply(const RawAddress& bd_addr, tBTM_STATUS res, uint8_t len, uint8_t* p_data) { inc_func_call_count(__func__); test::mock::stack_btm_ble::BTM_BleOobDataReply(bd_addr, res, len, p_data); } -void BTM_BlePasskeyReply(const RawAddress& bd_addr, uint8_t res, uint32_t passkey) { +void BTM_BlePasskeyReply(const RawAddress& bd_addr, tBTM_STATUS res, uint32_t passkey) { inc_func_call_count(__func__); test::mock::stack_btm_ble::BTM_BlePasskeyReply(bd_addr, res, passkey); } @@ -191,18 +188,10 @@ void BTM_SecAddBleKey(const RawAddress& bd_addr, tBTM_LE_KEY_VALUE* p_le_key, inc_func_call_count(__func__); test::mock::stack_btm_ble::BTM_SecAddBleKey(bd_addr, p_le_key, key_type); } -void BTM_SecurityGrant(const RawAddress& bd_addr, uint8_t res) { +void BTM_SecurityGrant(const RawAddress& bd_addr, tBTM_STATUS res) { inc_func_call_count(__func__); test::mock::stack_btm_ble::BTM_SecurityGrant(bd_addr, res); } -tBTM_STATUS BTM_SetBleDataLength(const RawAddress& bd_addr, uint16_t tx_pdu_length) { - inc_func_call_count(__func__); - return test::mock::stack_btm_ble::BTM_SetBleDataLength(bd_addr, tx_pdu_length); -} -bool BTM_UseLeLink(const RawAddress& bd_addr) { - inc_func_call_count(__func__); - return test::mock::stack_btm_ble::BTM_UseLeLink(bd_addr); -} void btm_ble_connected(const RawAddress& bda, uint16_t handle, uint8_t enc_mode, uint8_t role, tBLE_ADDR_TYPE addr_type, bool addr_matched, bool can_read_discoverable_characteristics) { @@ -210,6 +199,10 @@ void btm_ble_connected(const RawAddress& bda, uint16_t handle, uint8_t enc_mode, test::mock::stack_btm_ble::btm_ble_connected(bda, handle, enc_mode, role, addr_type, addr_matched, can_read_discoverable_characteristics); } +void btm_ble_connection_established(const RawAddress& bda) { + inc_func_call_count(__func__); + test::mock::stack_btm_ble::btm_ble_connection_established(bda); +} bool btm_ble_get_acl_remote_addr(uint16_t hci_handle, RawAddress& conn_addr, tBLE_ADDR_TYPE* p_addr_type) { inc_func_call_count(__func__); diff --git a/system/test/mock/mock_stack_btm_ble.h b/system/test/mock/mock_stack_btm_ble.h index d25cbf6247..cabf5fe91a 100644 --- a/system/test/mock/mock_stack_btm_ble.h +++ b/system/test/mock/mock_stack_btm_ble.h @@ -35,7 +35,6 @@ #include "stack/include/btm_ble_sec_api_types.h" #include "stack/include/btm_sec_api_types.h" #include "stack/include/btm_status.h" -#include "stack/include/l2cdefs.h" #include "types/ble_address_with_type.h" #include "types/raw_address.h" @@ -54,9 +53,9 @@ namespace stack_btm_ble { // Params: const RawAddress& bd_addr, uint8_t res // Return: void struct BTM_BleConfirmReply { - std::function<void(const RawAddress& /* bd_addr */, uint8_t /* res */)> body{ - [](const RawAddress& /* bd_addr */, uint8_t /* res */) {}}; - void operator()(const RawAddress& bd_addr, uint8_t res) { body(bd_addr, res); } + std::function<void(const RawAddress& /* bd_addr */, tBTM_STATUS /* res */)> body{ + [](const RawAddress& /* bd_addr */, tBTM_STATUS /* res */) {}}; + void operator()(const RawAddress& bd_addr, tBTM_STATUS res) { body(bd_addr, res); } }; extern struct BTM_BleConfirmReply BTM_BleConfirmReply; @@ -90,10 +89,10 @@ extern struct BTM_BleLoadLocalKeys BTM_BleLoadLocalKeys; // Params: const RawAddress& bd_addr, uint8_t res, uint8_t len, uint8_t* p_data // Return: void struct BTM_BleOobDataReply { - std::function<void(const RawAddress& bd_addr, uint8_t res, uint8_t len, uint8_t* p_data)> body{ - [](const RawAddress& /* bd_addr */, uint8_t /* res */, uint8_t /* len */, - uint8_t* /* p_data */) {}}; - void operator()(const RawAddress& bd_addr, uint8_t res, uint8_t len, uint8_t* p_data) { + std::function<void(const RawAddress& bd_addr, tBTM_STATUS res, uint8_t len, uint8_t* p_data)> + body{[](const RawAddress& /* bd_addr */, tBTM_STATUS /* res */, uint8_t /* len */, + uint8_t* /* p_data */) {}}; + void operator()(const RawAddress& bd_addr, tBTM_STATUS res, uint8_t len, uint8_t* p_data) { body(bd_addr, res, len, p_data); } }; @@ -103,9 +102,9 @@ extern struct BTM_BleOobDataReply BTM_BleOobDataReply; // Params: const RawAddress& bd_addr, uint8_t res, uint32_t passkey // Return: void struct BTM_BlePasskeyReply { - std::function<void(const RawAddress& bd_addr, uint8_t res, uint32_t passkey)> body{ - [](const RawAddress& /* bd_addr */, uint8_t /* res */, uint32_t /* passkey */) {}}; - void operator()(const RawAddress& bd_addr, uint8_t res, uint32_t passkey) { + std::function<void(const RawAddress& bd_addr, tBTM_STATUS res, uint32_t passkey)> body{ + [](const RawAddress& /* bd_addr */, tBTM_STATUS /* res */, uint32_t /* passkey */) {}}; + void operator()(const RawAddress& bd_addr, tBTM_STATUS res, uint32_t passkey) { body(bd_addr, res, passkey); } }; @@ -271,41 +270,16 @@ extern struct BTM_SecAddBleKey BTM_SecAddBleKey; // Params: const RawAddress& bd_addr, uint8_t res // Return: void struct BTM_SecurityGrant { - std::function<void(const RawAddress& bd_addr, uint8_t res)> body{ - [](const RawAddress& /* bd_addr */, uint8_t /* res */) {}}; - void operator()(const RawAddress& bd_addr, uint8_t res) { body(bd_addr, res); } + std::function<void(const RawAddress& bd_addr, tBTM_STATUS res)> body{ + [](const RawAddress& /* bd_addr */, tBTM_STATUS /* res */) {}}; + void operator()(const RawAddress& bd_addr, tBTM_STATUS res) { body(bd_addr, res); } }; extern struct BTM_SecurityGrant BTM_SecurityGrant; -// Name: BTM_SetBleDataLength -// Params: const RawAddress& bd_addr, uint16_t tx_pdu_length -// Return: tBTM_STATUS -struct BTM_SetBleDataLength { - static tBTM_STATUS return_value; - std::function<tBTM_STATUS(const RawAddress& bd_addr, uint16_t tx_pdu_length)> body{ - [](const RawAddress& /* bd_addr */, uint16_t /* tx_pdu_length */) { - return return_value; - }}; - tBTM_STATUS operator()(const RawAddress& bd_addr, uint16_t tx_pdu_length) { - return body(bd_addr, tx_pdu_length); - } -}; -extern struct BTM_SetBleDataLength BTM_SetBleDataLength; - -// Name: BTM_UseLeLink -// Params: const RawAddress& bd_addr -// Return: bool -struct BTM_UseLeLink { - static bool return_value; - std::function<bool(const RawAddress& bd_addr)> body{ - [](const RawAddress& /* bd_addr */) { return return_value; }}; - bool operator()(const RawAddress& bd_addr) { return body(bd_addr); } -}; -extern struct BTM_UseLeLink BTM_UseLeLink; - // Name: btm_ble_connected // Params: const RawAddress& bda, uint16_t handle, uint8_t enc_mode, uint8_t -// role, tBLE_ADDR_TYPE addr_type, bool addr_matched Return: void +// role, tBLE_ADDR_TYPE addr_type, bool addr_matched, bool can_read_discoverable_characteristics +// Return: void struct btm_ble_connected { std::function<void(const RawAddress& bda, uint16_t handle, uint8_t enc_mode, uint8_t role, tBLE_ADDR_TYPE addr_type, bool addr_matched, @@ -322,6 +296,14 @@ struct btm_ble_connected { }; extern struct btm_ble_connected btm_ble_connected; +// Name: btm_ble_connection_established +// Params: const RawAddress& bda Return: void +struct btm_ble_connection_established { + std::function<void(const RawAddress& bda)> body{[](const RawAddress& /* bda */) {}}; + void operator()(const RawAddress& bda) { body(bda); } +}; +extern struct btm_ble_connection_established btm_ble_connection_established; + // Name: btm_ble_get_acl_remote_addr // Params: uint16_t hci_handle, RawAddress& conn_addr, tBLE_ADDR_TYPE* // p_addr_type Return: bool diff --git a/system/test/mock/mock_stack_btm_ble_gap.cc b/system/test/mock/mock_stack_btm_ble_gap.cc index 18dd412e44..bfb7870778 100644 --- a/system/test/mock/mock_stack_btm_ble_gap.cc +++ b/system/test/mock/mock_stack_btm_ble_gap.cc @@ -26,6 +26,7 @@ #include "stack/btm/btm_ble_int_types.h" #include "stack/include/bt_dev_class.h" #include "stack/include/btm_api_types.h" +#include "stack/include/btm_status.h" #include "stack/include/hci_error_code.h" #include "test/common/mock_functions.h" #include "types/ble_address_with_type.h" @@ -76,19 +77,19 @@ void BTM_BleTargetAnnouncementObserve(bool /* enable */, tBTM_INQ_RESULTS_CB* /* } tBTM_STATUS btm_ble_read_remote_name(const RawAddress& /* remote_bda */, tBTM_CMPL_CB* /* p_cb */) { inc_func_call_count(__func__); - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } tBTM_STATUS btm_ble_set_connectability(uint16_t /* combined_mode */) { inc_func_call_count(__func__); - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } tBTM_STATUS btm_ble_set_discoverability(uint16_t /* combined_mode */) { inc_func_call_count(__func__); - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } tBTM_STATUS btm_ble_start_inquiry(uint8_t /* duration */) { inc_func_call_count(__func__); - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } void BTM_BleGetDynamicAudioBuffer( tBTM_BT_DYNAMIC_AUDIO_BUFFER_CB /* p_dynamic_audio_buffer_cb*/[]) { diff --git a/system/test/mock/mock_stack_btm_ble_privacy.h b/system/test/mock/mock_stack_btm_ble_privacy.h index b035466f49..357e7adf3d 100644 --- a/system/test/mock/mock_stack_btm_ble_privacy.h +++ b/system/test/mock/mock_stack_btm_ble_privacy.h @@ -26,6 +26,7 @@ // Original included files, if any #include "stack/btm/security_device_record.h" +#include "stack/include/btm_status.h" // Mocked compile conditionals, if any namespace test { @@ -75,7 +76,7 @@ extern struct btm_ble_read_resolving_list_entry_complete btm_ble_read_resolving_ // Returns: tBTM_STATUS struct btm_ble_remove_resolving_list_entry { std::function<tBTM_STATUS(tBTM_SEC_DEV_REC* p_dev_rec)> body{ - [](tBTM_SEC_DEV_REC* /* p_dev_rec */) { return BTM_SUCCESS; }}; + [](tBTM_SEC_DEV_REC* /* p_dev_rec */) { return tBTM_STATUS::BTM_SUCCESS; }}; tBTM_STATUS operator()(tBTM_SEC_DEV_REC* p_dev_rec) { return body(p_dev_rec); } }; extern struct btm_ble_remove_resolving_list_entry btm_ble_remove_resolving_list_entry; diff --git a/system/test/mock/mock_stack_btm_dev.cc b/system/test/mock/mock_stack_btm_dev.cc index 88b4459170..888576c5f2 100644 --- a/system/test/mock/mock_stack_btm_dev.cc +++ b/system/test/mock/mock_stack_btm_dev.cc @@ -95,9 +95,6 @@ std::vector<tBTM_SEC_DEV_REC*> btm_get_sec_dev_rec() { inc_func_call_count(__func__); return {}; } - -void BTM_SetConsolidationCallback(BTM_CONSOLIDATION_CB* /* cb */) { inc_func_call_count(__func__); } - bool BTM_Sec_AddressKnown(const RawAddress& address) { inc_func_call_count(__func__); return test::mock::stack_btm_dev::BTM_Sec_AddressKnown(address); diff --git a/system/test/mock/mock_stack_btm_devctl.cc b/system/test/mock/mock_stack_btm_devctl.cc index 0a731ca36d..e3f4cb2a74 100644 --- a/system/test/mock/mock_stack_btm_devctl.cc +++ b/system/test/mock/mock_stack_btm_devctl.cc @@ -39,31 +39,17 @@ namespace stack_btm_devctl { tBTM_STATUS BTM_DeleteStoredLinkKey(const RawAddress* /* bd_addr */, tBTM_CMPL_CB* /* p_cb */) { inc_func_call_count(__func__); - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } tBTM_STATUS BTM_EnableTestMode(void) { inc_func_call_count(__func__); - return BTM_SUCCESS; -} -tBTM_STATUS BTM_SetDeviceClass(DEV_CLASS /* dev_class */) { - inc_func_call_count(__func__); - return BTM_SUCCESS; -} -tBTM_STATUS BTM_SetLocalDeviceName(const char* /* p_name */) { - inc_func_call_count(__func__); - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } DEV_CLASS BTM_ReadDeviceClass(void) { inc_func_call_count(__func__); return kDevClassEmpty; } -void BTM_VendorSpecificCommand(uint16_t /* opcode */, uint8_t /* param_len */, - uint8_t* /* p_param_buf */, tBTM_VSC_CMPL_CB* /* p_cb */) { - inc_func_call_count(__func__); -} -void BTM_WritePageTimeout(uint16_t /* timeout */) { inc_func_call_count(__func__); } void BTM_db_reset(void) { inc_func_call_count(__func__); } -void BTM_reset_complete() { inc_func_call_count(__func__); } void btm_delete_stored_link_key_complete(uint8_t* /* p */, uint16_t /* evt_len */) { inc_func_call_count(__func__); } diff --git a/system/test/mock/mock_stack_btm_inq.cc b/system/test/mock/mock_stack_btm_inq.cc index c57226a00b..06b0738d1c 100644 --- a/system/test/mock/mock_stack_btm_inq.cc +++ b/system/test/mock/mock_stack_btm_inq.cc @@ -24,6 +24,7 @@ #include <cstdint> +#include "stack/include/btm_status.h" #include "test/common/mock_functions.h" // Original usings @@ -44,7 +45,6 @@ struct BTM_SetConnectability BTM_SetConnectability; struct BTM_SetDiscoverability BTM_SetDiscoverability; struct BTM_SetInquiryMode BTM_SetInquiryMode; struct BTM_StartInquiry BTM_StartInquiry; -struct BTM_WriteEIR BTM_WriteEIR; struct btm_clear_all_pending_le_entry btm_clear_all_pending_le_entry; struct btm_clr_inq_db btm_clr_inq_db; struct btm_clr_inq_result_flt btm_clr_inq_result_flt; @@ -70,11 +70,10 @@ namespace stack_btm_inq { bool BTM_HasEirService::return_value = false; uint16_t BTM_IsInquiryActive::return_value = 0; -tBTM_STATUS BTM_SetConnectability::return_value = BTM_SUCCESS; -tBTM_STATUS BTM_SetDiscoverability::return_value = BTM_SUCCESS; -tBTM_STATUS BTM_SetInquiryMode::return_value = BTM_SUCCESS; -tBTM_STATUS BTM_StartInquiry::return_value = BTM_SUCCESS; -tBTM_STATUS BTM_WriteEIR::return_value = BTM_SUCCESS; +tBTM_STATUS BTM_SetConnectability::return_value = tBTM_STATUS::BTM_SUCCESS; +tBTM_STATUS BTM_SetDiscoverability::return_value = tBTM_STATUS::BTM_SUCCESS; +tBTM_STATUS BTM_SetInquiryMode::return_value = tBTM_STATUS::BTM_SUCCESS; +tBTM_STATUS BTM_StartInquiry::return_value = tBTM_STATUS::BTM_SUCCESS; tINQ_DB_ENT* btm_inq_db_find::return_value = nullptr; tINQ_DB_ENT* btm_inq_db_new::return_value = nullptr; bool btm_inq_find_bdaddr::return_value = false; @@ -120,10 +119,6 @@ tBTM_STATUS BTM_StartInquiry(tBTM_INQ_RESULTS_CB* p_results_cb, tBTM_CMPL_CB* p_ inc_func_call_count(__func__); return test::mock::stack_btm_inq::BTM_StartInquiry(p_results_cb, p_cmpl_cb); } -tBTM_STATUS BTM_WriteEIR(BT_HDR* p_buff) { - inc_func_call_count(__func__); - return test::mock::stack_btm_inq::BTM_WriteEIR(p_buff); -} void btm_clear_all_pending_le_entry(void) { inc_func_call_count(__func__); test::mock::stack_btm_inq::btm_clear_all_pending_le_entry(); diff --git a/system/test/mock/mock_stack_btm_inq.h b/system/test/mock/mock_stack_btm_inq.h index 2c4804ef40..76dbd069c3 100644 --- a/system/test/mock/mock_stack_btm_inq.h +++ b/system/test/mock/mock_stack_btm_inq.h @@ -143,17 +143,6 @@ struct BTM_StartInquiry { }; extern struct BTM_StartInquiry BTM_StartInquiry; -// Name: BTM_WriteEIR -// Params: BT_HDR* p_buff -// Return: tBTM_STATUS -struct BTM_WriteEIR { - static tBTM_STATUS return_value; - std::function<tBTM_STATUS(BT_HDR* p_buff)> body{ - [](BT_HDR* /* p_buff */) { return return_value; }}; - tBTM_STATUS operator()(BT_HDR* p_buff) { return body(p_buff); } -}; -extern struct BTM_WriteEIR BTM_WriteEIR; - // Name: btm_clear_all_pending_le_entry // Params: void // Return: void diff --git a/system/test/mock/mock_stack_btm_interface.cc b/system/test/mock/mock_stack_btm_interface.cc index 0b3782e5a2..2e902a1c1d 100644 --- a/system/test/mock/mock_stack_btm_interface.cc +++ b/system/test/mock/mock_stack_btm_interface.cc @@ -35,7 +35,7 @@ struct btm_client_interface_t default_btm_client_interface = { .lifecycle = { .BTM_PmRegister = [](uint8_t /* mask */, uint8_t* /* p_pm_id */, tBTM_PM_STATUS_CBACK* /* p_cb */) -> tBTM_STATUS { - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; }, .ACL_RegisterClient = [](struct acl_client_callback_s* /* callbacks */) {}, .ACL_UnregisterClient = [](struct acl_client_callback_s* /* callbacks */) {}, @@ -54,10 +54,14 @@ struct btm_client_interface_t default_btm_client_interface = { tBT_TRANSPORT /* transport */) -> bool { return false; }, - .BTM_CancelRemoteDeviceName = []() -> tBTM_STATUS { return BTM_SUCCESS; }, - .BTM_ReadRemoteDeviceName = - [](const RawAddress& /* remote_bda */, tBTM_NAME_CMPL_CB* /* p_cb */, - tBT_TRANSPORT /* transport */) -> tBTM_STATUS { return BTM_SUCCESS; }, + .BTM_CancelRemoteDeviceName = []() -> tBTM_STATUS { + return tBTM_STATUS::BTM_SUCCESS; + }, + .BTM_ReadRemoteDeviceName = [](const RawAddress& /* remote_bda */, + tBTM_NAME_CMPL_CB* /* p_cb */, + tBT_TRANSPORT /* transport */) -> tBTM_STATUS { + return tBTM_STATUS::BTM_SUCCESS; + }, .BTM_ReadRemoteFeatures = [](const RawAddress& /* addr */) -> uint8_t* { return hci_feature_bytes_per_page; }, @@ -85,17 +89,17 @@ struct btm_client_interface_t default_btm_client_interface = { tBT_TRANSPORT /* transport */) -> uint16_t { return 0; }, }, .link_policy = { - .BTM_GetRole = [](const RawAddress& /* remote_bd_addr */, - tHCI_ROLE* /* p_role */) -> tBTM_STATUS { return BTM_SUCCESS; }, + .BTM_GetRole = [](const RawAddress& /* remote_bd_addr */, tHCI_ROLE* /* p_role */) + -> tBTM_STATUS { return tBTM_STATUS::BTM_SUCCESS; }, .BTM_SetPowerMode = [](uint8_t /* pm_id */, const RawAddress& /* remote_bda */, const tBTM_PM_PWR_MD* /* p_mode */) -> tBTM_STATUS { - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; }, .BTM_SetSsrParams = [](RawAddress const& /* bd_addr */, uint16_t /* max_lat */, uint16_t /* min_rmt_to */, uint16_t /* min_loc_to */) - -> tBTM_STATUS { return BTM_SUCCESS; }, + -> tBTM_STATUS { return tBTM_STATUS::BTM_SUCCESS; }, .BTM_SwitchRoleToCentral = [](const RawAddress& /* remote_bd_addr */) - -> tBTM_STATUS { return BTM_SUCCESS; }, + -> tBTM_STATUS { return tBTM_STATUS::BTM_SUCCESS; }, .BTM_block_role_switch_for = [](const RawAddress& /* peer_addr */) {}, .BTM_block_sniff_mode_for = [](const RawAddress& /* peer_addr */) {}, .BTM_default_unblock_role_switch = []() {}, @@ -106,10 +110,10 @@ struct btm_client_interface_t default_btm_client_interface = { .link_controller = { .BTM_GetLinkSuperTout = [](const RawAddress& /* remote_bda */, uint16_t* /* p_timeout */) -> tBTM_STATUS { - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; }, - .BTM_ReadRSSI = [](const RawAddress& /* remote_bda */, - tBTM_CMPL_CB* /* p_cb */) -> tBTM_STATUS { return BTM_SUCCESS; }, + .BTM_ReadRSSI = [](const RawAddress& /* remote_bda */, tBTM_CMPL_CB* /* p_cb */) + -> tBTM_STATUS { return tBTM_STATUS::BTM_SUCCESS; }, }, .security = { .BTM_Sec_Init = []() {}, @@ -130,10 +134,12 @@ struct btm_client_interface_t default_btm_client_interface = { tBTM_LE_KEY_VALUE* /* p_le_key */, tBTM_LE_KEY_TYPE /* key_type */) {}, .BTM_SecClearSecurityFlags = [](const RawAddress& /* bd_addr */) {}, - .BTM_SetEncryption = - [](const RawAddress& /* bd_addr */, tBT_TRANSPORT /* transport */, - tBTM_SEC_CALLBACK* /* p_callback */, void* /* p_ref_data */, - tBTM_BLE_SEC_ACT /* sec_act */) -> tBTM_STATUS { return BTM_SUCCESS; }, + .BTM_SetEncryption = [](const RawAddress& /* bd_addr */, + tBT_TRANSPORT /* transport */, + tBTM_SEC_CALLBACK* /* p_callback */, void* /* p_ref_data */, + tBTM_BLE_SEC_ACT /* sec_act */) -> tBTM_STATUS { + return tBTM_STATUS::BTM_SUCCESS; + }, .BTM_IsEncrypted = [](const RawAddress& /* bd_addr */, tBT_TRANSPORT /* transport */) -> bool { return false; }, .BTM_SecIsSecurityPending = [](const RawAddress& /* bd_addr */) -> bool { @@ -145,9 +151,9 @@ struct btm_client_interface_t default_btm_client_interface = { .BTM_SecClrServiceByPsm = [](uint16_t /* psm */) -> uint8_t { return 0; }, .BTM_SecBond = [](const RawAddress& /* bd_addr */, tBLE_ADDR_TYPE /* addr_type */, tBT_TRANSPORT /* transport */, tBT_DEVICE_TYPE /* device_type */) - -> tBTM_STATUS { return BTM_SUCCESS; }, + -> tBTM_STATUS { return tBTM_STATUS::BTM_SUCCESS; }, .BTM_SecBondCancel = [](const RawAddress& /* bd_addr */) -> tBTM_STATUS { - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; }, .BTM_RemoteOobDataReply = [](tBTM_STATUS /* res */, const RawAddress& /* bd_addr */, @@ -157,8 +163,8 @@ struct btm_client_interface_t default_btm_client_interface = { .BTM_SecConfirmReqReply = [](tBTM_STATUS /* res */, tBT_TRANSPORT /* transport */, const RawAddress /* bd_addr */) {}, .BTM_BleSirkConfirmDeviceReply = [](const RawAddress& /* bd_addr */, - uint8_t /* res */) {}, - .BTM_BlePasskeyReply = [](const RawAddress& /* bd_addr */, uint8_t /* res */, + tBTM_STATUS /* res */) {}, + .BTM_BlePasskeyReply = [](const RawAddress& /* bd_addr */, tBTM_STATUS /* res */, uint32_t /* passkey */) {}, .BTM_GetSecurityMode = []() -> uint8_t { return 0; }, .BTM_SecReadDevName = [](const RawAddress& /* bd_addr */) -> const char* { @@ -171,15 +177,15 @@ struct btm_client_interface_t default_btm_client_interface = { }, .ble = { .BTM_BleGetEnergyInfo = [](tBTM_BLE_ENERGY_INFO_CBACK* /* p_ener_cback */) - -> tBTM_STATUS { return BTM_SUCCESS; }, + -> tBTM_STATUS { return tBTM_STATUS::BTM_SUCCESS; }, .BTM_BleObserve = [](bool /* start */, uint8_t /* duration */, tBTM_INQ_RESULTS_CB* /* p_results_cb */, tBTM_CMPL_CB* /* p_cmpl_cb */) -> tBTM_STATUS { - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; }, .BTM_SetBleDataLength = [](const RawAddress& /* bd_addr */, uint16_t /* tx_pdu_length */) -> tBTM_STATUS { - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; }, .BTM_BleReadControllerFeatures = [](tBTM_BLE_CTRL_FEATURES_CBACK* /* p_vsc_cback */) {}, @@ -199,18 +205,21 @@ struct btm_client_interface_t default_btm_client_interface = { .BTM_CreateSco = [](const RawAddress* /* remote_bda */, bool /* is_orig */, uint16_t /* pkt_types */, uint16_t* /* p_sco_inx */, tBTM_SCO_CB* /* p_conn_cb */, tBTM_SCO_CB* /* p_disc_cb */) - -> tBTM_STATUS { return BTM_SUCCESS; }, + -> tBTM_STATUS { return tBTM_STATUS::BTM_SUCCESS; }, .BTM_RegForEScoEvts = [](uint16_t /* sco_inx */, tBTM_ESCO_CBACK* /* p_esco_cback */) -> tBTM_STATUS { - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; }, - .BTM_RemoveSco = [](uint16_t /* sco_inx */) -> tBTM_STATUS { return BTM_SUCCESS; }, + .BTM_RemoveSco = [](uint16_t /* sco_inx */) -> tBTM_STATUS { + return tBTM_STATUS::BTM_SUCCESS; + }, + .BTM_RemoveScoByBdaddr = [](const RawAddress& /* bd_addr */) {}, .BTM_WriteVoiceSettings = [](uint16_t /* settings */) {}, .BTM_EScoConnRsp = [](uint16_t /* sco_inx */, tHCI_STATUS /* hci_status */, enh_esco_params_t* /* p_parms */) {}, .BTM_GetNumScoLinks = []() -> uint8_t { return 0; }, .BTM_SetEScoMode = [](enh_esco_params_t* /* p_parms */) -> tBTM_STATUS { - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; }, .BTM_GetScoDebugDump = []() -> tBTM_SCO_DEBUG_DUMP { return {}; }, .BTM_IsScoActiveByBdaddr = [](const RawAddress& /* remote_bda */) -> bool { @@ -219,21 +228,23 @@ struct btm_client_interface_t default_btm_client_interface = { }, .local = { .BTM_ReadLocalDeviceName = [](const char** /* p_name */) -> tBTM_STATUS { - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; }, .BTM_ReadLocalDeviceNameFromController = [](tBTM_CMPL_CB* /* p_rln_cmpl_cback */) - -> tBTM_STATUS { return BTM_SUCCESS; }, + -> tBTM_STATUS { return tBTM_STATUS::BTM_SUCCESS; }, .BTM_SetLocalDeviceName = [](const char* /* p_name */) -> tBTM_STATUS { - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; }, .BTM_SetDeviceClass = [](DEV_CLASS /* dev_class */) -> tBTM_STATUS { - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; }, .BTM_IsDeviceUp = []() -> bool { return true; }, .BTM_ReadDeviceClass = []() -> DEV_CLASS { return kDevClassEmpty; }, }, .eir = { - .BTM_WriteEIR = [](BT_HDR* /* p_buff */) -> tBTM_STATUS { return BTM_SUCCESS; }, + .BTM_WriteEIR = [](BT_HDR* /* p_buff */) -> tBTM_STATUS { + return tBTM_STATUS::BTM_SUCCESS; + }, .BTM_GetEirSupportedServices = [](uint32_t* /* p_eir_uuid */, uint8_t** /* p */, uint8_t /* max_num_uuid16 */, uint8_t* /* p_num_uuid16 */) -> uint8_t { @@ -255,7 +266,7 @@ struct btm_client_interface_t default_btm_client_interface = { return nullptr; }, .BTM_ClearInqDb = [](const RawAddress* /* p_bda */) -> tBTM_STATUS { - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; }, }, .vendor = @@ -270,7 +281,7 @@ struct btm_client_interface_t default_btm_client_interface = { void BTM_BleReadControllerFeatures(void (*)(tHCI_ERROR_CODE)) {} tBTM_STATUS BTM_BleGetEnergyInfo(tBTM_BLE_ENERGY_INFO_CBACK* /* p_ener_cback */) { - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } // Initialize the working btm client interface to the default diff --git a/system/test/mock/mock_stack_btm_sco.cc b/system/test/mock/mock_stack_btm_sco.cc index 0f135402e1..23b91658ba 100644 --- a/system/test/mock/mock_stack_btm_sco.cc +++ b/system/test/mock/mock_stack_btm_sco.cc @@ -42,15 +42,7 @@ tBTM_STATUS BTM_CreateSco(const RawAddress* /* remote_bda */, bool /* is_orig */ uint16_t /* pkt_types */, uint16_t* /* p_sco_inx */, tBTM_SCO_CB* /* p_conn_cb */, tBTM_SCO_CB* /* p_disc_cb */) { inc_func_call_count(__func__); - return BTM_SUCCESS; -} -tBTM_STATUS BTM_RemoveSco(uint16_t /* sco_inx */) { - inc_func_call_count(__func__); - return BTM_SUCCESS; -} -tBTM_STATUS BTM_SetEScoMode(enh_esco_params_t* /* p_parms */) { - inc_func_call_count(__func__); - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } uint8_t BTM_GetNumScoLinks(void) { inc_func_call_count(__func__); @@ -64,7 +56,7 @@ void BTM_EScoConnRsp(uint16_t /* sco_inx */, tHCI_STATUS /* hci_status */, enh_esco_params_t* /* p_parms */) { inc_func_call_count(__func__); } -void BTM_RemoveSco(const RawAddress& /* bda */) { inc_func_call_count(__func__); } +void BTM_RemoveScoByBdaddr(const RawAddress& /* bd_addr */) { inc_func_call_count(__func__); } void btm_sco_acl_removed(const RawAddress* /* bda */) { inc_func_call_count(__func__); } void btm_sco_chk_pend_rolechange(uint16_t /* hci_handle */) { inc_func_call_count(__func__); } void btm_sco_chk_pend_unpark(tHCI_STATUS /* hci_status */, uint16_t /* hci_handle */) { diff --git a/system/test/mock/mock_stack_btm_sec.cc b/system/test/mock/mock_stack_btm_sec.cc index a0c4fe41de..9d8c98c775 100644 --- a/system/test/mock/mock_stack_btm_sec.cc +++ b/system/test/mock/mock_stack_btm_sec.cc @@ -118,23 +118,23 @@ bool BTM_IsLinkKeyAuthed::return_value = false; bool BTM_IsLinkKeyKnown::return_value = false; bool BTM_PeerSupportsSecureConnections::return_value = false; bool BTM_SecAddRmtNameNotifyCallback::return_value = false; -tBTM_STATUS BTM_SecBond::return_value = BTM_SUCCESS; -tBTM_STATUS BTM_SecBondCancel::return_value = BTM_SUCCESS; +tBTM_STATUS BTM_SecBond::return_value = tBTM_STATUS::BTM_SUCCESS; +tBTM_STATUS BTM_SecBondCancel::return_value = tBTM_STATUS::BTM_SUCCESS; uint8_t BTM_SecClrService::return_value = 0; uint8_t BTM_SecClrServiceByPsm::return_value = 0; bool BTM_SecDeleteRmtNameNotifyCallback::return_value = false; tBTM_LINK_KEY_TYPE BTM_SecGetDeviceLinkKeyType::return_value = 0; bool BTM_SecIsSecurityPending::return_value = false; bool BTM_SecRegister::return_value = false; -tBTM_STATUS BTM_SetEncryption::return_value = BTM_SUCCESS; +tBTM_STATUS BTM_SetEncryption::return_value = tBTM_STATUS::BTM_SUCCESS; bool BTM_SetSecurityLevel::return_value = false; const DEV_CLASS btm_get_dev_class::return_value = kDevClassEmpty; -tBTM_STATUS btm_sec_bond_by_transport::return_value = BTM_SUCCESS; -tBTM_STATUS btm_sec_disconnect::return_value = BTM_SUCCESS; +tBTM_STATUS btm_sec_bond_by_transport::return_value = tBTM_STATUS::BTM_SUCCESS; +tBTM_STATUS btm_sec_disconnect::return_value = tBTM_STATUS::BTM_SUCCESS; bool btm_sec_is_a_bonded_dev::return_value = false; -tBTM_STATUS btm_sec_l2cap_access_req::return_value = BTM_SUCCESS; -tBTM_STATUS btm_sec_l2cap_access_req_by_requirement::return_value = BTM_SUCCESS; -tBTM_STATUS btm_sec_mx_access_request::return_value = BTM_SUCCESS; +tBTM_STATUS btm_sec_l2cap_access_req::return_value = tBTM_STATUS::BTM_SUCCESS; +tBTM_STATUS btm_sec_l2cap_access_req_by_requirement::return_value = tBTM_STATUS::BTM_SUCCESS; +tBTM_STATUS btm_sec_mx_access_request::return_value = tBTM_STATUS::BTM_SUCCESS; bool BTM_IsRemoteNameKnown::return_value = false; diff --git a/system/test/mock/mock_stack_l2cap_link.cc b/system/test/mock/mock_stack_l2cap_link.cc index 224c37a64d..cc05d9a566 100644 --- a/system/test/mock/mock_stack_l2cap_link.cc +++ b/system/test/mock/mock_stack_l2cap_link.cc @@ -21,6 +21,7 @@ #include <cstdint> #include "stack/include/bt_hdr.h" +#include "stack/include/btm_status.h" #include "stack/l2cap/l2c_int.h" #include "test/common/mock_functions.h" #include "types/raw_address.h" @@ -35,7 +36,7 @@ bool l2c_link_hci_disc_comp(uint16_t /* handle */, tHCI_REASON /* reason */) { } tBTM_STATUS l2cu_ConnectAclForSecurity(const RawAddress& /* bd_addr */) { inc_func_call_count(__func__); - return BTM_SUCCESS; + return tBTM_STATUS::BTM_SUCCESS; } tL2C_CCB* l2cu_get_next_channel_in_rr(tL2C_LCB* /* p_lcb */) { inc_func_call_count(__func__); diff --git a/system/test/mock/mock_stack_sdp_api.h b/system/test/mock/mock_stack_sdp_api.h index 17d1671ae3..1d0ff6659b 100644 --- a/system/test/mock/mock_stack_sdp_api.h +++ b/system/test/mock/mock_stack_sdp_api.h @@ -211,7 +211,8 @@ struct SDP_DiDiscover { std::function<tSDP_STATUS(const RawAddress& remote_device, tSDP_DISCOVERY_DB* p_db, uint32_t len, tSDP_DISC_CMPL_CB* p_cb)> body{[](const RawAddress& /* remote_device */, tSDP_DISCOVERY_DB* /* p_db */, - uint32_t /* len */, tSDP_DISC_CMPL_CB* /* p_cb */) { return SDP_SUCCESS; }}; + uint32_t /* len */, + tSDP_DISC_CMPL_CB* /* p_cb */) { return tSDP_STATUS::SDP_SUCCESS; }}; tSDP_STATUS operator()(const RawAddress& remote_device, tSDP_DISCOVERY_DB* p_db, uint32_t len, tSDP_DISC_CMPL_CB* p_cb) { return body(remote_device, p_db, len, p_cb); @@ -225,7 +226,7 @@ struct SDP_GetDiRecord { std::function<tSDP_STATUS(uint8_t get_record_index, tSDP_DI_GET_RECORD* p_device_info, const tSDP_DISCOVERY_DB* p_db)> body{[](uint8_t /* get_record_index */, tSDP_DI_GET_RECORD* /* p_device_info */, - const tSDP_DISCOVERY_DB* /* p_db */) { return SDP_SUCCESS; }}; + const tSDP_DISCOVERY_DB* /* p_db */) { return tSDP_STATUS::SDP_SUCCESS; }}; tSDP_STATUS operator()(uint8_t get_record_index, tSDP_DI_GET_RECORD* p_device_info, const tSDP_DISCOVERY_DB* p_db) { return body(get_record_index, p_device_info, p_db); @@ -238,7 +239,7 @@ extern struct SDP_GetDiRecord SDP_GetDiRecord; struct SDP_SetLocalDiRecord { std::function<tSDP_STATUS(const tSDP_DI_RECORD* p_device_info, uint32_t* p_handle)> body{ [](const tSDP_DI_RECORD* /* p_device_info */, uint32_t* /* p_handle */) { - return SDP_SUCCESS; + return tSDP_STATUS::SDP_SUCCESS; }}; tSDP_STATUS operator()(const tSDP_DI_RECORD* p_device_info, uint32_t* p_handle) { return body(p_device_info, p_handle); diff --git a/tools/rootcanal/model/controller/controller_properties.cc b/tools/rootcanal/model/controller/controller_properties.cc index b9afe2cf40..b1ad2e8082 100644 --- a/tools/rootcanal/model/controller/controller_properties.cc +++ b/tools/rootcanal/model/controller/controller_properties.cc @@ -1574,7 +1574,7 @@ bool ControllerProperties::CheckSupportedCommands() const { } ControllerProperties::ControllerProperties() - : supported_commands(std::move(SupportedCommands())), + : supported_commands(SupportedCommands()), lmp_features({Page0LmpFeatures(), 0, Page2LmpFeatures()}), le_features(LlFeatures()) { if (!CheckSupportedFeatures()) { @@ -1670,7 +1670,7 @@ static void SetSupportedCommandBits(std::array<uint8_t, 64>& supported_commands, ControllerProperties::ControllerProperties(rootcanal::configuration::Controller const& config) : strict(!config.has_strict() || config.strict()), - supported_commands(std::move(SupportedCommands())), + supported_commands(SupportedCommands()), lmp_features({Page0LmpFeatures(), 0, Page2LmpFeatures()}), le_features(LlFeatures()) { using namespace rootcanal::configuration; diff --git a/tools/rootcanal/model/devices/beacon.cc b/tools/rootcanal/model/devices/beacon.cc index 1c7c14b054..37feff6738 100644 --- a/tools/rootcanal/model/devices/beacon.cc +++ b/tools/rootcanal/model/devices/beacon.cc @@ -57,10 +57,10 @@ void Beacon::Tick() { std::chrono::steady_clock::time_point now = std::chrono::steady_clock::now(); if ((now - advertising_last_) >= advertising_interval_) { advertising_last_ = now; - SendLinkLayerPacket(std::move(LeLegacyAdvertisingPduBuilder::Create( + SendLinkLayerPacket(LeLegacyAdvertisingPduBuilder::Create( address_, Address::kEmpty, AddressType::PUBLIC, AddressType::PUBLIC, advertising_type_, - std::vector(advertising_data_.begin(), advertising_data_.end()))), + std::vector(advertising_data_.begin(), advertising_data_.end())), Phy::Type::LOW_ENERGY); } } @@ -71,9 +71,9 @@ void Beacon::ReceiveLinkLayerPacket(LinkLayerPacketView packet, Phy::Type /*type (advertising_type_ == LegacyAdvertisingType::ADV_IND || advertising_type_ == LegacyAdvertisingType::ADV_SCAN_IND)) { SendLinkLayerPacket( - std::move(LeScanResponseBuilder::Create( + LeScanResponseBuilder::Create( address_, packet.GetSourceAddress(), AddressType::PUBLIC, - std::vector(scan_response_data_.begin(), scan_response_data_.end()))), + std::vector(scan_response_data_.begin(), scan_response_data_.end())), Phy::Type::LOW_ENERGY); } } diff --git a/tools/rootcanal/model/devices/scripted_beacon.cc b/tools/rootcanal/model/devices/scripted_beacon.cc index 20e0906411..1e9bb66349 100644 --- a/tools/rootcanal/model/devices/scripted_beacon.cc +++ b/tools/rootcanal/model/devices/scripted_beacon.cc @@ -192,9 +192,9 @@ void ScriptedBeacon::ReceiveLinkLayerPacket(model::packets::LinkLayerPacketView if (packet.GetDestinationAddress() == address_ && packet.GetType() == PacketType::LE_SCAN) { set_state(PlaybackEvent::SCANNED_ONCE); SendLinkLayerPacket( - std::move(model::packets::LeScanResponseBuilder::Create( + model::packets::LeScanResponseBuilder::Create( address_, packet.GetSourceAddress(), AddressType::PUBLIC, - std::vector(scan_response_data_.begin(), scan_response_data_.end()))), + std::vector(scan_response_data_.begin(), scan_response_data_.end())), Phy::Type::LOW_ENERGY); } } |