1 package com.smartdevicelink.proxy.rpc;
\r
3 import java.util.Hashtable;
\r
5 import com.smartdevicelink.proxy.RPCNotification;
\r
6 import com.smartdevicelink.proxy.constants.Names;
\r
7 import com.smartdevicelink.proxy.rpc.enums.TBTState;
\r
8 import com.smartdevicelink.util.DebugTool;
\r
11 * <p>Notifies the application of the current TBT client status on the module.</p>
\r
14 * <b>HMI Status Requirements:</b>
\r
17 * <ul><li>Can be sent with FULL, LIMITED or BACKGROUND</li></ul>
\r
18 * AudioStreamingState:
\r
19 * <ul><li>Any</li></ul>
\r
21 * <ul><li>Any</li></ul>
\r
24 * <b>Parameter List:</b>
\r
25 * <table border="1" rules="all">
\r
29 * <th>Description</th>
\r
30 * <th>Applink Ver Available</th>
\r
34 * <td>{@linkplain TBTState}</td>
\r
35 * <td>Current state of TBT client.</td>
\r
36 * <td>SmartDeviceLink 1.0</td>
\r
39 * @since SmartDeviceLink 1.0
\r
42 public class OnTBTClientState extends RPCNotification {
\r
44 *Constructs a newly allocated OnTBTClientState object
\r
46 public OnTBTClientState() {
\r
47 super("OnTBTClientState");
\r
50 *<p>Constructs a newly allocated OnTBTClientState object indicated by the Hashtable parameter</p>
\r
51 *@param hash The Hashtable to use
\r
53 public OnTBTClientState(Hashtable hash) {
\r
57 * <p>Called to get the current state of TBT client</p>
\r
58 * @return {@linkplain TBTState} the current state of TBT client
\r
60 public TBTState getState() {
\r
61 Object obj = parameters.get(Names.state);
\r
62 if (obj instanceof TBTState) {
\r
63 return (TBTState)obj;
\r
64 } else if(obj instanceof String) {
\r
65 TBTState theCode = null;
\r
67 theCode = TBTState.valueForString((String) obj);
\r
68 } catch (Exception e) {
\r
69 DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.state, e);
\r
76 * <p>Called to set the current state of TBT client</p>
\r
77 * @param state current state of TBT client
\r
79 public void setState( TBTState state ) {
\r
80 if (state != null) {
\r
81 parameters.put(Names.state, state );
\r
83 parameters.remove(Names.state);
\r