## 4 Detailed Design  
### Inter-Device Communication Process  
Figure 2 illustrates the communication sequence of wearable, tag, and stationary devices during self-organized cooperation in a unit space. Figure 3 illustrates the communication protocols that are defined to enable the wearable, tag, and stationary devices to transmit messages to each other. The stationary device acts as a network coordinator in that space, receives activity messages from multiple tag devices, and transmits ADL data to the wearable device.  
A stationary device continually attempts to update its connection network by periodically scanning for nearby tag devices. A tag device has a service ID for the home item to which it is attached and a location ID for the indoor space in which it is installed. The service ID and location ID are included in a BLE advertising packet of the tag device and can be set through a smartphone BLE application. When the stationary device receives an advertising packet from an adjacent tag device that contains the location ID that it represents, it attempts to connect with that tag device through BLE and maintains the established connection. Thus, the stationary device connects only with tag devices in the same room, ignoring packets sent by tag devices in other rooms.  
The stationary device can detect whether a family member with a wearable device passes through the door, using the indoor location recognition method from our previous study [24]. The wearable device can determine whether it is inside or outside the door by receiving LF signals from the stationary device and comparing the RSSI values of the signals. When the wearable device detects a position change from the outside to the inside of the door, it initiates BLE advertising by including the wearable device ID.  
After entry of the wearable device, the stationary device identifies the user by referring to the ID information included in the advertising packet of the wearable device and initiates a BLE connection with the wearable device. Then, the stationary device sends activation messages to all connected tag devices. The tag device receiving the activation message enables built-in sensors to measure the usage information of the home appliance to which it is attached. The wearable device is now ready to record the user's ADL in its internal memory. When the tag device detects a status change event as the user uses an item, it sends an activity message including its ID, type of appliance, and status information to the stationary device. The stationary device processes the received activity message, if necessary (for privacy or to reduce the amount of data), and sends it to the connected user's wearable device; then, the wearable device writes the user's ADL data to flash memory. The stationary device continues executing this process until it receives a BLE advertising packet that signifies the user's exit and terminates the BLE connection with the wearable device. After the user exits the space, the stationary  
Figure 1: Concept of self-organized device network structure.  
device sends deactivation messages to the tag devices in its network, which disable internal sensors of the tag devices.  
Using the proposed device network alone, it is not possible to distinguish who used home appliances when two or more users enter the same space. For ease of implementation, we usually use the predetermined wearable device ID of an individual for recording activities occurring in a unit space. The tag devices in each unit space are activated or deactivated according to the entry or exit of the wearable device with this ID. However, in the case where specific individuals must be distinguished from other family members, we recognize a user using the proximity-based neighbor-identification protocol (PNIP) [36], which is an LF and BLE hybrid protocol.  
Figure 2: Communication sequence of self-organized device network structure.