Automated host recovery of peripheral-initiated communications links
A method includes: establishing a connection with a peripheral device; storing an identifier of the peripheral device and an operational state of the peripheral device; periodically updating the stored operational state of the peripheral device; subsequent to disconnection of the peripheral device, retrieving the stored operational state of the peripheral device; determining whether the stored operational state satisfies a criterion indicating that the disconnection was intentional; and controlling a reconnection with the peripheral device based on the determination.
1 . A method, comprising:
establishing a connection with a peripheral device;
storing an identifier of the peripheral device and an operational state of the peripheral device;
periodically updating the stored operational state of the peripheral device;
subsequent to disconnection of the peripheral device, retrieving the stored operational state of the peripheral device;
determining whether the stored operational state satisfies a criterion indicating that the disconnection was intentional; and
controlling a reconnection with the peripheral device based on the determination,
wherein,
the stored operational state is selected from a set of operational states,
determining whether the stored operational state satisfies the criterion includes determining whether the stored operational state matches a predetermined one of the set of operational states, and
controlling the reconnection with the peripheral device includes when the stored operational state does not match the predetermined operational state, sending a reconnection command to the peripheral device, the reconnection command containing an identifier of a host device.
2 . The method of claim 1 , wherein
storing the identifier of the peripheral device and the operational state of the peripheral device includes storing the identifier of the peripheral device and the operational state in a predetermined persistent storage location.
3 . The method of claim 1 , wherein
controlling the reconnection with the peripheral device includes:
when the stored operational state matches the predetermined operational state, suppressing the reconnection.
4 . The method of claim 3 , further comprising:
deleting the stored operational state and the identifier of the peripheral device.
5 . The method of claim 1 , further comprising:
establishing the connection with the peripheral device using a first protocol; and
wherein controlling the reconnection includes:
when the stored operational state does not satisfy the criterion, scanning for the peripheral device using a second protocol.
6 . A computing device, comprising:
a communications interface;
a memory; and
a processor configured to:
establish, a connection with a peripheral device via the communications interface;
store, in the memory, an identifier of the peripheral device and an operational state of the peripheral device;
periodically update the stored operational state of the peripheral device;
subsequent to disconnection of the peripheral device, retrieve the stored operational state of the peripheral device;
determine whether the stored operational state satisfies a criterion indicating that the disconnection was intentional; and
control a reconnection with the peripheral device based on the determination,
wherein,
the stored operational state is selected from a set of operational states, and
the processor is configured to determine whether the stored operational state satisfies the criterion by determining whether the stored operational state matches a predetermined one of the set of operational states.
7 . The computing device of claim 6 , wherein
the processor is configured to store the identifier of the peripheral device and the operational state of the peripheral device in a predetermined persistent location of the memory.
8 . The computing device of claim 6 , wherein
the processor is configured to control the reconnection with the peripheral device by:
when the stored operational state matches the predetermined operational state, suppressing the reconnection.
9 . The computing device of claim 8 , wherein
the processor is configured to:
delete the stored operational state and the identifier of the peripheral device.
10 . The computing device of claim 6 , wherein
processor is configured to:
establish the connection with the peripheral device using a first protocol; and
control the reconnection by:
when the stored operational state does not satisfy the criterion, scanning for the peripheral device using a second protocol.