Pairing Gaming Hub

Description

The Pairing Gaming Hub application is used to showcase a point-to-multipoint pairing procedure using the SPARK Wireless Core.

Four devices are present in this application. The Dongle device acts as a Coordinator while the Mouse, Keyboard and Headset devices act as Nodes.

When the application starts, the devices are all in an unpaired state. The user must manually pair the Nodes with the Coordinator one after the other.

The schedule is already known by all devices but they cannot communicate with each other as long as they are not paired.

Since this application example does not implement persistent storage, rebooting a Node device puts it in an unpaired state. Furthermore, the whole Pairing Procedure needs to be repeated when rebooting the Coordinator device since it has the Paired Device List with all of the Nodes’ addresses.

During a pairing process, audio and data transfers are not possible. This is because a different schedule is applied during the pairing process. For example, if the Dongle and the Headset are already paired and are streaming audio, the audio stream will be interrupted when pairing the Mouse or Keyboard devices.

Pairing Gaming Hub Diagram

Figure 26: Pairing Gaming Hub application’s system diagram.

See Pairing Module for more information on the Pairing Procedure.

Behavior

The Gaming Hub schedule is made up of 45 timeslots. The first timeslot is dedicated to the Beacon Signal and the following timeslots alternate between the Headset, Mouse and Keyboard devices.

After the Beacon Signal, there are three Headset timeslots followed by a Mouse timeslot. Then there are three more Headset timeslots followed by a Keyboard timeslot.

This pattern is repeated twice before the schedule loops back to the beginning of the sequence. A lot of timeslots are used to ensure that the beacon only occurs every 4 ms.

Here is a simplified view of the Gaming Hub Schedule:

Pairing Gaming Hub Schedule

Figure 27: Pairing Gaming Hub application’s schedule

Dongle Device

The Dongle device acts as the Coordinator of the network. It keeps an inventory of Nodes inside its network with the Paired Device list.

To start a Pairing Procedure, the user must press the SW2 button on the Dongle and the SW2 on another Node device. On the Dongle, SW1 button is used to unpair all devices from it. The user must also manually unpair all Node devices to start a new pairing process.

The Dongle records audio from its Line-In connector and sends a 48 kHz/16 bits audio stereo stream to the Headset device. Once paired, LED0 toggles on the Dongle each time a frame is successfully sent to the Headset (almost always on because of the high packet rate).

Since the Coordinator does not send any payload to the Mouse and Keyboard devices, a Beacon signal is used to keep the connections synchronized.

The Dongle receives Mouse Press events from the Mouse device and toggles LED1.

The Dongle receives Keyboard Press events from the Keyboard device and toggles LED2.

Interface

Name

Description

SW1

Unpair All Devices

Clear the Paired Device list to unpair all devices.

SW2

Pair Device

Start the Pairing Procedure with another device.

LED0

Transmission Success

Toggle LED when a wireless transmission to the Headset is successful.

LED1

Keyboard Press

Toggle LED when receiving a Keyboard Press event from the Keyboard device.

LED2

Mouse Press

Toggle LED when receiving a Mouse Press event from the Mouse device.

Headset Device

The paired Headset device receives a 48 kHz/16 bits audio stereo stream from the Dongle and plays it on the Headphone connector.

The SW2 button is used to pair the Headset device. Once paired, pressing it again will unpair the device.

Interface

Name

Description

SW1

N/A

N/A

SW2

Pair/Unpair Device

Start the Pairing Procedure when unpaired or unpair the device if paired.

LED0

N/A

N/A

LED1

Reception Success

Toggle LED when a wireless reception is successful from the Dongle device.

LED2

N/A

N/A

Mouse Device

The Paired Mouse device simulates a Mouse Button Press event and sends it to the Dongle device. It also periodically receives a Beacon signal from the Dongle to stay synchronized. LED0 toggles every time a packet is successfully transmitted to the Dongle (almost always on because of the high packet rate).

Interface

Name

Description

SW1

Mouse Button Press

Send a Mouse Button Press event to the Dongle device.

SW2

Pair/Unpair Device

Start the Pairing Procedure when unpaired or unpair the device if paired.

LED0

Transmission Success

Toggle LED when a wireless transmission to the Dongle is successful.

LED1

N/A

N/A

LED2

N/A

N/A

Keyboard Device

The Paired Keyboard device simulates a Keyboard Key Press event and sends it to the Dongle device. It also periodically receives a Beacon signal from the Dongle to stay synchronized. LED0 toggles every time a packet is successfully transmitted to the Dongle (almost always on because of the high packet rate).

Interface

Name

Description

SW1

Keyboard Key Press

Send a Keyboard Key Press event to the Dongle device.

SW2

Pair/Unpair Device

Start the Pairing Procedure when unpaired or unpair the device if paired.

LED0

Transmission Success

Toggle LED when a wireless transmission to the Dongle is successful.

LED1

N/A

N/A

LED2

N/A

N/A

Pairing LED Pattern

LED patterns are used to notify the user about pairing status.
  • LED0 blinking twice means that the device has started the Pairing Process.

  • Left-to-right LED pattern means that the Pairing Procedure was successful.

  • All LEDs blinking twice means that the Pairing Procedure failed

  • All LEDs Blink twice when the user manually unpairs the device.

Configuration

This application does not require specific configurations.