Split L2CAP Classic and LE stacks into separate modules
* Although L2CAP LE and Classic stacks look similar, they are actually very different when diving into details
* Splitting them into two separate modules will benefit in the following ways:
* One can start a LE only stack
* One can turn off Classic stack entirely when not needed
* Dependencies are more obvious, e.g. LE-CoC only depends on LE L2CAP and A2DP only depends on Classic L2CAP
* Changed test names as GTEST does not allow test name collisions
* New directory structure after the change:
- l2cap: common headers that should be exposed to public
- internal: common internal libraries shared between LE and classic
- classic: classic headers that should be exposed to public
- internal: internal libraries for classic
- cert: certification stack for classic
- le: LE headers that should be exposed to public
- internal: internal libraries for LE
- cert: certification stack for LE
Using Bash
for file in classic_*; do git mv "$file" "classic/${file/classic_/}"; done
for file in le_*; do git mv "$file" "le/${file/le_/}"; done
for file in internal/le_*; do git mv "$file" "le/${file/le_/}"; done
for file in internal/classic_*; do git mv "$file" "classic/${file/classic_/}"; done
for file in classic/*; do if [ -f "$file" ]; then sed -i -e 's/Classic//g' "$file"; fi; done
for file in classic/internal/*; do if [ -f "$file" ]; then sed -i -e 's/Classic//g' "$file"; fi; done
for file in le/*; do if [ -f "$file" ]; then sed -i -e 's/Le//g' "$file"; fi; done
for file in le/internal/*; do if [ -f "$file" ]; then sed -i -e 's/Le//g' "$file"; fi; done
Using IDE:
replace "namespace l2cap {" with "namespace l2cap { namespace classic {" in classic/
replace "} // namespace l2cap" with "} }" in classic/
replace "namespace l2cap {" with "namespace l2cap { namespace le {" in le/
replace "} // namespace l2cap" with "} }" in le/
replace "l2cap/classic_" with "l2cap/classic/" in classic/
replace "l2cap/internal/classic_" with "l2cap/classic/internal/" in classic/
replace "l2cap/le_" with "l2cap/le/" in le/
replace "l2cap/internal/le_" with "l2cap/le/internal/" in le/
Bug: 140938432
Test: bluetooth_test_gd
Change-Id: I29eafefc5b6be4033e5db811776230d28ca312b2
Loading
Please register or sign in to comment