If I register for the wake-up feature and the callback for TripChange, which event will be called first?

There is no guarantee which event will come first – the wake-up call or tripClassChanged callback – But, you are guaranteed that when tripClassChanged callback will be called you can safely reregister for a wake-up call.