Skip to content

Commit

Permalink
Merge pull request #21 from martinroger/20-duplicate-requests-during-…
Browse files Browse the repository at this point in the history
…handshake

Removing start loop when two concurrent handshake loops are happening.
  • Loading branch information
martinroger authored Dec 7, 2024
2 parents 04a5a95 + 52fcc2d commit cf1caa3
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
1 change: 1 addition & 0 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ build_flags =
-D ENABLE_A2DP
-D BUILD_BRANCH="\"main"\"
-D PIOENV="\"$PIOENV"\"
-D REFRESH_INTERVAL=10

[env:audioKit]
board = esp32dev
Expand Down
31 changes: 25 additions & 6 deletions src/esPod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,11 @@ void esPod::processLingo0x00(const byte *byteArray, uint32_t len)
{
ESP_LOGI(IPOD_TAG,"CMD: 0x%02x IdentifyDeviceLingoes",cmdID);
L0x00_0x02_iPodAck(iPodAck_OK,cmdID);//Acknowledge, start capabilities pingpong
L0x00_0x27_GetAccessoryInfo(0x00); //Immediately request general capabilities
if(!_accessoryCapabilitiesRequested)
{
L0x00_0x27_GetAccessoryInfo(0x00); //Immediately request general capabilities
}

}
break;

Expand All @@ -627,27 +631,42 @@ void esPod::processLingo0x00(const byte *byteArray, uint32_t len)
{
case 0x00:
_accessoryCapabilitiesRequested = true;
L0x00_0x27_GetAccessoryInfo(0x01); //Request the name
if (!_accessoryNameRequested)
{
L0x00_0x27_GetAccessoryInfo(0x01); //Request the name
}
break;

case 0x01:
_accessoryNameRequested = true;
L0x00_0x27_GetAccessoryInfo(0x04); //Request the firmware version
if (!_accessoryFirmwareRequested)
{
L0x00_0x27_GetAccessoryInfo(0x04); //Request the firmware version
}
break;

case 0x04:
_accessoryFirmwareRequested = true;
L0x00_0x27_GetAccessoryInfo(0x05); //Request the hardware number
if (!_accessoryHardwareRequested)
{
L0x00_0x27_GetAccessoryInfo(0x05); //Request the hardware number
}
break;

case 0x05:
_accessoryHardwareRequested = true;
L0x00_0x27_GetAccessoryInfo(0x06); //Request the manufacturer name
if (!_accessoryManufRequested)
{
L0x00_0x27_GetAccessoryInfo(0x06); //Request the manufacturer name
}
break;

case 0x06:
_accessoryManufRequested = true;
L0x00_0x27_GetAccessoryInfo(0x07); //Request the model number
if (!_accessoryModelRequested)
{
L0x00_0x27_GetAccessoryInfo(0x07); //Request the model number
}
break;

case 0x07:
Expand Down

0 comments on commit cf1caa3

Please sign in to comment.