MCPcopy Create free account
hub / github.com/COVESA/vsomeip / send_to

Method send_to

implementation/routing/src/routing_manager_impl.cpp:844–881  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

842}
843
844bool routing_manager_impl::send_to(const client_t _client, const std::shared_ptr<endpoint_definition>& _target,
845 std::shared_ptr<message> _message) {
846
847 bool is_sent(false);
848
849 std::shared_ptr<serializer> its_serializer(get_serializer());
850 if (its_serializer->serialize(_message.get())) {
851 const byte_t* its_data = its_serializer->get_data();
852 length_t its_size = its_serializer->get_size();
853 e2e_buffer its_buffer;
854 if (e2e_provider_) {
855 service_t its_service = bithelper::read_uint16_be(&its_data[VSOMEIP_SERVICE_POS_MIN]);
856 method_t its_method = bithelper::read_uint16_be(&its_data[VSOMEIP_METHOD_POS_MIN]);
857#ifndef ANDROID
858 if (e2e_provider_->is_protected({its_service, its_method})) {
859 auto its_base = e2e_provider_->get_protection_base({its_service, its_method});
860 its_buffer.assign(its_data + its_base, its_data + its_size);
861 e2e_provider_->protect({its_service, its_method}, its_buffer, _message->get_instance());
862 its_buffer.insert(its_buffer.begin(), its_data, its_data + its_base);
863 its_data = its_buffer.data();
864 }
865#endif
866 }
867
868 uint8_t its_client[2] = {0};
869 bithelper::write_uint16_le(_client, its_client);
870 const_cast<byte_t*>(its_data)[VSOMEIP_CLIENT_POS_MIN] = its_client[1];
871 const_cast<byte_t*>(its_data)[VSOMEIP_CLIENT_POS_MAX] = its_client[0];
872
873 is_sent = send_to(_target, its_data, its_size, _message->get_instance());
874
875 its_serializer->reset();
876 put_serializer(its_serializer);
877 } else {
878 VSOMEIP_ERROR_P << "Serialization failed.";
879 }
880 return is_sent;
881}
882
883bool routing_manager_impl::send_to(const std::shared_ptr<endpoint_definition>& _target, const byte_t* _data, uint32_t _size,
884 instance_t _instance) {

Callers 9

call_shutdown_methodMethod · 0.45
offer_serviceMethod · 0.45
subscribe_at_masterMethod · 0.45
TEST_PFunction · 0.45
TEST_FFunction · 0.45
TESTFunction · 0.45
TEST_FFunction · 0.45
sendMethod · 0.45
send_via_sdMethod · 0.45

Calls 15

is_protectedMethod · 0.80
get_protection_baseMethod · 0.80
insertMethod · 0.80
beginMethod · 0.80
find_server_endpointMethod · 0.80
serializeMethod · 0.45
getMethod · 0.45
get_dataMethod · 0.45
get_sizeMethod · 0.45
assignMethod · 0.45
protectMethod · 0.45
get_instanceMethod · 0.45

Tested by 7

call_shutdown_methodMethod · 0.36
offer_serviceMethod · 0.36
subscribe_at_masterMethod · 0.36
TEST_PFunction · 0.36
TEST_FFunction · 0.36
TESTFunction · 0.36
TEST_FFunction · 0.36