someip+*.fidl+*.fdepl(1)

someip+*.fidl+*.fdepl(1)_第1张图片

package commonapi.mthd

interface Methods {
	   version {major 3 minor 1}
	
	   attribute Int32 x//属性(Field)
	
	   method foo {//双向方法(Request & Response Method)
	       in {
	           Int32 x1
	           String x2
	       }
	       out {
	           Int32 y1
	           String y2
	       }
	       error {
	           stdErrorTypeEnum
	       }
	   }
	
	   method newFoo fireAndForget {//单向方法(Fire & Forget Method)
	       in {
	           String MessageName
	       }
	   }
	
	   enumeration stdErrorTypeEnum {
	       NO_FAULT
	       MY_FAULT
	   }
	
	
	   broadcast myStatus {//事件(Event)
	       out {
	           Int32 myCurrentValue
	       }
	   }
	
	   broadcast statusSpecial selective {//事件(Event)
	       out {
	           Int32 NewCurrentValue
	       }
	   }
	}

在这里插入图片描述
具体概念说明参考:https://blog.csdn.net/C_Silence_K/article/details/103613664
someip+*.fidl+*.fdepl(1)_第2张图片
someip+*.fidl+*.fdepl(1)_第3张图片
someip+*.fidl+*.fdepl(1)_第4张图片
someip+*.fidl+*.fdepl(1)_第5张图片

import "platform:/plugin/org.genivi.commonapi.someip/deployment/CommonAPI-SOMEIP_deployment_spec.fdepl"
import "Method.fidl"

define org.genivi.commonapi.someip.deployment for interface commonapi.mthd.Method {
    SomeIpServiceID = 4660//service ID


    attribute x {//Method ID
        SomeIpGetterID = 3000
        SomeIpSetterID = 3001
        SomeIpNotifierID = 33010
        SomeIpEventGroups = { 33010 }
    }

    method foo {//Method ID
        SomeIpMethodID = 30000
        SomeIpReliable = false
        in {
            x2 {
                SomeIpStringEncoding = utf16le
            }
        }
        out {
            y2 {
                SomeIpStringEncoding =utf16le
            }
        }
    }
    method newFoo {//Method ID
        SomeIpMethodID = 30001
        SomeIpReliable = false
        in {
            x2 {
                SomeIpStringEncoding = utf16le
            }
        } 
    }
    broadcast myStatus {//Method ID
        SomeIpEventID = 33020
        SomeIpEventGroups = { 33020 }
    }

    broadcast statusSpecial {//Method ID
        SomeIpEventID = 33030
        SomeIpEventGroups = { 33030 }
    }

    enumeration stdErrorTypeEnum {
        NO_FAULT {
        }
        MY_FAULT {
        }
    }
}

define org.genivi.commonapi.someip.deployment for provider MyService {
instance commonapi.mthd.Method {//服务提供者告知其他节点服务的“入口”在哪里

        InstanceId = "commonapi.mthd.Method"

        SomeIpInstanceID = 22136

        SomeIpUnicastAddress = "192.168.0.2"
        SomeIpReliableUnicastPort = 30500
        SomeIpUnreliableUnicastPort = 30501
    }
}

你可能感兴趣的:(网络协议)