Class: MsgAckSendSpeechRecognitionCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/haruzira_sdk/MsgAckSendSpeechRecognitionCommand.rb

Overview

<summary> 音声認識コマンド送信応答メッセージ(0x05) </summary>

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeMsgAckSendSpeechRecognitionCommand

Returns a new instance of MsgAckSendSpeechRecognitionCommand.



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/haruzira_sdk/MsgAckSendSpeechRecognitionCommand.rb', line 9

def initialize()
    #region 変数・定数定義
    #メンバーIndex offset定義
    @INDEX_ID = 0              #メッセージID
    @INDEX_ACK_CODE = 1        #応答コード
    @INDEX_ERR_CODE = 2        #エラーコード(異常時)
    @INDEX_PADDING = 3         #アライメント
    @INDEX_TIME_STAMP = 4      #タイムスタンプ(00:00:00)


    # <summary>
    # 送信メンバデータ値定義
    # </summary>
    #応答コード
    @ACK_CODE_OK = 0x00      #正常
    @ACK_CODE_NG = 0x01      #異常
    #エラーコード(異常時)
    @ERR_CODE_NONE = 0x00                 #エラーなし
    @ERR_CODE_RCV_DATA = 0x01             #受信データエラー
    @ERR_CODE_CREATE_ACK_DATA = 0x02      #応答データ生成エラー
    @ERR_CODE_DECODE_ENC = 0x03           #暗号化データ復号エラー
    @ERR_CODE_UNKNOWN_IP = 0x04           #IPアドレスが不正
    @ERR_CODE_ENCRIPTION_DISABLE = 0x05   #暗号化無効(パスワード認証が無効)
    @ERR_CODE_BUFFER_FULL = 0x06          #バッファーフル
    @ERR_CODE_OTHER_REASONS = 0x10        #その他原因によるエラー

    @id = MSG_ACK_SEND_SPEECH_RECOGNITION_COMMAND   #メッセージID
    @ack_code = 0x00                                #応答コード
    @err_code = 0x00                                #エラーコード(異常時)
    @padding = 0x00                                 #アライメント
    @time_stamp = Array.new(8, 0x00)                #タイムスタンプ(00:00:00)
    @total_len = 12                                #送信フィールド合計サイズ
    #endregion
end

Instance Attribute Details

#ack_codeObject

アクセサ定義



53
54
55
# File 'lib/haruzira_sdk/MsgAckSendSpeechRecognitionCommand.rb', line 53

def ack_code
  @ack_code
end

#ACK_CODE_NGObject (readonly)

アクセサ定義(送信メンバデータ値)



48
49
50
# File 'lib/haruzira_sdk/MsgAckSendSpeechRecognitionCommand.rb', line 48

def ACK_CODE_NG
  @ACK_CODE_NG
end

#ACK_CODE_OKObject (readonly)

アクセサ定義(送信メンバデータ値)



48
49
50
# File 'lib/haruzira_sdk/MsgAckSendSpeechRecognitionCommand.rb', line 48

def ACK_CODE_OK
  @ACK_CODE_OK
end

#err_codeObject

アクセサ定義



53
54
55
# File 'lib/haruzira_sdk/MsgAckSendSpeechRecognitionCommand.rb', line 53

def err_code
  @err_code
end

#ERR_CODE_BUFFER_FULLObject (readonly)

アクセサ定義(送信メンバデータ値)



48
49
50
# File 'lib/haruzira_sdk/MsgAckSendSpeechRecognitionCommand.rb', line 48

def ERR_CODE_BUFFER_FULL
  @ERR_CODE_BUFFER_FULL
end

#ERR_CODE_CREATE_ACK_DATAObject (readonly)

アクセサ定義(送信メンバデータ値)



48
49
50
# File 'lib/haruzira_sdk/MsgAckSendSpeechRecognitionCommand.rb', line 48

def ERR_CODE_CREATE_ACK_DATA
  @ERR_CODE_CREATE_ACK_DATA
end

#ERR_CODE_DECODE_ENCObject (readonly)

アクセサ定義(送信メンバデータ値)



48
49
50
# File 'lib/haruzira_sdk/MsgAckSendSpeechRecognitionCommand.rb', line 48

def ERR_CODE_DECODE_ENC
  @ERR_CODE_DECODE_ENC
end

#ERR_CODE_ENCRIPTION_DISABLEObject (readonly)

アクセサ定義(送信メンバデータ値)



48
49
50
# File 'lib/haruzira_sdk/MsgAckSendSpeechRecognitionCommand.rb', line 48

def ERR_CODE_ENCRIPTION_DISABLE
  @ERR_CODE_ENCRIPTION_DISABLE
end

#ERR_CODE_NONEObject (readonly)

アクセサ定義(送信メンバデータ値)



48
49
50
# File 'lib/haruzira_sdk/MsgAckSendSpeechRecognitionCommand.rb', line 48

def ERR_CODE_NONE
  @ERR_CODE_NONE
end

#ERR_CODE_OTHER_REASONSObject (readonly)

アクセサ定義(送信メンバデータ値)



48
49
50
# File 'lib/haruzira_sdk/MsgAckSendSpeechRecognitionCommand.rb', line 48

def ERR_CODE_OTHER_REASONS
  @ERR_CODE_OTHER_REASONS
end

#ERR_CODE_RCV_DATAObject (readonly)

アクセサ定義(送信メンバデータ値)



48
49
50
# File 'lib/haruzira_sdk/MsgAckSendSpeechRecognitionCommand.rb', line 48

def ERR_CODE_RCV_DATA
  @ERR_CODE_RCV_DATA
end

#ERR_CODE_UNKNOWN_IPObject (readonly)

アクセサ定義(送信メンバデータ値)



48
49
50
# File 'lib/haruzira_sdk/MsgAckSendSpeechRecognitionCommand.rb', line 48

def ERR_CODE_UNKNOWN_IP
  @ERR_CODE_UNKNOWN_IP
end

#idObject (readonly)

Returns the value of attribute id.



54
55
56
# File 'lib/haruzira_sdk/MsgAckSendSpeechRecognitionCommand.rb', line 54

def id
  @id
end

#INDEX_ACK_CODEObject (readonly)

アクセサ定義(メンバーIndex offset)



45
46
47
# File 'lib/haruzira_sdk/MsgAckSendSpeechRecognitionCommand.rb', line 45

def INDEX_ACK_CODE
  @INDEX_ACK_CODE
end

#INDEX_ERR_CODEObject (readonly)

アクセサ定義(メンバーIndex offset)



45
46
47
# File 'lib/haruzira_sdk/MsgAckSendSpeechRecognitionCommand.rb', line 45

def INDEX_ERR_CODE
  @INDEX_ERR_CODE
end

#INDEX_IDObject (readonly)

アクセサ定義(メンバーIndex offset)



45
46
47
# File 'lib/haruzira_sdk/MsgAckSendSpeechRecognitionCommand.rb', line 45

def INDEX_ID
  @INDEX_ID
end

#INDEX_PADDINGObject (readonly)

アクセサ定義(メンバーIndex offset)



45
46
47
# File 'lib/haruzira_sdk/MsgAckSendSpeechRecognitionCommand.rb', line 45

def INDEX_PADDING
  @INDEX_PADDING
end

#INDEX_TIME_STAMPObject (readonly)

アクセサ定義(メンバーIndex offset)



45
46
47
# File 'lib/haruzira_sdk/MsgAckSendSpeechRecognitionCommand.rb', line 45

def INDEX_TIME_STAMP
  @INDEX_TIME_STAMP
end

#paddingObject

アクセサ定義



53
54
55
# File 'lib/haruzira_sdk/MsgAckSendSpeechRecognitionCommand.rb', line 53

def padding
  @padding
end

#time_stampObject

アクセサ定義



53
54
55
# File 'lib/haruzira_sdk/MsgAckSendSpeechRecognitionCommand.rb', line 53

def time_stamp
  @time_stamp
end

#total_lenObject (readonly)

Returns the value of attribute total_len.



54
55
56
# File 'lib/haruzira_sdk/MsgAckSendSpeechRecognitionCommand.rb', line 54

def total_len
  @total_len
end

Instance Method Details

#makeSendDataObject

<summary> 送信データ生成</summary> <param name=“sd”>生成データ</param> <returns>生成データサイズ</returns>



63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/haruzira_sdk/MsgAckSendSpeechRecognitionCommand.rb', line 63

def makeSendData()
    mdata = nil

    begin
        mdata = [@id] + [@ack_code] + [@err_code] + [@padding] + @time_stamp

    rescue Exception => ex
        p ex
        @total_len = 0
    ensure
        return @total_len, mdata
    end
end