Electronic equipment, wireless communication methods, and programs
By adjusting transmission and scanning intervals using device-specific information and inserting offsets, the electronic device stabilizes BLE connections between devices that cannot simultaneously transmit and scan, ensuring synchronized packet exchange and role determination.
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- CASIO COMPUTER CO LTD
- Filing Date
- 2024-11-26
- Publication Date
- 2026-06-05
AI Technical Summary
Conventional Bluetooth Low Energy (BLE) communication technologies struggle to establish stable connections between devices that do not have the capability to simultaneously transmit and scan advertisement packets, making it difficult to determine which device acts as the peripheral or central.
The electronic device employs a control unit that repeatedly transmits and scans advertisement packets at set intervals, adjusts the interval based on device-specific information such as MAC address hash values or acceleration, and inserts an offset to synchronize transmission and scanning timings, allowing devices to dynamically determine their roles as either central or peripheral.
This approach enables stable communication connections between devices lacking simultaneous transmission and scanning capabilities by ensuring timely and synchronized packet exchange, even when device roles are not predetermined.
Smart Images

Figure 2026092619000001_ABST
Abstract
Description
Technical Field
[0001] This invention relates to an electronic device, a wireless communication method, and a program.
Background Art
[0002] In Bluetooth (Registered Trademark) Low Energy (BLE), which is one of the short-range wireless communication standards, generally, one of the two devices to be communicatively connected transmits an advertisement packet as a peripheral, and the other scans the advertisement packet as a central and makes a communication connection request. As a result, the central becomes the master device and the peripheral becomes the slave device, and the communication connection is established. That is, unless it is predetermined which of the two devices is the peripheral and which is the central, normal communication connection cannot be performed. To address this problem, for example, in Patent Document 1, even if the peripheral and the central are not determined in advance, one device simultaneously transmits and scans an advertisement packet, and depending on the response from the other device, determines whether to be the master or the slave and establishes a communication connection.
Prior Art Documents
Patent Documents
[0003]
Patent Document 1
Summary of the Invention
Problems to be Solved by the Invention
[0004] In the conventional technology described in Patent Document 1, it is premised that one device has a function of simultaneously transmitting and scanning an advertisement packet. It has been difficult in some cases to stably establish a communication connection between devices that do not have such a function.
[0005] The present invention was made to solve the above problems and aims to provide electronic equipment, a wireless communication method, and a program that can stably establish a communication connection between devices that do not have the function of simultaneously transmitting and scanning advertised packets, even if the peripheral and central are not predetermined. [Means for solving the problem]
[0006] To achieve the above objective, the electronic device of the present invention includes a control unit that, when establishing a communication connection by BLE, performs a first operation which involves repeatedly transmitting an advertised packet and scanning for advertised packets at a set interval, acquires first information by a first method which is capable of obtaining different values for each device, and changes the interval of the first operation based on the first information while the first operation is being performed. [Effects of the Invention]
[0007] According to the present invention, even if devices that do not have the function of simultaneously transmitting and scanning advertised packets do not have a peripheral and a central device predetermined, a stable communication connection can be established between them. [Brief explanation of the drawing]
[0008] [Figure 1] This diagram shows an image of two electronic devices according to the embodiment sending and receiving advertisement packets from each other. [Figure 2] This is a block diagram showing the functional configuration of an electronic device according to an embodiment. [Figure 3] This is a diagram illustrating the information contained in an advertisement packet. [Figure 4] This diagram illustrates an example where the timing of advertising and scanning coincide. [Figure 5] This diagram illustrates an example of shifting the timing of advertising and scanning by inserting an offset. [Figure 6]This is the first part of the flowchart for the passing communication process according to the embodiment. [Figure 7] This is the second part of the flowchart for the passing communication process according to the embodiment. [Figure 8] This is the third part of the flowchart for the passing communication process according to the embodiment. [Figure 9] This is the fourth part of the flowchart for the passing communication process according to the embodiment. [Modes for carrying out the invention]
[0009] Embodiments of the present invention will be described below with reference to the drawings. In the drawings, the same or corresponding parts are denoted by the same reference numerals.
[0010] The electronic device 100 according to this embodiment is a cute-looking pet robot, as shown in Figure 1. The electronic device 100 repeatedly transmits and scans (receives advertisement packets) periodically based on the Bluetooth® Low Energy (BLE) communication standard, and a communication connection is established when two electronic devices 100 come close to each other. Once the communication connection is established, the pet robots perform actions that make it appear as if they are communicating with each other (for example, each makes a different sound). For example, when two users, each possessing an electronic device 100 as a pet robot, approach each other from a distance and pass each other, a communication connection is established between the two electronic devices, and predetermined actions indicating communication between the pet robots (such as each making a different sound) are performed.
[0011] The electronic device 100, as shown in Figure 2, comprises a control unit 110, a storage unit 120, a communication unit 130, a detection unit 140, an operation unit 150, and an operation input unit 160. The control unit 110 is composed of, for example, a CPU (Central Processing Unit) and executes the passing communication processing described later using a program stored in the memory unit 120. The control unit 110 supports multithreading functionality, which allows it to execute multiple processes in parallel, and can execute various processes (for example, passing communication processing, the advertisement / scan repetition operation described later, and other processes necessary for the operation of the electronic device 100) in parallel. The control unit 110 also has a clock function and a timer function, which allows it to measure the date and time and time. The memory unit 120 consists of ROM (Read Only Memory), flash memory, RAM (Random Access Memory), etc. The ROM stores the program executed by the CPU of the control unit 110 and the data necessary in advance for executing the program. The flash memory is a writable, non-volatile memory and stores data that should be saved even after the power is turned off. The RAM stores data that is created or modified during program execution. The memory unit 120 also stores, for example, the sound data output by the operation unit 150.
[0012] The communication unit 130 is equipped with a Bluetooth® controller that transmits and receives wireless signals based on the short-range wireless communication standard BLE, and communicates with other electronic devices 100. The communication unit 130 also stores the MAC (Media Access Control) address unique to each electronic device 100, its own Service UUID (which, as will be described later, is an ID indicating the services (functions) that the electronic device 100 possesses, and can be said to be information indicating the type of electronic device 100), etc. A MAC address is an identifier used to uniquely identify a device connected to a network, and every device connected to the network is assigned a different MAC address. The detection unit 140 is equipped with an acceleration sensor and detects the acceleration of the electronic device 100. For example, when a user lifts or carries the electronic device 100, acceleration other than the acceleration detected when the electronic device 100 is stationary (gravitational acceleration) is generated in the electronic device 100. The control unit 110 can determine the movement of the electronic device 100 by comparing the acceleration detected by the detection unit 140 with the gravitational acceleration. The operating unit 150 is equipped with a motor, speaker, etc., and moves the body of the electronic device 100 as a pet robot and emits sounds. However, the operating unit 150 is not necessarily required to have a motor and speaker, and can be equipped with any device necessary to enable the electronic device 100 to perform actions as a pet robot. For example, if the only action of the pet robot is to emit sounds, the operating unit 150 may not have a motor and may only have a speaker. The operation input section 160 is an interface for receiving user operations such as turning the power on / off and adjusting the output volume.
[0013] The functional configuration of the electronic device 100 has been explained above. Typically, with BLE, two devices communicate by having one act as a peripheral, sending advertisement packets, while the other acts as a central, receiving advertisement packets. However, since both electronic devices 100 are the same pet robot and communicate using the same software control, it's not possible to decide in advance which will be the peripheral and which will be the central. Therefore, electronic device 100 is designed to alternate between advertising and scanning, allowing it to function as both a peripheral and a central. Advertisement packets (packets with a PDU (Protocol Data Unit) Type of ADV_IND) contain information such as Service UUID (Universally Unique Identifier), Local Name, MAC Address, and Tx (Transmitter) Power, as shown in Figure 3.
[0014] The Service UUID indicates what kind of service (function) the electronic device 100 that sent this advertisement packet has. For example, if the Service UUIDs of two electronic devices 100 match, it can be seen that the two electronic devices 100 are of the same type (for example, the same model number). The Local Name indicates the name of the electronic device 100 that sent this advertisement packet, but it is not used in this embodiment. The MAC Address indicates the MAC address of the electronic device 100 that sent this advertisement packet. The Tx Power indicates the transmission output of this advertisement packet. In reality, the Tx Power indicates the value of RSSI (Received Signal Strength Indicator), which is the received signal strength when this advertisement packet is received at a point separated from the transmission point by a reference distance (for example, 1 m). Also, the communication unit 130 measures the received signal strength when receiving radio waves, and the control unit 110 acquires this received signal strength as the value of RSSI. When receiving an advertisement packet, the control unit 110 also acquires RSSI as indicating the received signal strength of this advertisement packet. In an ideal environment, when the value of RSSI is greater than or equal to the value of Tx Power, it can be assumed that the distance from the electronic device 100 that sent the advertisement packet is less than or equal to the reference distance. However, in reality, the value of RSSI changes due to various factors, so the distance calculated based on RSSI and Tx Power is an approximate distance.
[0015] In this embodiment, the two electronic devices 100 that communicate and connect via BLE are the same pet robots and are equal to each other. Therefore, as described above, it is not possible to pre-determine which one is the central device and which one is the peripheral device. In this embodiment, when such two electronic devices 100 communicate and connect via BLE, each transmits an advertisement packet as a peripheral device and each performs scanning (receiving an advertisement packet) as a central device. By doing so, if a timing occurs in which the transmission of one advertisement packet and the scanning of the other are performed simultaneously, communication connection can be established. However, for example, as shown in FIG. 4, if the timings of the transmission and scanning of an advertisement packet in one electronic device 100 (Device A) and the timings of the transmission and scanning of an advertisement packet in the other electronic device 100 (Device B) coincide, they cannot receive the advertisement packets transmitted by each other. Therefore, if a situation as shown in FIG. 4 occurs, it is necessary to somehow shift the timings at which each transmits an advertisement packet.
[0016] In this embodiment, as shown in Figure 5, even if two electronic devices 100 (device A and device B) repeatedly transmit and scan advertisement packets at the same time, this problem is solved by inserting an offset (waiting time) at a predetermined timing to delay the transmission and scanning of advertisement packets, thereby shifting the timing of subsequent transmissions and scans of advertisement packets. For example, in the example shown in Figure 5, device A inserts an offset at time T0, so that at time T1, each device can receive the other's advertisement packets by scanning. However, since both device A and device B are electronic devices 100 with basically the same hardware and software, simply inserting an offset may result in the insertion of offsets of the same length at the same timing, in which case it would not be possible to shift the timing of transmissions and scans of advertisement packets. To solve this problem, device-specific information (first information) unique to each electronic device 100 can be obtained using a method (first method) that can obtain different values for each electronic device 100, and the length of the offset time (hereinafter referred to as "offset value") or the timing for inserting the offset can be set based on this different device-specific information for each electronic device 100. In this embodiment, the offset value is set using the acceleration value detected by the acceleration sensor or the MAC address value as the device-specific information (the timing for inserting the offset is also set based on the timing when a predetermined acceleration is detected). However, considering that using the MAC address value directly may pose security problems, in this embodiment, a hash value is calculated from the MAC address, and the offset value is determined based on the calculated hash value.
[0017] Furthermore, even if an offset is inserted, if the offset value is too small, the amount of timing difference between sending and scanning advertisement packets will be small. This significantly reduces the time during which one advertisement packet can be received by the other's scan, making it difficult to establish a communication connection. Conversely, if the offset value is too large, the waiting time (the time when neither advertisement packets are being sent nor scanned) will be long, again making it difficult to establish a communication connection. Therefore, it is desirable to set appropriate minimum and maximum values for the range in which the offset value is varied. In this embodiment, the offset value is calculated so that the minimum value of the offset value is 1 second and the maximum value is 3 seconds.
[0018] For example, the following is an example of how to determine the offset value when using a hash value calculated from a MAC address. While any hash function can be used to calculate the hash value, this embodiment uses the widely used SHA-256 (Secure Hash Algorithm 256-bit). SHA-256 generates a 256-bit (32-byte) hash value from data of any length, up to 2^64-1 bits. In this embodiment, the MAC address is input to SHA-256 to calculate a hash value. The hash value is treated as a 32-byte sequence (Hash[0] to Hash
[31] ), and one byte is taken from the sequence. An offset value is calculated from the value of that one byte (Hash[i], where i=0 to 31) using the following formula (1). Offset value (seconds) = 1 + Hash[i] × 0.00784 …(1) Since each byte in the byte sequence (Hash[i]) can take values from 0 to 255, calculating the offset value using equation (1) will result in an offset value between 1 second and 2.9992. Note that the coefficient 0.00784 multiplied by the byte value (Hash[i]) in equation (1) is just one example of a coefficient; any value can be set as long as it allows the offset value to be substantially different (within the range of minimum and maximum values) if the byte value is different. Furthermore, the formula itself is not limited to equation (1); any formula can be set as long as it allows the offset value to vary within the range of minimum and maximum values.
[0019] Furthermore, an example of a method for determining the offset value based on acceleration is shown below. Since acceleration is usually a 3D vector, to convert it to a scalar value, for example, we find the absolute value of acceleration (A), subtract the largest even number (B) smaller than that value (A), and then add 1. That is, we calculate the offset value using the following equation (2). Offset value (seconds) = (AB) + 1 ... (2) Since AB is a value between 0 and 2 (inclusive), when the offset value is calculated using equation (2), the offset value is a value between 1 and 3 (inclusive). Note that equation (2) is just one example of a formula for calculating the offset value from acceleration; any formula can be set that makes the offset value substantially different (within the range of minimum and maximum values) if the acceleration is different.
[0020] Based on the above concept, the process for establishing a communication connection when two electronic devices 100 pass each other (for example, when two people, each carrying an electronic device 100 as a pet robot, pass each other on the same path while approaching from opposite directions) will be explained with reference to Figures 6 to 9. This process starts when the operating mode of the electronic device 100 is set to "passing communication enabled mode". How the operating mode of the electronic device 100 is set is arbitrary, but the operating mode may be set by the user operating a switch on the operation input unit 160 to switch the operating mode, or the operating mode may be set by the user operating an external device (for example, a smartphone) via the communication unit 130.
[0021] First, the control unit 110 determines whether the current operating mode of the electronic device 100 is the pass-by communication enabled mode (step S101). If the robot is not in pass-by communication mode (step S101; No), the control unit 110 is set to perform normal pet robot operations without pass-by communication (step S102), and the pass-by communication process is terminated. If passing communication is enabled (Step S101; Yes), the control unit 110 obtains its own unique information, the MAC address, from the communication unit 130 (Step S103). The control unit 110 then generates a fixed-length (32 bytes in this embodiment) byte sequence (numeric sequence Hash[0]~Hash
[31] in this embodiment) representing a hash value from its own unique information (MAC address) (Step S104). Next, the control unit 110 sets the byte position variable i, which specifies the position in the byte sequence, to its initial value (e.g., 0) (Step S105). The control unit 110 then sets the BLE advertisement period (length of time for sending advertisement packets) and scan period (length of time for performing scans) to their default values (e.g., advertisement period is 5 seconds, scan period is 2 seconds) (Step S106). The control unit 110 then starts the repeated transmission of advertised packets and scanning at intervals based on the set period (advertisement period and scan period), and starts the timer (step S107). The operation of repeating the transmission of advertised packets and scanning of advertised packets at the set intervals, which is started in step S107 (advertisement / scan repetition operation), is executed in parallel with the passing communication process. The advertisement / scan repetition operation is also called the first operation.
[0022] Then, the control unit 110 determines whether or not it has received an advertisement packet from another electronic device 100 during the scan period (step S108). If no signal is received (step S108; No), proceed to Figure 7, where the control unit 110 determines whether a predetermined time (e.g., 15 seconds) has elapsed using the timer that was started in step S107 (or restarted in step S112, described later) (step S109). If the predetermined time has been exceeded (step S109; Yes), the control unit 110 obtains the byte value (Hash[i]) at the position indicated by the byte position variable i from the fixed-length byte sequence (Hash[0]~Hash
[31] ) representing the hash value (step S110). Then, the control unit 110 calculates the offset value (for example, by formula (1)) based on the obtained byte value (step S111). Then, the control unit 110 updates the byte position variable i (adds 1 if i is 30 or less, and resets it to 0 if i is 31), restarts the timer from 0 (step S112), and proceeds to step S115. If the predetermined time has not been exceeded (step S109; No), the control unit 110 determines whether or not the detection unit 140 has detected an acceleration greater than or equal to a predetermined value (step S113). An acceleration greater than or equal to a predetermined value is an acceleration other than gravitational acceleration, which is detected when a user moves the electronic device 100 or when a user possessing the electronic device 100 moves. If no acceleration exceeding a predetermined level is detected (step S113; No), return to step S108 in Figure 6. If an acceleration exceeding a predetermined level is detected (step S113; Yes), the control unit 110 calculates an offset value based on the detected acceleration value (for example, by equation (2)) (step S114), and proceeds to step S115. In step S115, the control unit 110 changes the repetition period of the advertise / scan repetition operation based on the offset value calculated in step S111 or step S114 (step S115). For example, the repetition period is changed by inserting an offset period of the length of the offset value between the scan period and the advertise period. Then, the process returns to step S108 in Figure 6.
[0023] On the other hand, in step S108 of Figure 6, if an advertisement packet from another electronic device 100 is received during the scan period (step S108; Yes), the process proceeds to Figure 8, where the control unit 110 obtains device type data (Service UUID) from the received advertisement packet (step S121). The control unit 110 then compares the obtained device type data with its own device type data to determine whether or not it is the same type of device (pet robot) (step S122). If the devices are not of the same type (Step S122; No), return to Step S108 in Figure 6. If the devices are of the same type (step S122; Yes), the control unit 110 estimates the distance from the received advertisement packet and its RSSI (step S123). As described above, the distance can be estimated based on the Tx Power contained in the advertisement packet and the RSSI, which is the received signal strength of the advertisement packet. The control unit 110 then determines whether the estimated distance is within a predetermined distance (e.g., 1 m) (step S124). If it is not within the predetermined distance (step S124; No), return to step S108 in Figure 6. If the distance is within a predetermined range (step S124; Yes), the control unit 110 stops the advertise / scan repetition operation (step S125). Then, the control unit 110 generates a hash value of the other device from the unique information of the other device (MAC Address included in the received advertised packet) (step S126).
[0024] Next, moving to Figure 9, the control unit 110 resets the number of retries counted in steps S131 and S137, which will be described later (step S127). Then, it determines whether its own hash value is greater than the hash value of the other device (step S128). If its own hash value is greater than the hash value of the other device (step S128; Yes), the control unit 110 operates the electronic device 100 as a fixed central (making the electronic device 100 function as a master device that controls the transmission and reception of data after the communication connection is established) and sends a connection request to the other device (step S129). Then, the control unit 110 determines whether the connection was successful or not (step S130). If the connection is unsuccessful (Step S130; No), the retry count is updated (incremented by 1), and it is determined whether the retry count is less than or equal to a predetermined number (e.g., 5 times) (Step S131). If the retry count is less than or equal to the predetermined number (Step S131; Yes), the process returns to Step S129. If the retry count exceeds the predetermined number (Step S131; No), the process returns to Step S107 in Figure 6. If the connection is successful (step S130; Yes), the control unit 110 performs a communication operation between the connected electronic devices 100 (step S132). This communication operation is arbitrary, but as an example, the memory unit 120 has pre-stored a central sound and a peripheral sound. When the control unit 110 connects to the other device as a central, it outputs the central sound using the operation unit 150, and when it connects as a peripheral, it outputs the peripheral sound using the operation unit 150. Then, the control unit 110 determines whether the communication connection has ended or not (step S133). For example, if the distance between the two electronic devices 100 that are communicating increases and radio waves can no longer reach each other, the communication connection will end. If the communication connection has not ended (step S133; No), the process returns to step S101 in Figure 6. If the communication connection has ended (step S133; Yes), the control unit 110 determines whether or not to terminate the operation of the electronic devices 100 (step S134). For example, if a user operates the operation input unit 160 and issues a command to terminate the operation of the electronic device 100 (for example, by turning off the power switch), the control unit 110 will terminate the operation of the electronic device 100. If the operation of the electronic device 100 is not terminated (step S134; No), the process returns to step S132 and the communication operation between the electronic devices 100 is repeated. If the operation of the electronic device 100 is terminated (step S134; Yes), the passing communication process is terminated.
[0025] On the other hand, if the determination in step S128 is that the device's own hash value is less than or equal to the hash value of the other device (step S128; No), the control unit 110 operates the electronic device 100 as a fixed peripheral (after the communication connection is established, the electronic device 100 functions as a slave device that sends and receives data according to the control of the master device), and performs advertising (sending advertising packets) for a certain period of time (for example, 15 seconds) (step S135). Then, the control unit 110 determines whether or not a connection with the other device has been established (step S136). If a connection has been established (step S136; Yes), the process proceeds to step S132. If a connection has not been established (step S136; No), the retry count is updated (incremented by 1), and it is determined whether or not the retry count is less than or equal to a predetermined number (for example, 5 times) (step S137). If the retry count is less than or equal to the predetermined number (step S137; Yes), the process returns to step S135. If the number of retries exceeds a predetermined number (step S137; No), return to step S107 in Figure 6.
[0026] As described above, the control unit 110 obtains different values (first information such as hash value and acceleration) for each electronic device 100 using the MAC address and acceleration sensor, and changes the cycle of the advertisement / scan repetition operation based on the first information while the advertisement / scan repetition operation is being executed. Therefore, even if it is not predetermined which electronic device 100 is the peripheral and which is the central, a stable communication connection can be established between electronic devices 100 that do not have the function to send advertisement packets and scan simultaneously. Furthermore, by using the MAC address as a method to obtain a different value for each of the 100 electronic devices (first method), it is possible to obtain a value that is guaranteed to be distinct as device-specific information (first information). Furthermore, by using a hash value generated based on the MAC address as device-specific information (first information), security problems that tend to arise from directly using the MAC address can be avoided. Furthermore, in steps S110 to S112 and S115 of the passing communication processing (Figure 7), the control unit 110 extracts a portion of the numerical sequence (byte sequence) representing the hash value (extracting the byte value at the position indicated by the byte position variable i), uses it to generate an offset time (offset value), changes the period of the advertisement / scan repetition operation using the generated offset time, and changes the position (byte position variable i) from which this portion of the numerical sequence is extracted until the communication connection is established, thereby enabling the generation of a wider variety of offset values.
[0027] Furthermore, in step S128 of the passing communication processing (Figure 9), the control unit 110 determines whether the electronic device 100 will be the central or peripheral device based on the first information (hash value in this embodiment) when establishing a communication connection. Therefore, a stable communication connection can be established even if it is not predetermined which electronic device 100 will be the peripheral or the central device. Furthermore, in steps S113 to S115 of the passing communication processing (Figure 7), the control unit 110 changes the period of the advertisement / scan repetition operation when a predetermined acceleration is detected by the acceleration sensor while the advertisement / scan repetition operation is being performed. Therefore, even before the predetermined time is exceeded in step S109, a communication connection can be quickly established in response to the user's movement. Furthermore, in steps S122 and S124 of the passing communication process (Figure 8), the control unit 110 determines, based on the advertised packet, whether the other device is of the same type and whether the estimated distance to the other device is less than or equal to a predetermined distance. If it determines that the other device is of the same type and the estimated distance is less than or equal to the predetermined distance, it establishes a communication connection with the other device. Thus, communication can only be established when two identical pet robots come within a predetermined distance of each other, realizing the so-called "passing communication" function. Furthermore, in step S132 of the passing communication processing (Figure 9), the control unit 110 performs a predetermined operation to indicate communication between pet robots after establishing a communication connection. This allows users to feel more familiar with the electronic device 100 as a pet robot, recognize when users who own pet robots pass each other, and promote interaction between users of the electronic device 100 as a pet robot.
[0028] It should be noted that the present invention is not limited to the embodiments described above, and various modifications are possible. For example, in the above embodiment, MAC addresses and acceleration sensor detection values were used as first information that differs for each electronic device 100, but the first information is not limited to these. Any information that can be obtained as a different value for each electronic device 100 can be used as first information. For example, sensors other than acceleration sensors, such as gyro sensors, may be provided and their detection values may be obtained as first information, or sensors that acquire biological information (pulse, blood pressure, etc.) may be provided and the user's biological information may be obtained as first information. In addition, information such as temperature and time may be obtained as first information as information that may have errors for each electronic device 100. In addition, random numbers generated by each electronic device 100 may be used as first information. However, among the various types of information listed above, MAC addresses in particular are guaranteed to be different values for each electronic device 100, so using MAC addresses as first information for calculating the offset value has the advantage that the offset value can be reliably made different with just one calculation.
[0029] Furthermore, in the above embodiment, after establishing a communication connection, the device with the larger hash value obtained from the MAC address was fixed as the central (master device). However, the reverse may also be done (the device with the larger hash value was fixed as the peripheral (slave device)). Furthermore, in the above-described embodiment, the MAC address was not used directly as the offset value and the value used to determine the central / peripheral (first information) for security reasons, but a hash value generated from the MAC address was used. However, in cases where security is not a major concern, the MAC address may be used directly without generating a hash value. Furthermore, while the above-described embodiment described a method of changing the period of the advertisement / scan repetition operation by inserting an offset, the method of changing the period is not limited to inserting an offset. Instead of inserting an offset, or together with inserting an offset, the period may be changed by changing (extending or shortening) the length of the advertisement period or scan period. Alternatively, instead of calculating the offset value based on the MAC address or hash value, a period change multiplier may be calculated based on the MAC address or hash value, and the length of one period, including the advertisement period and scan period, may be increased or decreased by the calculated multiplier.
[0030] Furthermore, in the embodiments described above, the electronic device 100 was described as a pet robot. However, the electronic device 100 does not have to be a pet robot. For example, the electronic device 100 may be a wristwatch, and a predetermined action indicating communication between electronic devices 100 may be the playback of a predetermined melody (a melody indicating the central device and a melody indicating the peripheral device). In this case, when users wearing these wristwatches approach each other, a passing communication process will occur, and different melodies will be played from each wristwatch. Furthermore, in the above embodiment, communication was established only when the Service UUIDs matched, but matching Service UUIDs is not mandatory. For example, even if the Service UUIDs do not match, if the electronic devices are of different types and are from the same manufacturer, communication may be established.
[0031] In the embodiments described above, the operation program executed by the CPU of the control unit 110 was described as being stored in advance in the ROM of the storage unit 120. However, the present invention is not limited thereto, and the operation program for executing the various processes described above may be implemented in an existing general-purpose computer or the like, thereby functioning as a device to control the electronic device 100 according to the embodiments described above. The method of providing such programs is optional. For example, they may be distributed by storing them on a computer-readable storage medium (flexible disk, CD (Compact Disc)-ROM, DVD (Digital Versatile Disc)-ROM, MO (Magneto-Optical Disc), memory card, USB memory, etc.), or they may be stored on network storage such as the internet and provided for download. Furthermore, when the above-mentioned processing is performed through a division of labor between the OS (Operating System) and the application program, or through collaboration between the OS and the application program, only the application program may be stored on a recording medium or storage device. It is also possible to superimpose the program onto a carrier wave and distribute it over a network. For example, the above program may be posted on a bulletin board system (BBS) on a network and distributed over the network. This program can then be launched and executed under the control of the OS, just like other application programs, to perform the above-mentioned processing.
[0032] This invention allows for various embodiments and modifications without departing from the broad spirit and scope of the invention. Furthermore, the embodiments described above are for illustrative purposes only and do not limit the scope of the invention. In other words, the scope of the invention is indicated not by the embodiments, but by the claims. Various modifications made within the scope of the claims and the equivalent scope of the meaning of the invention are considered to be within the scope of this invention. [Explanation of symbols]
[0033] 100...Electronic equipment, 110...Control unit, 120...Storage unit, 130...Communication unit, 140...Detection unit, 150...Operation unit, 160...Operation input unit
Claims
1. When establishing a communication connection using BLE, The first operation is performed, which involves sending an advertisement packet and scanning for advertisement packets, repeating these operations at a set interval. First information is obtained by a first method that can obtain different values for each device, During the execution of the first operation, the period of the first operation is changed based on the first information. An electronic device equipped with a control unit.
2. The first method described above is a method that uses a unique MAC address for each device. The electronic device according to claim 1.
3. The first piece of information is a hash value generated based on the MAC address. The electronic device according to claim 2.
4. The control unit, A portion of the numerical sequence representing the hash value is extracted to generate an offset time, The period of the first operation is changed using the offset time generated above. Until a communication connection is established, the position from which a portion of the aforementioned numerical sequence is extracted is changed. The electronic device according to claim 3.
5. The control unit, Based on the first information, an offset time is generated, The period of the first operation is changed by inserting the generated offset time between the advertisement period for transmitting the advertisement packets and the scan period for scanning the advertisement packets, or by extending the advertisement period or the scan period by the amount of the generated offset time. The electronic device according to claim 1.
6. The control unit, After establishing a communication connection, it is determined, based on the first information, whether to have it function as a central device that permanently controls the transmission and reception of data, or as a peripheral device that permanently transmits and receives data according to the control of the central device. The electronic device according to claim 1.
7. Equipped with an acceleration sensor, The control unit, During the execution of the first operation, the period of the first operation is changed at the timing when a predetermined acceleration is detected by the acceleration sensor. The electronic device according to claim 1.
8. The control unit, Based on the advertisement packets received by the scan, it is determined whether the device that sent the advertisement packets is of the same type as itself, and whether the estimated distance between them is less than or equal to a predetermined distance. When it is determined that the aforementioned device is of the same type as itself, and that the estimated distance between them is less than or equal to a predetermined distance, a communication connection is established with the aforementioned device. The electronic device according to claim 1.
9. The type of device mentioned above is a pet robot. The control unit, After establishing a communication connection with the aforementioned device, a predetermined action is performed to indicate communication between the pet robots. The electronic device according to claim 7.
10. A wireless communication method for establishing a communication connection using BLE, The control unit, The first operation is performed, which involves sending an advertisement packet and scanning for advertisement packets, repeating these operations at a set interval. First information is obtained by a first method that can obtain different values for each device, During the execution of the first operation, the period of the first operation is changed based on the first information. Wireless communication method.
11. A program for establishing a communication connection using BLE, In the control unit, The first operation is performed, which involves sending an advertisement packet and scanning for advertisement packets, repeating these operations at a set interval. First information is obtained by a first method that can obtain different values for each device, During the execution of the first operation, the period of the first operation is changed based on the first information. A program to execute a process.