[hexiwear] I want the screen to appear when the Bluetooth connection is disconnected

I am developing using hexiwear.
I run the Android app by connecting it via Bluetooth.

while (true)
{
blueLed = !kw40z_device.GetAdvertisementMode();

}

I want to display Disconnected on the hexiwear screen when the bluetooth connection is lost.
I found some examples and tried to run them, but all of them got errors or could not be executed, so I’ll upload them