haruzira_sdk 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b233100b4997210602e835e6f5e8d90d2e0627e9
|
|
4
|
+
data.tar.gz: ca3bc2426ab15b4c9f33a26a0cf4b4e20c2ac64c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: eaeadd0a25800f281812e54709526abf03b6123817dcaad41780d8e5d49e6f53c171113d5c8f1ccc96747d62238ada5558f650e0f435bf40c3ddd73d02e3a5c5
|
|
7
|
+
data.tar.gz: 7c06161322476ccf9e54d48a616ec7b2068fdbaef1269376282ab6c367be7d503066d8c563d04b0c057fa3a549996611c8ed75e8a1a82fedfeed9bbfeecf133f
|
|
@@ -33,6 +33,25 @@ module HzSpeechGender
|
|
|
33
33
|
Male = 0x01 #男性
|
|
34
34
|
Neutral = 0x02 #未指定
|
|
35
35
|
end
|
|
36
|
+
|
|
37
|
+
# <summary>
|
|
38
|
+
# SDK language type
|
|
39
|
+
# </summary>
|
|
40
|
+
module HzSdkLangType
|
|
41
|
+
Unknown = 0x00 #不明
|
|
42
|
+
DotNet = 0x01 #.Net
|
|
43
|
+
Ruby = 0x02 #Ruby
|
|
44
|
+
Python = 0x03 #Python
|
|
45
|
+
Java = 0x04 #Java
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# <summary>
|
|
49
|
+
# Necessity of sending Speech Completion Notice message
|
|
50
|
+
# </summary>
|
|
51
|
+
module HzSpCompletionNoticeNecessity
|
|
52
|
+
Need = 0x00 #送信必要
|
|
53
|
+
NoNeed = 0x01 #送信不要
|
|
54
|
+
end
|
|
36
55
|
#endregion
|
|
37
56
|
|
|
38
57
|
class ClientTcpCommunication
|
|
@@ -48,6 +67,9 @@ class ClientTcpCommunication
|
|
|
48
67
|
@DISCONNECT_REASON_CLIENT_IREGULAR = 0x13 #クライアント側でイレギュラー障害発生
|
|
49
68
|
@QUEUE_RECEIVED = "OK"
|
|
50
69
|
|
|
70
|
+
@SDK_LANG_TYPE = HzSdkLangType::Ruby
|
|
71
|
+
@Version = "2.1.0.0" #SDKバージョン
|
|
72
|
+
|
|
51
73
|
@encryption = Encryption.new
|
|
52
74
|
#@encryption = nil
|
|
53
75
|
|
|
@@ -71,12 +93,13 @@ class ClientTcpCommunication
|
|
|
71
93
|
@ReqSendDataSpeechGender = HzSpeechGender::Neutral
|
|
72
94
|
@ReqSendDataSpeechAge = 25
|
|
73
95
|
@ReqSendDataSpeechRepeat = 0
|
|
96
|
+
@ReqSendDataCompletionNoticeNecessity = HzSpCompletionNoticeNecessity::Need
|
|
74
97
|
@ReceivedDataDecryptionKey = ""
|
|
75
98
|
@SendDataHexStr = ""
|
|
76
99
|
@SendDataLength = 0
|
|
77
100
|
@ReceiveStatus = 0x00
|
|
78
101
|
@ReceiveAckTimeOut = RECEIVE_TIME_OUT
|
|
79
|
-
@
|
|
102
|
+
@SdkVersions = [@Version.split(".")[0].to_i, @Version.split(".")[1].to_i] #SDKバージョン(送信用)
|
|
80
103
|
|
|
81
104
|
#メッセージ受信時イベント定義
|
|
82
105
|
@EvNotifyCompeteSpeech = nil #読み上げ完了通知受信時イベント
|
|
@@ -89,7 +112,8 @@ class ClientTcpCommunication
|
|
|
89
112
|
#define accessor
|
|
90
113
|
attr_accessor :ServerPortNo, :ServerIP, :ReceivePort, :ReqSendDataText, :ReqSendDataEncrypt, :ReqSendDataEncryptKey, :ReqSendDataAccountName, :ReqSendDataPasswd, \
|
|
91
114
|
:ReqSendDataSpeechMode, :ReqSendDataSpeechLevel, :ReqSendDataSpeechLocaleId, :ReqSendDataSpeechGender, :ReqSendDataSpeechAge, :ReqSendDataSpeechRepeat, \
|
|
92
|
-
:ReceivedDataDecryptionKey, :EvNotifyCompeteSpeech, :EvNotifyMessageEvent, :EvNotifyReceivedDisConnectEvent, :EvNotifySendSpeechRecognitionCommand
|
|
115
|
+
:ReceivedDataDecryptionKey, :EvNotifyCompeteSpeech, :EvNotifyMessageEvent, :EvNotifyReceivedDisConnectEvent, :EvNotifySendSpeechRecognitionCommand, \
|
|
116
|
+
:ReqSendDataCompletionNoticeNecessity
|
|
93
117
|
attr_reader :SendDataHexStr, :SendDataLength, :ReceiveStatus, :Version
|
|
94
118
|
|
|
95
119
|
# <summary>
|
|
@@ -734,6 +758,8 @@ class ClientTcpCommunication
|
|
|
734
758
|
reqStartComm.passwd_len = reqStartComm.passwd.length
|
|
735
759
|
#puts "account[#{reqStartComm.name.pack("C*")}] len:#{reqStartComm.name_len}, passwd len: #{reqStartComm.passwd_len}"
|
|
736
760
|
end
|
|
761
|
+
reqStartComm.sdk_lang_type = @SDK_LANG_TYPE
|
|
762
|
+
reqStartComm.sdk_versions = @SdkVersions
|
|
737
763
|
len, data = reqStartComm.makeSendData()
|
|
738
764
|
#p len, data
|
|
739
765
|
if(len > 0)
|
|
@@ -746,9 +772,9 @@ class ClientTcpCommunication
|
|
|
746
772
|
end
|
|
747
773
|
|
|
748
774
|
#HzTrace.traceCommMessage("【CL】通信開始要求送信(0x%02x):Cer[%d] Enc[%d], Port[%d], Name[%s], Passwd[%s], Name Len[%d], Passwd Len[%d]" % \
|
|
749
|
-
HzTrace.traceCommMessage("[CL]Send, Communication Start Request(0x%02x):Cer[%d] Enc[%d], Port[%d], Name[%s], Passwd[%s], Name Len[%d], Passwd Len[%d]" % \
|
|
750
|
-
[reqStartComm.id, reqStartComm.cer_flg, reqStartComm.enc_flg, reqStartComm.port, reqStartComm.name != nil ? name : "", \
|
|
751
|
-
reqStartComm.passwd != nil ? passwd : "", reqStartComm.name_len, reqStartComm.passwd_len])
|
|
775
|
+
HzTrace.traceCommMessage("[CL]Send, Communication Start Request(0x%02x):Cer[%d] Enc[%d], Lang Type[%d], Port[%d], Name[%s], Passwd[%s], Name Len[%d], Passwd Len[%d], Version[%d].[%d]" % \
|
|
776
|
+
[reqStartComm.id, reqStartComm.cer_flg, reqStartComm.enc_flg, reqStartComm.sdk_lang_type, reqStartComm.port, reqStartComm.name != nil ? name : "", \
|
|
777
|
+
reqStartComm.passwd != nil ? passwd : "", reqStartComm.name_len, reqStartComm.passwd_len, reqStartComm.sdk_versions[0], reqStartComm.sdk_versions[1]])
|
|
752
778
|
|
|
753
779
|
#通信開始応答受信(0x10)
|
|
754
780
|
begin
|
|
@@ -905,6 +931,7 @@ class ClientTcpCommunication
|
|
|
905
931
|
sendSpeechData.age = @ReqSendDataSpeechAge
|
|
906
932
|
sendSpeechData.repeat = @ReqSendDataSpeechRepeat
|
|
907
933
|
sendSpeechData.time_stamp = timeStamp.unpack("C*")
|
|
934
|
+
sendSpeechData.completion_notice_necessity = @ReqSendDataCompletionNoticeNecessity
|
|
908
935
|
sendSpeechData.size = sendSpeechData.data.length
|
|
909
936
|
@SendDataLength = sendSpeechData.size #Debug用
|
|
910
937
|
|
|
@@ -921,7 +948,7 @@ class ClientTcpCommunication
|
|
|
921
948
|
end
|
|
922
949
|
|
|
923
950
|
#HzTrace.traceCommMessage("【CL】読み上げデータ送信(0x%02x):Enc[%d], Size[%d]" % [sendSpeechData.id, sendSpeechData.enc_flg, sendSpeechData.size])
|
|
924
|
-
HzTrace.traceCommMessage("[CL]Send, Send Speech Data(0x%02x):Enc[%d], Size[%d]" % [sendSpeechData.id, sendSpeechData.enc_flg, sendSpeechData.size])
|
|
951
|
+
HzTrace.traceCommMessage("[CL]Send, Send Speech Data(0x%02x):Enc[%d], Size[%d], CompleteMsg[%d]" % [sendSpeechData.id, sendSpeechData.enc_flg, sendSpeechData.size, sendSpeechData.completion_notice_necessity])
|
|
925
952
|
|
|
926
953
|
|
|
927
954
|
#読み上げデータ送信応答待機(0x12)
|
|
@@ -16,11 +16,11 @@ class MsgReqStartComm
|
|
|
16
16
|
@INDEX_ID = 0 #メッセージID
|
|
17
17
|
@INDEX_ENC_FLG = 1 #暗号化フラグ
|
|
18
18
|
@INDEX_CER_FLG = 2 #認証フラグ
|
|
19
|
-
@
|
|
19
|
+
@INDEX_SDK_LANG_TYPE = 3 #SDK言語タイプ
|
|
20
20
|
@INDEX_PORT = 4 #ポート番号
|
|
21
21
|
@INDEX_NAME_LEN = 6 #接続元名称サイズ
|
|
22
22
|
@INDEX_PASSWD_LEN = 8 #パスワードサイズ
|
|
23
|
-
@
|
|
23
|
+
@INDEX_SDK_VERSIONS = 10 #SDKバージョン
|
|
24
24
|
@INDEX_NAME = 12 #接続元名称
|
|
25
25
|
#endregion
|
|
26
26
|
|
|
@@ -37,26 +37,26 @@ class MsgReqStartComm
|
|
|
37
37
|
@id = MSG_REQ_START_COMM #メッセージID
|
|
38
38
|
@enc_flg = 0x00 #暗号化フラグ
|
|
39
39
|
@cer_flg = 0x00 #認証フラグ
|
|
40
|
-
@
|
|
40
|
+
@sdk_lang_type = 0x00 #SDK言語タイプ
|
|
41
41
|
@port = 46000 #ポート番号
|
|
42
42
|
@name_len = 0x00 #接続元名称サイズ
|
|
43
43
|
@passwd_len = 0x00 #パスワードサイズ
|
|
44
|
-
@
|
|
44
|
+
@sdk_versions = Array.new(2, 0x00) #SDK バージョン
|
|
45
45
|
@name = nil #接続元名称
|
|
46
46
|
@passwd = nil #パスワード
|
|
47
47
|
#@byte[] reserve { get; set; } #予備
|
|
48
|
-
@head_len = (1 * 4) + (2 * 3) + @
|
|
48
|
+
@head_len = (1 * 4) + (2 * 3) + @sdk_versions.size #ヘッダーサイズ(読み上げデータを除いたサイズ)
|
|
49
49
|
@total_len = 0 #送信フィールド合計サイズ
|
|
50
50
|
end
|
|
51
51
|
|
|
52
52
|
#アクセサ定義(メンバーIndex offset)
|
|
53
|
-
attr_reader :INDEX_ID, :INDEX_ENC_FLG, :INDEX_CER_FLG, :
|
|
53
|
+
attr_reader :INDEX_ID, :INDEX_ENC_FLG, :INDEX_CER_FLG, :INDEX_SDK_LANG_TYPE, :INDEX_PORT, :INDEX_NAME_LEN, :INDEX_PASSWD_LEN, :INDEX_SDK_VERSIONS, :INDEX_NAME
|
|
54
54
|
|
|
55
55
|
#アクセサ定義(送信メンバデータ値)
|
|
56
56
|
attr_reader :ENC_FLG_OFF, :ENC_FLG_ON, :CER_FLG_OFF, :CER_FLG_ON
|
|
57
57
|
|
|
58
58
|
#アクセサ定義
|
|
59
|
-
attr_accessor :enc_flg, :cer_flg, :port, :name_len, :passwd_len, :name, :passwd
|
|
59
|
+
attr_accessor :enc_flg, :cer_flg, :sdk_lang_type, :port, :name_len, :passwd_len, :sdk_versions, :name, :passwd
|
|
60
60
|
attr_reader :id, :head_len, :total_len
|
|
61
61
|
|
|
62
62
|
public
|
|
@@ -84,12 +84,13 @@ class MsgReqStartComm
|
|
|
84
84
|
bPasswdLen = [passwd_len].pack("n*").unpack("C*")
|
|
85
85
|
|
|
86
86
|
if(@name != nil && @passwd != nil)
|
|
87
|
-
data = [@id] + [@enc_flg] + [@cer_flg] + [@
|
|
87
|
+
data = [@id] + [@enc_flg] + [@cer_flg] + [@sdk_lang_type] + bPort + bUserLen + bPasswdLen + @sdk_versions + @name + @passwd
|
|
88
88
|
else
|
|
89
|
-
data = [@id] + [@enc_flg] + [@cer_flg] + [@
|
|
89
|
+
data = [@id] + [@enc_flg] + [@cer_flg] + [@sdk_lang_type] + bPort + bUserLen + bPasswdLen + @sdk_versions
|
|
90
90
|
end
|
|
91
91
|
|
|
92
92
|
rescue Exception => ex
|
|
93
|
+
puts("makeSendData error")
|
|
93
94
|
p ex
|
|
94
95
|
@total_len = 0
|
|
95
96
|
ensure
|
|
@@ -19,7 +19,7 @@ class MsgSendSpeechData
|
|
|
19
19
|
@INDEX_AGE = 7 #年齢
|
|
20
20
|
@INDEX_REPEAT = 8 #リピート回数
|
|
21
21
|
@INDEX_TIME_STAMP = 9 #タイムスタンプ(00:00:00)
|
|
22
|
-
@
|
|
22
|
+
@INDEX_COMPLETION_NOTICE_NECESSITY = 17 #読み上げ完了通知の送信要否
|
|
23
23
|
@INDEX_NAME_LEN = 18 #接続元名称サイズ
|
|
24
24
|
@INDEX_SIZE = 20 #読み上げデータサイズ
|
|
25
25
|
@INDEX_NAME = 24 #接続元名称(可変)
|
|
@@ -61,7 +61,7 @@ class MsgSendSpeechData
|
|
|
61
61
|
@age = 0x00 #年齢
|
|
62
62
|
@repeat = 0x00 #リピート回数
|
|
63
63
|
@time_stamp = Array.new(8, 0x00) #タイムスタンプ(00:00:00)
|
|
64
|
-
@
|
|
64
|
+
@completion_notice_necessity = 0x00 #読み上げ完了通知の送信要否(0x00:必要, 0x01:不要)
|
|
65
65
|
@name_len = 0x00 #接続元名称サイズ
|
|
66
66
|
@size = 0x00 #読み上げデータサイズ
|
|
67
67
|
@name = nil #接続元名称(可変)
|
|
@@ -73,7 +73,7 @@ class MsgSendSpeechData
|
|
|
73
73
|
|
|
74
74
|
#アクセサ定義(メンバーIndex offset)
|
|
75
75
|
attr_reader :INDEX_ID, :INDEX_ENC_FLG, :INDEX_DATA_TYPE, :INDEX_PRIORITY, :INDEX_LANG_CODE, \
|
|
76
|
-
:INDEX_GENDER, :INDEX_AGE, :INDEX_REPEAT, :INDEX_TIME_STAMP, :
|
|
76
|
+
:INDEX_GENDER, :INDEX_AGE, :INDEX_REPEAT, :INDEX_TIME_STAMP, :INDEX_COMPLETION_NOTICE_NECESSITY, :INDEX_NAME_LEN, \
|
|
77
77
|
:INDEX_SIZE, :INDEX_NAME
|
|
78
78
|
|
|
79
79
|
#アクセサ定義(送信メンバデータ値)
|
|
@@ -82,7 +82,7 @@ class MsgSendSpeechData
|
|
|
82
82
|
:GENDER_UNKNOWN, :REPEAT_NONE, :REPEAT_INFINITY
|
|
83
83
|
|
|
84
84
|
#アクセサ定義
|
|
85
|
-
attr_accessor :enc_flg, :data_type, :priority, :lang_code, :gender, :age, :repeat, :time_stamp, :
|
|
85
|
+
attr_accessor :enc_flg, :data_type, :priority, :lang_code, :gender, :age, :repeat, :time_stamp, :completion_notice_necessity, \
|
|
86
86
|
:name_len, :size, :name, :data
|
|
87
87
|
attr_reader :id, :head_len, :total_len
|
|
88
88
|
|
|
@@ -103,10 +103,10 @@ class MsgSendSpeechData
|
|
|
103
103
|
|
|
104
104
|
if(@name != nil )
|
|
105
105
|
mdata = [@id] + [@enc_flg] + [@data_type] + [@priority] + bLangCode + [@gender] + [@age] + [@repeat] + \
|
|
106
|
-
@time_stamp + [@
|
|
106
|
+
@time_stamp + [@completion_notice_necessity] + bNameLen + bSize + @name + @data
|
|
107
107
|
else
|
|
108
108
|
mdata = [@id] + [@enc_flg] + [@data_type] + [@priority] + bLangCode + [@gender] + [@age] + [@repeat] + \
|
|
109
|
-
@time_stamp + [@
|
|
109
|
+
@time_stamp + [@completion_notice_necessity] + bNameLen + bSize + @data
|
|
110
110
|
end
|
|
111
111
|
|
|
112
112
|
rescue Exception => ex
|
data/lib/haruzira_sdk/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: haruzira_sdk
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Symmetry Soft
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-
|
|
11
|
+
date: 2017-02-22 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|