continuity.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #pragma once
  2. #include <stdint.h>
  3. #include <stdlib.h>
  4. // Hacked together by @Willy-JL
  5. // Custom adv logic by @Willy-JL (idea by @xMasterX)
  6. // Extensive testing and research on behavior and parameters by @Willy-JL and @ECTO-1A
  7. // Structures docs and Nearby Action IDs from https://github.com/furiousMAC/continuity/
  8. // Proximity Pair IDs from https://github.com/ECTO-1A/AppleJuice/
  9. // Controversy explained at https://willyjl.dev/blog/the-controversy-behind-apple-ble-spam
  10. typedef enum {
  11. ContinuityTypeAirDrop = 0x05,
  12. ContinuityTypeProximityPair = 0x07,
  13. ContinuityTypeAirplayTarget = 0x09,
  14. ContinuityTypeHandoff = 0x0C,
  15. ContinuityTypeTetheringSource = 0x0E,
  16. ContinuityTypeNearbyAction = 0x0F,
  17. ContinuityTypeCount
  18. } ContinuityType;
  19. typedef union {
  20. struct {
  21. } airdrop;
  22. struct {
  23. uint8_t prefix;
  24. uint16_t model;
  25. } proximity_pair;
  26. struct {
  27. } airplay_target;
  28. struct {
  29. } handoff;
  30. struct {
  31. } tethering_source;
  32. struct {
  33. uint8_t flags;
  34. uint8_t type;
  35. } nearby_action;
  36. } ContinuityData;
  37. typedef struct {
  38. ContinuityType type;
  39. ContinuityData data;
  40. } ContinuityMsg;
  41. const char* continuity_get_type_name(ContinuityType type);
  42. uint8_t continuity_get_packet_size(ContinuityType type);
  43. void continuity_generate_packet(const ContinuityMsg* msg, uint8_t* packet);