Class: MsgNotifyCompleteSpeech

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

Overview

<summary> 読み上げ完了通知メッセージ(0x13) </summary>

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeMsgNotifyCompleteSpeech

Returns a new instance of MsgNotifyCompleteSpeech.



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/haruzira_sdk/MsgNotifyCompleteSpeech.rb', line 10

def initialize()
    #region 変数・定数定義
    #メンバーIndex offset定義
    @INDEX_ID = 0              #メッセージID
    @INDEX_RESULT = 1          #結果
    @INDEX_TIME_STAMP = 2      #タイムスタンプ(00:00:00)


    # <summary>
    # 送信メンバデータ値定義
    # </summary>
    #結果
    @RESULT_CODE_OK = 0x00                  #成功
    @RESULT_CODE_NG = 0x01                  #失敗

    @id = MSG_NOTIFY_COMPLETE_SPEECH       #メッセージID
    @result = @RESULT_CODE_OK                #結果
    @time_stamp = Array.new(8, 0x00)        #タイムスタンプ(00:00:00)
    @total_len = 10                         #送信フィールド合計サイズ
    #endregion
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



40
41
42
# File 'lib/haruzira_sdk/MsgNotifyCompleteSpeech.rb', line 40

def id
  @id
end

#INDEX_IDObject (readonly)

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



33
34
35
# File 'lib/haruzira_sdk/MsgNotifyCompleteSpeech.rb', line 33

def INDEX_ID
  @INDEX_ID
end

#INDEX_RESULTObject (readonly)

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



33
34
35
# File 'lib/haruzira_sdk/MsgNotifyCompleteSpeech.rb', line 33

def INDEX_RESULT
  @INDEX_RESULT
end

#INDEX_TIME_STAMPObject (readonly)

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



33
34
35
# File 'lib/haruzira_sdk/MsgNotifyCompleteSpeech.rb', line 33

def INDEX_TIME_STAMP
  @INDEX_TIME_STAMP
end

#resultObject

アクセサ定義



39
40
41
# File 'lib/haruzira_sdk/MsgNotifyCompleteSpeech.rb', line 39

def result
  @result
end

#RESULT_CODE_NGObject (readonly)

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



36
37
38
# File 'lib/haruzira_sdk/MsgNotifyCompleteSpeech.rb', line 36

def RESULT_CODE_NG
  @RESULT_CODE_NG
end

#RESULT_CODE_OKObject (readonly)

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



36
37
38
# File 'lib/haruzira_sdk/MsgNotifyCompleteSpeech.rb', line 36

def RESULT_CODE_OK
  @RESULT_CODE_OK
end

#time_stampObject

アクセサ定義



39
40
41
# File 'lib/haruzira_sdk/MsgNotifyCompleteSpeech.rb', line 39

def time_stamp
  @time_stamp
end

#total_lenObject (readonly)

Returns the value of attribute total_len.



40
41
42
# File 'lib/haruzira_sdk/MsgNotifyCompleteSpeech.rb', line 40

def total_len
  @total_len
end

Instance Method Details

#makeSendDataObject

<summary> 送信データ生成</summary> <returns>生成データサイズ, 生成データ</returns>



47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/haruzira_sdk/MsgNotifyCompleteSpeech.rb', line 47

def makeSendData()
    len = @total_len
    data = nil

    begin
        data = [@id] + [@result] + @time_stamp

    rescue Exception => ex
        p ex
        len = 0
    ensure
        return len, data
    end
end