Change-Id: Iebf70874d45c31879f8679b04f3a3e1ea3ed8851
Signed-off-by: Juha Hyttinen <juha.hyttinen@nokia.com>
func (m *RMRClient) SendBuf(txBuffer *C.rmr_mbuf_t, isRts bool, whid int) int {
var (
func (m *RMRClient) SendBuf(txBuffer *C.rmr_mbuf_t, isRts bool, whid int) int {
var (
- currBuffer *C.rmr_mbuf_t
- counterName string = "Transmitted"
+ currBuffer *C.rmr_mbuf_t
- if currBuffer.state != C.RMR_OK {
- counterName = "TransmitError"
+ if currBuffer == nil {
+ m.UpdateStatCounter("TransmitError")
m.LogMBufError("SendBuf failed", currBuffer)
m.LogMBufError("SendBuf failed", currBuffer)
+ return int(C.RMR_ERR_INITFAILED)
- m.UpdateStatCounter(counterName)
+ if currBuffer.state != C.RMR_OK {
+ m.UpdateStatCounter("TransmitError")
+ m.LogMBufError("SendBuf failed", currBuffer)
+ } else {
+ m.UpdateStatCounter("Transmitted")
+ }
return int(currBuffer.state)
return int(currBuffer.state)
}
func (m *RMRClient) SendCallMsg(params *RMRParams) (int, string) {
}
func (m *RMRClient) SendCallMsg(params *RMRParams) (int, string) {